Stream data from AIN and DIO in parallel with setting DAC voltage | LabJack

Stream data from AIN and DIO in parallel with setting DAC voltage

3 posts / 0 new
Last post
tomaszbiel's picture
Stream data from AIN and DIO in parallel with setting DAC voltage

I use Labjack T7 with the latest FW and Linux drivers. I also use the python package to control the Labjack device.
I am observing the problem with setting the DAC voltage while a stream of AIN and DIO is in progress.

The use case is as follows:
Our tested device is connected to labjack T7 and we try to test the power off behavior (some of the analog and digital outputs should go low after detecting low voltage on the Supply Voltage monitoring pin).
- DAC0 connected to Supply Voltage monitoring pin
- AIN0 connected to the Analog Output
- DIO22 connected to the Digital Output

Test case:
- start a stream of AIN0 and DIO22 for 1s with 20kHz sampling frequency
- in parallel, after ~ 200ms set DAC0 voltage from 3.2V to 0V.
- observe a drop of signals on AIN0 and DIO22

Sometimes (~ 1 per 100 executions of the test scenario) DAC0 is not set to 0V (confirmed with a multimeter that it stays at 3.2V) and our test fails.
Reading DAC0 voltage (using ljm.eReadName() report ~0V). This means that the register value does not reflect the actual DAC output.

This is a limitation of the labjack's FW (it is not allowed to set DAC0 while streaming) or a bug?

LabJack Support
labjack support's picture
There is a resource conflict

There is a resource conflict between the DAC terminals and AIN. This can only cause problems when running stream mode due to the AIN updating in a high priority interrupt, which could potentially interrupt the DAC write. There is code to retry the DAC write, but this is more prone to failure at higher stream rates. When doing command response, the DAC and AIN commands would run one at a time and never conflict.

I would recommend setting the DAC output using stream out to prevent the issue. This would set the DAC in the stream interrupt, thereby avoiding the resource conflict. Stream out is described on the following page:

Thank you for pointing this out; we will look into further solutions for this issue.

tomaszbiel's picture
Thank you for your answer. I

Thank you for your answer. I will check the suggested solution.