05-23-2013 12:40 PM
Hello,
I am brand new to LabVIEW and need to get a small project done quickly. I have only really used Express VI's...
I do, however, have a DAQ and control system up and running (I'm sure it could be done much more efficiently, and I plan to refine as I learn)...
What I really need to know are two things:
1) How to ensure a pair of digital outputs are off on start-up (I have them default to off on power-up in DAQmx) but I mean on start-up of my VI.
2) How to ensure they're off on exit of the VI (no matter what the state of the toggle in the on screen, if they stop it, I need the outputs to go off).
Please can anyone give me some help, or an example?
-Jeff
05-23-2013 12:47 PM
You could just simply write falses to the digital lines at the very beginning of your program and again in your shutdown code.
05-23-2013
12:53 PM
- last edited on
08-15-2024
03:52 PM
by
Content Cleaner
It sounds like you really need some sort of state machine architecture. This way you can have certain tasks that happen on start up, shutdown and anywhere in between.
05-23-2013 12:57 PM
Cross,
Thank you, for the reply.
That's exactly what I'd do in language I was familiar with. I literally just don't understand the graphical syntax yet. The express VI's are all I've touched--even the loop and exit criteria were auto-generated by LabVIEW.
I just need to understand (may be an example), of DO control on start-up / shutdown...
-Jeff
05-23-2013 01:07 PM
Keen,
Thank you too, a state machine might really be the thing I need. Not sure how best to implement one in LV, but the concept is very familiar.
Even if I figure out the init, run and exit states (would add-in other states too, later, e-stop, limit, etc.) still not sure how the code can set a digital output. I'm that new to LabVIEW!
-Jeff
05-23-2013
01:32 PM
- last edited on
08-15-2024
03:53 PM
by
Content Cleaner
Might I recommend taking some tutorials:
And be sure to read up on the state machine:https://www.ni.com/en/support/documentation/supplemental/16/simple-state-machine-template-documentat...
05-23-2013 01:36 PM
I get that, but thank you.
I was hoping there was a "stick this control in here, set output state, link to stop button" kind of answer, or "here's an example of that with a DAQ Assistant!"
I appreciate the links.
05-23-2013 02:40 PM
Just because you have a great set of initials...
Here would be one way to do DO with set-up and exit
The Sub.vi is simply this
05-23-2013 02:47 PM
Jeff B,
They are strong initials, aren't they!?
Ok, I think I understand some of what's going on in there. I will study it and try to make some sense. Would you happen to have the actual .VI of that I can play with?
Thank you, Jeff, much appreciated!
-Jeff B.
05-23-2013 03:06 PM