11-10-2017 04:34 PM
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.
11-10-2017 05:02 PM
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.
11-10-2017 05:07 PM
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"?
11-10-2017 05:20 PM
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
11-13-2017 12:35 PM
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.
11-13-2017 12:52 PM
@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.