From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help with timing controls

Hi,

I'm new to this forum, so hopefully this is in the right place.

 

I am using an Ni 6009 with labview 2012 to turn on/off 4 valves. I am to the point where I can manually turn the valves on/off in the front panel, but what I need to do is have a timed cycle. 

 

What I need to have is for example:

1) Valve 1 open, Valve 2 open, Valve 3 closed Valve 4 open.

2) Wait x amount of seconds.

3) Valve 1 open, Valve 2 closed, Valve 3 closed Valve 4 open.

etc.

 

How can I make this happen?

I'm fairly new to this program, so any help would be greatly appreciated.

This is what my block diagram looks like, it is attatched.

 

 

0 Kudos
Message 1 of 13
(2,711 Views)
I would suggest you use an array of clusters. The cluster would have a Boolean array and a numeric for the delay value. You only need a single DAQmx Write that you pass a 1D array to - representing all channels for a single state. Do not configure, start, close with each iteration of a for loop. Wire the Time value to a Delay function. An array is passed into s for loop and the auto-index feature will give you one row each iteration.
Message 2 of 13
(2,693 Views)

Great, I will try that and post my results.

Thanks!

0 Kudos
Message 3 of 13
(2,677 Views)

Am I to have 4 booleans within each cluster? Then have x amount of clusters in the array?

0 Kudos
Message 4 of 13
(2,637 Views)

I think I almost have this complete but I am getting an error message that I am unfamiliar with, can someone direct me on how I can fix this error, I have a picture of what I have and the message I am receiving. I'm having trouble connecting the physical channels.

0 Kudos
Message 5 of 13
(2,609 Views)

Try creating the task in MAX, where you can specify the 4 lines (Dev1/port0/line0:3).  Then in your DAQmx Create Virtual Channel.vi (in LabVIEW), wire the task you created into the "task in" input as a constant. (It will auto-populate in the pull-down menu.)

0 Kudos
Message 6 of 13
(2,574 Views)

Example_VI.png

Message 7 of 13
(2,561 Views)

How did you unbundle the array??? Im getting that it is of two different types, one is an array and the other is a cluster.

0 Kudos
Message 8 of 13
(2,538 Views)
The only difference is that you used the unbundle function and the example uses unbundle by name. Does not make a bit of difference.
0 Kudos
Message 9 of 13
(2,530 Views)

I got this working, but is there a way for the array to reiterate? I want this sequence (picture is attatched) to occur over and over until the process needs to stop. I may need to have to run this for hours.

0 Kudos
Message 10 of 13
(2,486 Views)