Usage
The server software has two modes:
server mode (default) - the server listens for incoming connections and processes them as they come in.
local mode - the software is set up using command line arguments and processes a single request.
There are command line arguments that can be used in general for both modes:
--help
- display the help message and exit.--version
- display the version of the software and exit.
Server mode
The server mode is the default mode. It starts to listen for incoming connections on the specified port and processes them as they come in. Multiple connections can be processed at the same time but only one measurement can be processed at a time.
To start the server in server mode, simply run the server software without any arguments. The server will listen for incoming connections on the default port (33333) and process them as they come in.
./akr2daq3
There is on command line argument to set the port number for the server:
p
,--port
- set the port number for the server to listen on (default 33333).
Message format
All messages have the following format:
1 byte - unsigned byte - the message type.
4 bytes - unsigned integer - the message length.
n bytes - the message data.
With the exception of the messages DMA0
and DMA1
all message data is in
JSON format. The DMA0
and DMA1
messages contain the raw data from the ADC.
The data contains the measurement values of the ADC as 16 bit integers in
arbitrary units representing the voltage.
Message types
All available message types as well as their message data are described in the
following documentation of the MessageType
enumeration.
See nexmess::components::network::MessageType
for more information
including examples.
Local mode
The local mode is used to process a single request. The request is specified using command line arguments. The server software will process the request and print the result to the standard output while optionally saving the measurement data to a files.
To start the server in local mode, use the -l
or --local
command line
argument. The request is specified using the following command line arguments:
-r, --raw-data
- Store raw data-c, --count-data
- Store count data--storage-location
- The location where the measurement data is stored. The location must be a directory and the file name is generated by the server based on the current time, date and selected channels (default: None).--channels
- The channels to measure. The channels are specified as number (1 -> 1, 2 -> 2, 3 -> both) (default: 1).--invert
- Select the channels to invert. The channels are specified as number (0 -> None, 1 -> 1, 2 -> 2, 3 -> both) (default: 0).--fir
- Select the channels to be filtered by an FIR filter. The channels are specified as number (0 -> None, 1 -> 1, 2 -> 2, 3 -> both) (default: 0).--offsets
- The offsets to apply to the channels. If a single value is given, it is applied to both channels. If two values are given, the first value is applied to channel 1 and the second value is applied to channel 2. The two values are separated by a comma (e.g. ‘10,-19’) (default: 0).--measurement-time
- The Measurement time in milliseconds (default 10).--trigger-values
- The trigger values in arbitrary units of the ADC. If a single value is given, it is applied to both channels. If two values are given, the first value is applied to channel 1 and the second value is applied to channel 2. The two values are separated by a comma (e.g. ‘100,200’) (default: 100).--long-gates
- The long gate times in samples. The long gate is the amount of samples which are output for each triggered event. If a single value is given, it is applied to both channels. If two values are given, the first value is applied to channel 1 and the second value is applied to channel 2. The two values are separated by a comma (e.g. ‘100,200’) (default: 100).--pre-gates
- The pre gate times in samples. The pre gate is the amount of samples which are output before the trigger event. If a single value is given, it is applied to both channels. If two values are given, the first value is applied to channel 1 and the second value is applied to channel 2. The two values are separated by a comma (e.g. ‘10,20’) (default: 10).--version
- Shows the version of the software and exit.