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.

_images/messageformat.png

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:

  • --measurement-time - the time of the measurement in milliseconds (default 10).

  • --channels - the channels to measure. The channels are specified as number (1 -> 1, 2 -> 2, 3 -> both) (default: 1).

  • --trigger-value - the trigger value in arbitrary units of the ADC (default: 100).

  • --long-gate - the long gate time in samples. It stands for the number of samples that are taken after the trigger is detected (default: 100).

  • --pre-gate - the pre gate time in samples. It stands for the number of samples that are taken before the trigger was detected (default: 10).

  • --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).