|
|
Coming in version 4
TCPIP device Gen4 is a TCPIP interface between SpecMan4EPR and compatible TCPIP server. All functions of SpecMan4EPR are streamed to this device. TCPIP device Gen4 allows to write custom device code. Current function of this driver is to study SpecMan-device interface.
TCPIP device connects to a server, retrieve device description and control the communication.
The exchange protocol has two packet types and two modes - with handshake and without. The simple packet delivers a value of a single property. Large packet transfers a buffer with data. The exchange with handshake forces SpecMan4EPR to wait for device's response.
The TCPIP driver can be only partially configured using Device Configuration dialog. The presence of device properties is defined by setting corresponding entries in the device section of Device Configuration (CFG)
Packet structure (LSB first)
| Field |
Format |
Description |
| Property number |
int32 |
Negative values are special commands, 0...n are regular properties |
| Flags |
uint32 |
LSB: data type. empty = 0, int32 = 1, float32 = 2, double64 = 3, string = 4, binary = 5,
error = 100, device object = 101, int32 array = 11, double32 array = 12, float32 array = 13.
MSB: protocol. dfNoFlags = 0x00, dfHandshake = 0x40 timely response is requested, dfGetDataCommand - transient data return. |
| Size |
uint64 |
Size of the buffer |
| Checksum |
uint16 |
Checksum for first 16 bytes. MSB: add even bytes. LSB: add odd bytes. |
| Buffer |
n bytes |
Payload. For data types 0 and 1 must be 4. For array types: dimensions (int32*6) array sizeof(type)*product of dims |
Communication protocol. SM: SpecMan4EPR (client). DEV: device (server). P = Packet. Arguments: (PropertyNumber, Flag, Value), dfFormat is any of int32, float32, double64, string, dfArray is any of array formats
| Operation |
Actions |
| Initialization |
SM->DEV: P(-500, dfHandshake|empty).
DEV->SM: P(-500, dfHandshake, 1 - ready, 0 - not ready).
DEV->SM: P(-600, device object, all device components: properties, config keys etc).
DEV->SM: P(-601, int32, device status) optional
|
| De-Initialization |
SM->DEV: SP(-501, dfNoFlag|empty).
|
| Send value (with handshake) |
SM->DEV: SP(Property Number, dfHandshake|dfFormat, Value).
DEV->SM: SP(Property Number, dfHandshake|dfFormat, Return Value).
|
| Send value (EOP - end of programming) |
SM->DEV: P(Property Number 1, dfNoFlags|dfFormat, Value).
SM->DEV: P(Property Number 2, dfNoFlags|dfFormat, Value).
SM->DEV: P(-1102, dfHandshake|empty) - initiate action.
DEV->SM: P(-1102, dfHandshake|empty).
|
| Get value (with handshake) |
SM->DEV: P(Property Number, dfHandshake|empty).
DEV->SM: P(Property Number, dfHandshake|dfFormat, Return Value). SM: Value is received.
|
| Pulse |
SM->DEV: P(-1105, binary, Payload)
|
| StartOfSequence |
SM->DEV: P(-1106, binary, Payload)
|
| EndOfSequence |
SM->DEV: P(-1107, binary, Payload)
|
| dcSendProgram2Device |
SM->DEV: P(-1101, binary, Payload)
|
| Acquisition protocol |
SM->DEV: P(-1005, binary, Trace|TriggerPerSequence|Triggers|Shots(int32x4)).
|
| Transient array |
SM->DEV: P(-1000, empty). Arm.
DEV->SM: P(Property Number, dfArray|dfGetDataCommand, Array) - when ready.
|
|