LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Continuous Periodic Analog Output with USB-6009

Solved!
Go to solution

Hi Guys:

 

This is my first time using LabVIEW so it might sound silly for my questions.

 

I want to build a VI using USB 6009 to drive 2 pumps with analog outputs (the digital output doesnt work).  These two outputs should reach 5V to drive the pump to start.

First, i'd like both of them to open. After a certain amount of time (this time variable t0 should be controlled by user), pump 1 will stop but pump 2 will keep working. After pump 1 stops for a certain time (t1_stop), pump 1 will start and pump 2 will stop. Then, after pump 2 stops for a certain time (t2_stop), both pumps will work simultaneously for another amount of time (t_open).

Then the system will repeat with pump 1 off, pump 2 on  --> pump 1 on, pump 2 off --> pump 1 on, pump 2 on --> ......

 

Is it possible to drive 2 pump with 2 analog outputs ( with a rectangle wave, 0-5V) and have control with time variables (t0, t1_stop, t2_stop, t_open)?

 

What I've found so far is that USB 6009 doesn't seem like it has a timing clock in it, so it may not fit my task. Since i'm a beginner in labVIEW so I'm looking for some more advice and the possibility of using 6009 for this task.

0 Kudos
Message 1 of 6
(2,175 Views)
Solution
Accepted by topic author Darren052

Hi Darren,

 

What I've found so far is that USB 6009 doesn't seem like it has a timing clock in it, so it may not fit my task. Since i'm a beginner in labVIEW so I'm looking for some more advice and the possibility of using 6009 for this task.

You're right, the cheap USB6009 doesn't support any timing on its AO and DO channels…

What kind of timing do you need?

 

2 analog outputs ( with a rectangle wave, 0-5V)

What exactly do you need? a "rectangle, 0-5V" sounds like a simple DO with 5V-TTL levels to me…

 

with analog outputs (the digital output doesnt work).

Why not? They also output 5V levels…

 

After a certain amount of time…

All those "steps" sound like several states in a state machine to me…

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(2,159 Views)

You're right, all I need may just a simple DO with 5V-TTL levels , and I'm thinking of using a 555 timer circuit. 

The reason I started with the DAQ 6009 was the system is already been using for other purpose and would be great if I could modify the VI and use it for other applications.

 

Thank you for your information, GerdW!

0 Kudos
Message 3 of 6
(2,124 Views)

You can use a 6009 if you're OK with loose timing. If you need exact timing, you'll need something with an onboard clock, but for some simple toggling you can just write 5V to the AO, then wait (on time), then write 0 V, then wait (off time), and loop.

0 Kudos
Message 4 of 6
(2,118 Views)

Hi Bert

Can you show me how to write wait time in labview?

Can I have different wait time for different pumps but start them at the same time? (for example, start both at t=0s, then off pump 1 at t=3s, and off pump 2 at t=4s)

How loose is the time? (I may need the temporal resolution at 0.1s, means that I can accept the time error within +/- 0.05s)

0 Kudos
Message 5 of 6
(2,113 Views)

50 ms is probably doable but it 100% depends on your computer. You'd have to benchmark it but it's probably OK.

 

Wait is just called Wait (ms). Press Ctrl-Space and type in Wait. And yes, your device supports multichannel output, so you can write channels 1 and 2 to 5V in the same action (Write N Channels in the DAQmx Write function), then wait 3 seconds and write 0 V to just channel 1 (Write Single Channel), then wait another 1 second and write 0 V to just channel 2.

 

You can also use Wait Until Next ms Multiple if the above code is a little drifty. There are some good examples in the Example Finder (Help -> Find Examples) that show how to do some of this stuff.

0 Kudos
Message 6 of 6
(2,111 Views)