50 kHz Scan Chain Problem | LabJack
 

50 kHz Scan Chain Problem

5 posts / 0 new
Last post
caryben
caryben's picture
50 kHz Scan Chain Problem

I'm trying to create a scan chain at the specified rate and I am having trouble finding a function that can do that. I have tried using software (python) to iterate the bit stream but I can't get speeds above 2.5 kHz. How can I load the bits into the labjack and then have them communicated out of a digital output? If that isn't possible how can I make the output faster? Do I need another labjack version?

My code:

x = 0

while(True):

    if(x % 2 == 0):

        b.setFIOState(0, state = 1)

    else:

        b.setFIOState(0, state = 0)

    x+=1

LabJack Support
labjack support's picture
On average command-response

On average command-response USB speeds for setting digital I/O (setFIOState) is about 0.6 ms, and the U3 doesn't support stream out functionality where you can set digital I/O with stream mode and its speeds. Only the T7 and UE9 support that.

If you just need repeating output pulses on a digital line at a specified speed, you can look into using a timer with a PWM timer mode:

https://labjack.com/support/datasheets/u3/hardware-description/timers-co...
https://labjack.com/support/datasheets/u3/hardware-description/timers-co...

Here's a PWM example:

https://github.com/labjack/LabJackPython/blob/master/Examples/PWM-loopin...

LabJack Support
labjack support's picture
Frequency output timer mode

Frequency output timer mode would also be a good one to use:

https://labjack.com/support/datasheets/u3/hardware-description/timers-co...

caryben
caryben's picture
Thanks for the help! 

Thanks for the help! 

I have a quick follow up question. With the T7 and UE9 would I be able to have 5 digital outputs and 1 input all running at the same time that are all controlled by one internal clock signal still at the 50kHz rate?

LabJack Support
labjack support's picture
The T7 has a stream output

The T7 has a stream output feature that can output up to 8 bits at a time. That combined with a stream input channel will allow you to update up to 8 digital outputs and read 16 digital inputs at up to 50 kHz.

The T7 can stream at up to 100 kHz, That's 100 thousand channels per second. Both stream out and stream in contribute a channel making the total speed 50 kHz. The UE9 operates differently. The stream out does not consume as much time, but the stream rate is limited to 50 kHz. The UE9 will probably only work at 40-45 kHz.

I'm a little confused about what you are trying to do. Do you need 5 frequency outputs? Do those outputs need to vary frequency or duty cycle?