Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

USB 6216 cycle acquisition

Hello everyone.

I have a problem with a task that I was given. I have an USB 6216 acqusition board which I use to gather data from a wheel speed sensor (pulse train). I'll use a counter to count all the pulses in a cycle of 50 ms +-1ms.

The problem is that the project leader wants the 50ms window to be as strict as possible, so he wants the counter value to be saved in the FIFO every 50 ms and then sent over USB to the PC. The counter is then reset for the next cycle.

My question is: Is it possible to send data from the board to the PC every 50 ms? What I mean is, not send the data because of a request from a script on the PC (like task.read() or something) but the PC script to be monitoring continuously the USB port for data. The board decides when to send the data.

In every VI that I used so far I always put the Read VI inside a timed loop and that's how acquired the data.

 

But now, the script will be in Python and will make use of the new API...

So, is what I want to do possible? Or does the timed loop have to be in the software?

 

Thank you in advance for your answers.

0 Kudos
Message 1 of 2
(1,752 Views)

Hello,

Have you thought about using a producer/consumer architecture with the timed loop so that whenever the timed loop finishes, the data will be output to the consumer and logged? 

 

You are probably aware, but unless you are using a real-time OS and/or real-time device such as a cRIO, you will not have extremely tight control over the timing of loops.  Most things using standard OS's (like Windows or standard Linux distributions) will only achieve a timing resolution of a few milliseconds. 

DillonL.
0 Kudos
Message 2 of 2
(1,713 Views)