12
SPEC Socket Programming SPEC Socket Programming Logan Daum Mentor: David Schuller CLASSE Physics REU August 13, 2010

SPEC Socket Programming Logan Daum Mentor: David Schuller CLASSE Physics REU August 13, 2010

Embed Size (px)

Citation preview

Page 1: SPEC Socket Programming Logan Daum Mentor: David Schuller CLASSE Physics REU August 13, 2010

SPEC Socket ProgrammingSPEC Socket Programming

Logan DaumMentor: David Schuller

CLASSE Physics REUAugust 13, 2010

Page 2: SPEC Socket Programming Logan Daum Mentor: David Schuller CLASSE Physics REU August 13, 2010

Develop a GUI for controlling motors at D1 Combine the current SPEC command prompt with the video feed Utilize SPEC sockets for communication

2

GoalGoal

Page 3: SPEC Socket Programming Logan Daum Mentor: David Schuller CLASSE Physics REU August 13, 2010

Used for GISAXS (Grazing-Incidence Small-Angle X-ray Scattering) Samples typically organic materials

3

D1D1

CCDDetector

X-RaySource

Microscope

Sample Stage

Page 4: SPEC Socket Programming Logan Daum Mentor: David Schuller CLASSE Physics REU August 13, 2010

Controls the microscope video feed and motors at F1 Used at D1 for the video feed only

Written in Java, based on a client-server model Server – Interfaces with motors and the video Client – GUI instances

Each control group in the GUI is installed as a plug-in Motor controls communicates directly with motors at F1 At D1, SPEC is used to interface with motors

4

MacCHESS Crystal CenteringMacCHESS Crystal Centering

Page 5: SPEC Socket Programming Logan Daum Mentor: David Schuller CLASSE Physics REU August 13, 2010

Buttons and dials to move motors

Click to move

Camera and light controls

Snapshots

Autocentering

Session parameters saved 5

FeaturesFeatures

Page 6: SPEC Socket Programming Logan Daum Mentor: David Schuller CLASSE Physics REU August 13, 2010

Data acquisition and XRD software package by Certified Scientific Software

Command line interface C-like syntax Macro support

Server mode Interact with other software over a network through sockets TCP sockets – ordered error-free data transfer Packets follow a specific format defined by SPEC

6

SPEC ServerSPEC Server

Page 7: SPEC Socket Programming Logan Daum Mentor: David Schuller CLASSE Physics REU August 13, 2010

SPEC packet format Header – holds packet parameters and defines the data type Data – holds the command or values for SPEC

Socket communication was tested in C++, Python, and Java C++

Struct class and native data types useful for writing the packet Python

Easy access to C structs and types Socket connections simple

Java Data types different (chars = 2 bytes, no long int) and no struct class Socket connections simple

7

SPEC Server CommunicationSPEC Server Communication

Page 8: SPEC Socket Programming Logan Daum Mentor: David Schuller CLASSE Physics REU August 13, 2010

Existing motor plug-in replaced with SPEC plug-in

8

Integrating SPEC with Crystal CenteringIntegrating SPEC with Crystal Centering

GUI Clients

Server Plug-in

SPEC

Dial Moved

Create SPEC

Packet

Motor Moved

Motor Moved

Parses SPEC

Packet

Dial Updated

Page 9: SPEC Socket Programming Logan Daum Mentor: David Schuller CLASSE Physics REU August 13, 2010

Select motors for each axis Poll SPEC for motor names Set motor name and scaling

factor

9

New GUI FeaturesNew GUI Features

Preset zoom and focus settings Both settings are usually coupled 3 possible preset values

Page 10: SPEC Socket Programming Logan Daum Mentor: David Schuller CLASSE Physics REU August 13, 2010

10

Page 11: SPEC Socket Programming Logan Daum Mentor: David Schuller CLASSE Physics REU August 13, 2010

Shutter Control Button Toggle button to open and close the shutter Track shutter state Automatically controlled at D1

Camera Button Sync CCD detector images with microscope video snapshots Save to the same filename prefix

11

Future WorkFuture Work

Page 12: SPEC Socket Programming Logan Daum Mentor: David Schuller CLASSE Physics REU August 13, 2010

Mentor: David Schuller Detlef Smigies, Darren Dale

Phil Sorenson

CLASSE REU program NSF Grant

12

AcknowledgementsAcknowledgements