DIO#_EF_READ_A - Stream as UINT32 | LabJack
 

DIO#_EF_READ_A - Stream as UINT32

3 posts / 0 new
Last post
Bryan Steer
bsteer@merlincsi.com's picture
DIO#_EF_READ_A - Stream as UINT32

I am using the Pulse Width feature, and correctly see the values in DIO#_EF_READ_A as UINT32, however when I stream the data the value comes back in the stream as UINT16 so the values are incorrect.

Is there any way to get the streamed value back as a UINT32.

LabJack Support
labjack support's picture
You need to use STREAM_DATA

You need to use STREAM_DATA_CAPTURE_16 which is mentioned in Section 3.2 of the T7 Datasheet:

https://labjack.com/support/datasheets/t7/communication/stream-mode

Stream data is transferred as 16-bit values only.  In the normal case of an analog input such as AIN0, the 16-bit binary value is actually is what is transferred and LJM converts it to a float on the host using the calibration constants that LJM reads in before starting the stream.  Some registers in the list above (e.g. DIO4_EF_READ_A) have 32-bits data.  When streaming a register that produces 32-bit data, the lower 16-bits (LSW) will be returned and the upper 16-bits (MSW) will be saved in STREAM_DATA_CAPTURE_16. To get the full 32-bit value, add STREAM_DATA_CAPTURE_16 to the stream scan list after any applicable register, then combine the two values in software (LSW + 65536*MSW).  Note that it would not be unusual to put STREAM_DATA_CAPTURE_16 in multiple locations in the scan list.

Bryan Steer
bsteer@merlincsi.com's picture
Thank you the fixed the

Thank you the fixed the problem.