SPEC Socket Programming Logan Daum Mentor: David Schuller CLASSE Physics REU August 13, 2010.
-
Upload
charla-houston -
Category
Documents
-
view
219 -
download
2
Transcript of 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
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
Used for GISAXS (Grazing-Incidence Small-Angle X-ray Scattering) Samples typically organic materials
3
D1D1
CCDDetector
X-RaySource
Microscope
Sample Stage
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
Buttons and dials to move motors
Click to move
Camera and light controls
Snapshots
Autocentering
Session parameters saved 5
FeaturesFeatures
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
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
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
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
10
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
Mentor: David Schuller Detlef Smigies, Darren Dale
Phil Sorenson
CLASSE REU program NSF Grant
12
AcknowledgementsAcknowledgements