|
TCPIP device is an interface between SpecMan4EPR and other control code, e.g. written in LabView™. TCPIP protocol allows to connect devices remotely.
At a moment TCPIP device supports read only and write only properties but does not do transient signal acquisition, however in the future fully functional device driver is planned.
The remote part of the TCPIP interface has to be built using client-server technology. It can be written using any language on any platform that supports TCPIP. TCPIP device is connected as a client to the external interface that works as a server. The template for remote interface written using LabView™ is available.
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)
Configuration file example:
par0=Field, G, write, hshake, 0.1G, 0.1G,-6,-5G,5G
par1=Gradient, G/cm, write, hshake, 0.1G/cm, 0.1G/cm,-6,-5G/cm,5G/cm
UseEOP=false
Entry |
Value |
Description |
DeviceDLL |
DUMMY |
Device specification |
IP |
<computer name> of xxx.xxx.xxx.xxx |
Server IP |
port |
[n] |
Server port |
par[n0] |
<name>, <unit>, [write/read/rwrite], [(nohshake)/hshake]
|
Definition of value-based device property
|
Simple Packet
Field |
Format |
Description |
Property number |
integer (4 bytes, LSB first) |
Negative values are special commands, 0...n are regular properties |
Flag |
unsigned (4 bytes, LSB first) |
dfLargePacket = 0x80000000, should be unset for simple packet
dfHandshake = 0x40000000 dfError = 0x10000 dfNoFlags = 0
Errors are returned in LSB.
|
Value |
double (8 bytes, LSB first) |
|
Large Packet
Field |
Format |
Description |
Property number |
integer (4 bytes, LSB first) |
|
Flag |
unsigned (4 bytes, LSB first) |
dfLargePacket = 0x80000000, should be set
dfHandshake = 0x40000000 |
Size |
integer (4 bytes, LSB first) |
Size of buffer |
Buffer |
n bytes |
Buffer |
Communication protocol. SM: SpecMan4EPR (client). DEV: device (server). SP = Small packet. LP = Large packet. Arguments: (PropertyNumber, Flag, Value)
Operation |
Actions |
Initialization |
SM: Connect to DEV. SM->DEV: SP(-500, dfHandshake, 0).
DEV->SM: SP(-500, dfHandshake, 0). SM: Device is ready.
|
De-Initialization |
SM->DEV: SP(-501, dfNoFlag, 0).
|
Send value (with handshake) |
SM->DEV: SP(Property Number (0...n), dfHandshake, Property Value).
DEV->SM: SP(Property Number (0...n), dfHandshake, Return Value). SM: Value is set.
|
Send value (EOP) |
SM->DEV: SP(Property Number 1 (0...n), dfNoFlags, Property Value).
SM->DEV: SP(Property Number 2 (0...n), dfNoFlags, Property Value).
SM: Values are updated immediately.
SM->DEV: SP(-1102, dfHandshake, 0).
DEV: Values are expected to be set.
DEV->SM: SP(-1102, dfHandshake, 0).
|
Get value (with handshake) |
SM->DEV: SP(Property Number (0...n), dfHandshake, 0.0).
DEV->SM: SP(Property Number (0...n), dfHandshake, Return Value). SM: Value is received.
|
Get transient value (with handshake) not implemented |
SM->DEV: SP(Property Number (0...n), dfHandshake|dfGetDataCommand, 0.0).
DEV->SM: LP(Property Number (0...n), dfHandshake, Return Buffer). SM: Buffer is received.
|
|