LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to close a branch after a single use?

Hi all,

 

I am new to LabVIEW. I have attached my code. I want to have each comparison (5 and 7) only run once. Even if the random number generator outputs another 5, I do not want the LED to light up again.

 

Thank you in advance.

0 Kudos
Message 1 of 6
(2,655 Views)

1. Add a stop button to your front panel and use it to stop your loop.  The Abort button should only be used for debugging purposes when things go completely wrong, not as normal operation of your VI.

2. Use a Shift Register to keep track of if your LEDs have been lit.  You can use some simple Boolean logic (NOT, AND, OR) to light up your LED and update your status.


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 6
(2,635 Views)

Thank you crossruiz,

 

The loop needs to be continuously running because inside the loop there will be a function measuring a pressure transducer that cannot stop. Is there anything like a switch that I can turn off before the "equal comparator"?

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

Like a Case Structure?

 

Sounds like you really should really go through the online tutorials.

3 Hour Introduction
6 Hour Introduction
LabVEW Basics
Self Paced training for students
Self Paced training beginner to advanced, SSP Required
LabVIEW Wiki on Training
Learning NI
Getting Started with NI Products


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 4 of 6
(2,624 Views)

crossruiz,

 

A case structure will not work. As I mentioned before, I want to turn the LED only once even if a five appears a second time. If I use a case structure, the next time a 5 shows up the LED will light up again. I need a way to close the branch independently from the outcome of the "equal to" comparison.  

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

@mig1214 wrote:

A case structure will not work.


Yes it will.  You just have to combine it with some additional logic like I pointed out earlier.


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 6 of 6
(2,543 Views)