LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

One shot boolean set in loop

Hello. I have spent many hours on this problem and still no result, so I am asking here.

The thing is, that I have a while loop, which gives me a different number on each iteration (measuring temperature). And I am trying to do something like this:

 

boolean=1 %inicitialize boolean set

 

while 1=1 %some while loop

 

if temp > 200 then

boolean=1

else

 

if temp < 20 then

boolean=0

else

 

end

 

So in conclusion it should change the boolean value, if the temperature step over 200 respectively 20 in other cases let the boolean be as it was.

I am good at programming, but totaly screwed with this GUI-based stuff 🙂 Thanks in advance.

0 Kudos
Message 1 of 4
(2,855 Views)

What have you tried?

 

The simplest solution would be to use a While loop with a shift register.  Keep the boolean value in the shift register.  Inside you loop, you read the temp value and use a case structure (wire the temp value to the case selector).  Use cases "..20" (values less than 20), "200.." (values greater than 200), and "Default".  In the less than 20 and greater than 200, set your boolean to the desired value.  In the Default case, wire the boolean value straight through.


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

Are you totally new to LabVIEW and graphical programming?

Since you, as you said, are a good programmer, you will have no problems to learn LabVIEW. Once you have discovered and learned how to use the properly functions for each action, you will be able to improve your productivity.

Getting Started with LabVIEW

 

About your question, I really don't understand what you want to do.

But pay attention at the Case Structures (you can make them work as a If/Else function), at the Comparison Palette and at the Boolean Palette.

I've attached some snapshots to you check where you can find these stuff mentioned above.

 

Mondoni
Download All
0 Kudos
Message 3 of 4
(2,833 Views)

Thanks to both of you. I thought case structure operates only with true/false statement (and in this case I could not figure it out). I have not read the whole documentation, my apology. I think it should work now. Thank you again.

0 Kudos
Message 4 of 4
(2,801 Views)