LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

enter and exit a case structure

I'm currently building a control.  I have a condition for three booleans to become true to enter a case structure as true.  One of the conditions is a temporary increase in temperature. I want to stay in the case structure after the temperature becomes false but both of the other booleans stay true. Is there a way to do this or should I be using some other technique?

Thanks,

Colt

0 Kudos
Message 1 of 4
(3,407 Views)

Attach your code so we can match up your description with something we can look at so we can understand.

 

You say "enter and exit" a case structure, but the concept of staying within implies that you have some sort of loop.  How you have the loop vs. the case structure set up matters a lot.

 

You should investigate "state machine" by searching the forums.

0 Kudos
Message 2 of 4
(3,400 Views)

Do you currently have a State Machine set up?  If so, you just need to check two of your booleans to say if you should remain in that state.


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
(3,397 Views)

I think this guy is running into the same misconception I and many of my classmates ran into about LabVIEW back in the day.  When your code enters the True Case, it will complete the True Case and immediately exit the True Case to complete whatever other tasks that may be outside of the Case Structure (assuming it didn't already do them). Then, the while loop (you must have a while loop) will move on to the next iteration, meaning it will do it all over again.

 

Now, if you know already know and understand how code works in general (about iterations) then do forgive me.  I've edited a lot of student code and have seen this very mistake.  A misunderstanding of the fact that code reiterates and will do it all over again if not told to do something else.  Typically the mistake is made with Event Structures.  I know it doesn't make much sense to not understand that...but trust me, it makes sense to those who don't understand.  ha

0 Kudos
Message 4 of 4
(3,333 Views)