T7 stream quadrature python example | LabJack
 

T7 stream quadrature python example

2 posts / 0 new
Last post
Nora
abbaszadeh@ovgu.de's picture
T7 stream quadrature python example

Hello,

I need to perform quadrature and analog ports data streaming. For the analog input the python example is quite clear and useful. It worked for me after seconds. Nevertheless I was not clear with chapter 13.1.11 to stream quadrature signals:

All operations discussed in this section are supported in command-response mode.  In stream mode, you can read from the integer READ registers (A, B, A_AND_RESET), but as mentioned in the Stream Section those reads only return the lower 16 bits so you need to also use STREAM_DATA_CAPTURE_16 in the scan list to get the upper 16 bits.

I took the read function of my working quadrature by command-response script:

fioA = "DIO"+str(ioNumber)  # Digital input for signal A of encoder
 fioB = "DIO"+str(ioNumber+1)
 readA = fioA+"_EF_READ_A"  # Read from encoder signal A
 addrA = ljm.nameToAddress(readA)[0]     # Get the Address of signal

...

quad = ljm.eReadAddress(self.handle, addrA, ljm.constants.INT32)
# resolution of emulation feedback (x9) is 8192 count/rev
position = 360.0*quad/8192.0

and moved the same input to the example script with  "STREAM_DATA_CAPTURE_16" :

# Stream Configuration
aScanListNames = ["DIO6_EF_READ_A", "STREAM_DATA_CAPTURE_16" ]

...later

positionFB.append((pos0[l]+pos1[l]*65536)*360/8192.0)

to join the values. I always receive a '0.0' for the second 16bit, and the signal is giving wrong values.

I don't get my error. Could you please give me some advice or a example code snippets?

Thanks you very much

LabJack Support
labjack support's picture
Let's start by updating the

Let's start by updating the T7's firmware to 1.0225. There were a number of changes related to steaming DIO_EFs.