Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

usb-6008 analog output timing - software timer

Hi guys,
 
I'll preface this by saying i'm very new at this, so hopefully I haven't just overlooked an easy solution or otherwise goofed up. I am using the USB-6008 to collect data from 3 sensors (2 pressures sensors and 1 flowmeter) and to control an output voltage (analog output) with Labview 8.0. So far things have been working very well and I am happy with how things are performing. The next step in the plan is to implement a closed loop control that controls the analog output based on a flow rate. I've written a PID Vi to do the mathematical operations, but I'm having difficulty with syncronizing the analog input with the output signal. From what I've read on the boards the USB-6008 doesn't have timed analog outputs. I don't think this will be prohibitive for our project, since we only need low frequency control (possibly as low as 10 hz, certainly no more than 100 hz). I've also read that the USB-6008 updates the Ao terminals at about 150 hz, so I am fairly certain (unless I'm missing something) it should be possible to use a software timer to sync the input and output. While, from what I understand, this will lead to a somewhat non-deterministic timing arrangement, I think the low frequency of our timing needs alleviates some of these problems. Am I wrong?
 
So essentially I am asking for some insight on how to write a software timer that will sync the input and output channels with a timed control loop (the loop timing I can handle, based on examining examples I've seen). I've tried to be complete in this post, but if I left out any important information please let me know and I'll do my best to provide it.
0 Kudos
Message 1 of 3
(3,339 Views)
Hello Evan,

Your best option would be to do single-point software-timed reads and writes in a loop (whether its a timed loop or not is up to you...I don't really think it would be necessary).  With your control application, it doesn't really make sense to me to speak of synchronizing the input and output operations.  With a PID control algorithm, you have to read an input value, process that data, then output a value.  Thus, there is a necessary delay between the input and output.  Normally, synchronization means that the input and output happen at exactly the same time according to a hardware sample clock signal. 

With the lack of hardware-timed analog output on the USB-6008, there is no way to truly synchronize them.  The best you can do is to have both operations in a loop that runs at a certain rate.  I hope this helps!

Best regards,
0 Kudos
Message 2 of 3
(3,323 Views)
Jarrod,
 
Thanks, I tried that out and it's working quite well. I went ahead and used a timed loop with single-point read and write on the respective channels, and things look good. Thanks for your help with the issue!
0 Kudos
Message 3 of 3
(3,309 Views)