SerialEMCCD plugin calls#
Every GS_* call fastcs-gatan makes, in the same groups as
Attributes. Codes are from SEMCCDDefines.h; argument counts match
the plugin’s argument table
(SocketPathway.cpp L79-L120,
commit 4d6e4b1), and the function code itself is not counted.
GatanSocketConnection methods are in fastcs_gatan.connection.
Message format#
Request: a 4-byte length (whole message, in bytes), then the arguments grouped by type: the function code and other longs (int32), then BOOLs (int32), then doubles (float64), then an optional array of longs (used to carry strings).
Reply: the same layout. The first long is the status: 0 = OK, otherwise an error code (
SEMCCD_ERRORS).Image reply: five longs (status, array size, width, height, number of chunks), then the pixel data, 2 bytes per pixel, in chunks of up to 32 MiB. Before each chunk after the first, the client sends a bare
GS_ChunkHandshake(code 24) (L849-L878).
Version and diagnostics#
Call |
Code |
Method |
Sends |
Returns |
Used by |
|---|---|---|---|---|---|
|
14 |
|
long version |
|
|
|
42 |
|
longs version, build |
not exposed |
|
|
31 |
|
long version |
|
|
|
32 |
|
long error |
|
|
|
15 |
|
BOOLs can select shutter, can set settling, open shutter works |
not exposed |
Dose rate#
Call |
Code |
Method |
Sends |
Returns |
Used by |
|---|---|---|---|---|---|
|
40 |
|
double dose rate |
|
Camera selection and insertion#
Call |
Code |
Method |
Sends |
Returns |
Used by |
|---|---|---|---|---|---|
|
11 |
|
long count |
|
|
|
4 |
|
long camera |
|
|
|
9 |
|
long camera |
not used |
|
|
12 |
|
long camera |
BOOL inserted |
|
|
13 |
|
long camera; BOOL state |
|
Shutter and settling#
Call |
Code |
Method |
Sends |
Returns |
Used by |
|---|---|---|---|---|---|
|
16 |
|
longs camera, shutter |
not used |
|
|
17 |
|
long camera |
not used |
Read mode and K2/K3 parameters#
Call |
Code |
Method |
Sends |
Returns |
Used by |
|---|---|---|---|---|---|
|
10 |
|
long mode; double scaling |
|
|
|
29 |
|
longs mode, hardwareProc, rotationFlip, flags, filter size; BOOLs doseFrac, alignFrames, saveFrames; doubles scaling, frameTime and 4 more (sent as 0); array: filter name |
|
Exposure: GetAcquiredImage#
Shared by single image, continuous and dose fractionation; see Attributes for what decides the mode. Every call returns one image.
Call |
Code |
Method |
Sends |
Returns |
Used by |
|---|---|---|---|---|---|
|
6 |
|
longs array size, width, height, processing, binning, top, left, bottom, right, shutter, shutter delay, divide-by-2, corrections; doubles exposure, settling |
image reply: width, height, pixels |
|
fastcs-gatan sends top and left as 0, bottom and right as the height and width, and shutter delay, divide-by-2, corrections and settling as 0.
Continuous#
Call |
Code |
Method |
Sends |
Returns |
Used by |
|---|---|---|---|---|---|
|
6 |
as above |
as above |
|
|
|
30 |
|
|
Dose fractionation (frame saving)#
Call |
Code |
Method |
Sends |
Returns |
Used by |
|---|---|---|---|---|---|
|
27 |
|
longs rotationFlip, flags, names size; BOOL filePerImage; doubles pixelSize and 4 more (sent as 0); array: save folder, root name, then any strings the flags call for |
long error |
|
|
26 |
|
longs frames saved, error |
|
Plus SetK2Parameters2 and GetAcquiredImage from the groups above.