Skip to content

DAQ Server

Tobias Knopp edited this page Jan 9, 2018 · 6 revisions

THE INFORMATION ON THIS PAGE IS OUTDATED -> NEEDS TO BE REVISED

The purpose of the DAQ server is to allow controlling the Red Pitaya from a client computer. It is similar to the scpi server but its functionality is tailored for a specific application. If your needs are a little different, it should be straight forward to adapt the server code.

Application

The application that the daq_server has been developed uses D=1-4 Red Pitayas and and sends on each board a four tone sine wave. Each Red Vitaya has a main frequency while the multi-tone sending is used for decoupling electrical networks in a control loop

Once the server is started it is possible to modify the amplitude/phase of the send signal continuously.

Period Length / Frame Length

In our application the send frequencies together define a certain period length. For instance when using a modulus of 4800 (=> about 26041.666 Hz frequency) and a decimation of 16, the period length is N=300 samples. When using 2-4 different frequencies, the period length can be much larger.

One frame is a collection of M periods. In the daq_server it is possible to change the slow DAC pins once per period. This allows for fully synchronous IO. If this is not needed, you can simply disable it and chose frame length = period length.

Copy to larger Ring Buffer

In our application we need to sample full frames of data. For this reason, we allocate a buffer that has about 256 MB of size on the Red Pitaya. However, the exact size is a multiple of the frame length NM. This has the large advantage that the buffer is always divided into frames and that the frame boundaries do not change when the buffer overflows.

Network communication

Instead of sending all data to the network, we chose a mode where the client pulls the data from the server. One can track the "frame pointer" in order to pull the data.

Starting the server

The daq_server can be started by hand using the commands

export LD_LIBRARY_PATH=/root/RedPitayaDAQServer/build/lib
/root/RedPitayaDAQServer/build/server/daq_server

Setting up the server as a systemd service

The daq_server can also be started as a systems service

systemctl start daq_server

To enable it at startup type

systemctl enable daq_server

The output of the server is written to /var/log/daq_server.log