LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

continuous number generation

Solved!
Go to solution

Hello everyone 

I am new in Labview software.

 

I write a program, Please see attached picture.

I would like to have a program that if the generated numbers be more than 101 the cooling system will turn on with an alarm sign and source of numbers stop for 15 second and after that the program start to work again from first sequence. 

 

Would you please help me to know where is my problem?  (  I attached my program too)

01.PNG

 

Thank you for your help.

 

0 Kudos
Message 1 of 4
(1,255 Views)

It sounds from your description like you want all of your code to repeat. Now it's just the number generator that repeats until you press the stop button after which you evaluate and signal alarm.

The loop needs to encompass all and your >101 evaluation needs to connect to a case.

(There is more to comment, but just to help you get some understanding of LV and the dataflow Think)

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 4
(1,245 Views)
Solution
Accepted by topic author Sml2010

Your immediate problem is your While loop will only stop with a stop button.  I think you want it to stop when the value is greater than 101.

 

But even more so, I think you should look into building a proper State Machine.  Each of these steps you mention is a state.  Do not put more loops into a state.  You can repeat states until a condition is met.


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 3 of 4
(1,244 Views)
Solution
Accepted by topic author Sml2010

I agree that a state machine is the correct thing for this (and most other simple programs!).

 

  • You need an outer loop and a case structure with a case for each state of the program (generating numbers, cooling, alarming, etc.).
  • The loop needs to run at a reasonable rate so it can react if a control changes. You currently have up to 20 seconds where the VI does not react to user inputs
  • None of your local variables are needed.
  • Your "start" button only gets read once when the program starts and then never again. I think it also has the wrong mechanical action. (I hope you are not using the "continuous run" mode. That's just a debugging tool.
  • You only need to write the color property if it differs from the current color, not with every iteration of the loop.
  • Do not mix datatypes. Either use integers (all blue) or floating point numbers (all orange). Temperatures are typically not quantized to whole numbers.
0 Kudos
Message 4 of 4
(1,200 Views)