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: 

Newbie Question: Control DO on Exit

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

 

0 Kudos
Message 1 of 11
(2,793 Views)

You could just simply write falses to the digital lines at the very beginning of your program and again in your shutdown code.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 11
(2,788 Views)

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. 

 

http://www.ni.com/white-paper/3024/en

Message 3 of 11
(2,783 Views)

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

0 Kudos
Message 4 of 11
(2,778 Views)

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

0 Kudos
Message 5 of 11
(2,770 Views)

Might I recommend taking some tutorials:

LabVIEW Basics

LabVIEW 101

 

And be sure to read up on the state machine:http://www.ni.com/white-paper/3024/en


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 6 of 11
(2,761 Views)

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.

0 Kudos
Message 7 of 11
(2,759 Views)

Just because you have a great set of initials...

 

Here would be one way to do DO with set-up and exit

Example_VI.png

The Sub.vi is simply this

DO_BD.png


"Should be" isn't "Is" -Jay
Message 8 of 11
(2,740 Views)

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.

 

 

0 Kudos
Message 9 of 11
(2,736 Views)
Under Help menu you can find examples of both state machines and daqmx, you just need to combine those two. 🙂
G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 10 of 11
(2,728 Views)