LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

boolean timed switching

Solved!
Go to solution

Hi, 

I am using DAQ assistant to turn on digital outputs of the DAQ USB 6008 device. I want to be able to turn them on for about 1 second, with 1 second in between, for each output. So I want switch 1 to turn on, then turn off. then switch 2 to turn on, then off...ect..

The inputs I have for the switch are True/False values going into an array that control each switch. But I do not know how to get these True/False values to turn on/off when I want. Anyone have any info on this?


0 Kudos
Message 1 of 7
(4,802 Views)

The brute force way would be to put the DAQ Assistant inside a for loop with a 1 second Wait. Autoindex through the values of the boolean array.

 

The disadvantages of that approach are: No flexibility to make changes in timing. The DAQ Assistant configures and closes the DAQ task on each call. You cannot easily stop the program before it has gone through the entire array.

 

Better approach: Use  a state machine architecture. States could include Configure Switch Array, Configure Digital Output Task, Configure Timing Array, Idle, Write, Wait, Shutdown, and perhaps others for required features you have not mentioned.  The timing array would allow each switch to have a different time as opposed to the brute force method where all timing is fixed.

 

Lynn

0 Kudos
Message 2 of 7
(4,770 Views)
Solution
Accepted by topic author joedirt

Hi,

 

Check out the VI I attached. It uses the left shift with carry VI and the Elapsed Time VI.

 

Sequencer.png

0 Kudos
Message 3 of 7
(4,769 Views)

That worked well thank you very much!!

0 Kudos
Message 4 of 7
(4,730 Views)

how do you stop the vi?   Smiley Indifferent

0 Kudos
Message 5 of 7
(4,724 Views)

You could just right click on the FALSE constant and choose "change to control"... but this was just to give the poster an idea of how to do what he wanted to do. I wasn't aiming to make a fully commented LabVIEW example ready for release.

Message 6 of 7
(4,721 Views)

@BFeigum wrote:

You could just right click on the FALSE constant and choose "change to control"... but this was just to give the poster an idea of how to do what he wanted to do. I wasn't aiming to make a fully commented LabVIEW example ready for release.


It would've been just as easy - and a lot less muddy - if you created a stop button instead of a false constant.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 7 of 7
(4,702 Views)