03-25-2011 03:27 AM - edited 03-25-2011 03:31 AM
Hi guys:)
I have a small problem. I need to turn on a relay, then wait 5 ms, and then turn off the relay. It is crusual that it's always 5ms.
Software: LV2010 SP1
Hardware: DAQmx USB-6225.
Until now I've just been using the DAQ asistant. But for this task it's way to slow and unstable.
The fastes time between rising and falling edge is 7,5ms. And it's not stable, since I sometimes get 8,9 and 10 ms.
I've tried using the DAQmx palette:
With this I can get a pulse of 1ms (task and error lines are connected ofcourse and I use port0, line0.).
But still it's sometimes 1,5ms. To get 5ms i tried putting in the openG wait timer which has error in and out to control the dataflow. But I get a random length of my pulse, like 4-6 ms.
My question is:
How can I get this to be excactly (or as close as possible) 5ms? I have llok at the Timing and Triggering functions on the DAQmx palette, but I can't figure this out. With the timing I set the rate to 1000 and number of samples to 5, which sould have given med a 5ms wait, but it waits forever. I want to use software timing and triggering og with the onboardclock on my USB-6225.
I've tried looking at the examples regarding digital out, but I can't find anything useful.
Anyone with som tips for my timing problem?
PS! I measure with an oscilloscope before the relay, in other words; right on the digial port on my device.
03-25-2011 04:05 AM
I managed to get the pulse, using CLK out on my USB-6225. So problem is kinda solved. But anyways, it would be nice if you maybe had some tips regarding timing.
03-31-2011 10:07 AM
One way to solve this with the 6225 will be to create a pulse train that you connect to the relay. Just specify the the frequency and dutycycle.
See the "Gen Dig Pulse Train-Continious.vi" in LabVIEW examples.