Communication Protocol
All shorts and ints
are sent as ASCII characters, int is 8 Hex digits and a short here is
4 Hex digits. Floats are sent represeneted as ints.
|
Command |
Server Response |
|---|---|
|
version |
int version = 0xb; |
|
revision |
int revision = 4; |
|
status channels 3 |
0000 for OK or an error code in the same format. int num_channels; |
Data is requested using 'start net-writer' command variations.
In response the server send the data stream which consists of a
header, block of data and reconfiguration blocks. All data variables
are binary here, big endian.
|
Data Structure |
Representation |
|---|---|
|
header (length, |
long length; // 16 + following data block's length |
|
data_block |
time series data grouped by channel (not by time) at the sampling rate requested in 'start net-writer' command. If requesetd two channels then in this data blocks server sends data for the first channel and then data for the second channel. |
|
signal_conv |
float signal_slope; |
|
reconfig_block |
header(seconds = -1) followed by reconfiguration data in the
following format: |
|
Data Request Command |
Request Description |
Server Response |
|---|---|---|
|
gps |
Get current GPS time |
header(length = 16), ie. no data just header with current GPS time |
|
start net-writer { |
Request full resolution online data on the same socket. All channels are wanted at 128 Hz sampling rate. Data is averaged and decimated by the server. Data is not filtered. Requesting data at lower sampling rate is only usefull for display purposes. |
header |
|
start trend net-writer 775155636 600 {
"H2:SUS-SM1_SUSPIT_INMON.min"
"H2:SUS-SM1_SUSPIT_INMON.max"
"H2:SUS-SM1_SUSPIT_INMON.mean" |
Request 600 seconds of second trend data. |
header |
|
start trend 60 net-writer "7001" 775669072 86400 {
"H2:IOO-PZT1_PIT_OFFSET.min"
"H2:IOO-PZT1_PIT_OFFSET.max"
"H2:IOO-PZT1_PIT_OFFSET.mean" |
Get minute trend data and route to TCP port 7001 on requestor's host. Time period of data requested is 775669072 upto 775669072 + 86400 (ie. 86400 is the time series data length in seconds). Channel names wanted are specified in double quotes in curly braces. |
header |
Examples
Here
is one example
of data access client program based on daqc_access.c
code. DataViewer
is another example. DTT
has its own access library.
Data Valid
Codes
We have 0xbad status set
by either DAQ controller or a frame builder when the DCU is not on
time (out of sync). There is also status bit 0x1000 that's added when
the data for that block did not check out using the CRC,
ie.
checksum mismatch between front-end and frame builder. There is also
status bit 0x2000 which gets added when the DCU configuration is
different in front-end and frame builder. That is you can change and
.ini file an then reload DAQ configuration with Epics button, which
reconfigures the front-end, but leaves frame builders with invalid
old configuration. They will detect this change and set the status to
0x2000 to indicate this condition. You will have to restart frame
builders to pick up new .ini file and set status back to zero for the
affected DCU.
DAQ controller only handles out of sync DCU condition and
frame builders handle all three error conditions.
Weathered
Stuff
Older communication protocol description is
available here.
It is not entirely correct for the current version of the protocol.
Data acquisition application (a client program) written in Java programming language is available for download. This allows a user to get any of the server's data channels written into a file(s) on the client's machine. Several data formats are supported, including tab separated values format, which can be imported into a spreadsheet or any other analysis or visualization program. JdClient can be used within Triana as a data input unit. Documentation is available online.
Matlab frame file import function is available. This one allows the import of one or several ADC channels from a file containing one or more frames. Requires the FrameL library to compile. Matlab binary MEX file for the Solaris 2 architecture is available for download.
-------
Last modified on 5 August 2004 by Alex