LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

boolean control issues, not enough capability

My problem is that I'm asking a boolean/case structure combo to do too much/the wrong things. When the button is clicked on, the process starts and other front panels are disabled for the duration of the process. When the button is clicked again, to false, their should be a user prompt message. If the user wants  to stop the process, it stops, and the previously disabled buttons will be enabled. Using a case structure tied to the boolean control obviously doesn't work, because the default is false, and that brings the prompt message up once the vi is run.

 

I'm thinking an event structure is what will solve this. However, I don't know a lot about them, or how they apply here.

0 Kudos
Message 1 of 5
(2,794 Views)
you could use an event case instead of a case structure and use the Value Change event
Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
0 Kudos
Message 2 of 5
(2,785 Views)

Also, you may have to wrap the event structure in a while loop to keep it running (waiting for an event), Wrap an event structure around your case structure.  When the vi is run, nothing happens until the button is pressed (value change).  The case structure then figures out what the new state of the button is (make sure the button is inside the event structure but outside the case structure)...and causes the case to run once.  The button will stay down, until you choose to press it again, and when you do that, the event will fire again, the status of the button will select the appropriate case...and things will be back to normal.

 

Hope that is clear as mud...

 

I also went to the vi property window (right click on the vi icon in the upper right hand corner) and set the execution option for clear controls/indicators on start.

I then went to the text box and cleared it out, right clicked on it and went to Data Operations and Make this the dafault value.

 

Ben and the guys are trying to teach me how to use what they call a producer consumer architecture...basically, it would form a Queue with two loops.  One loop would contain the event structure, the second loop would contain all the case structures.  When you hit the button in that case, the event would fire, in that event you would put the case choice on into the Queue, and then the event would end, the queue would dump the case choice out at the front of the case structure and run it.  Don't know if that would help you here though...

 

Hope this helps.

 

See the example.

 

H

0 Kudos
Message 3 of 5
(2,763 Views)
You may want to take a look at this basic example of a program architecture I posted for another user. This example covers several of the things you are asking about. The example is a simple producer consumer architecture with an addition simple error task.


Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 4 of 5
(2,748 Views)

I am struggeling with some of the same problems.  I have been building an example to help me understand this producer consumer stuff.  It does not include a type definition for the enum yet, but it does run.  One of the advantages of this is that if the STOP button is pressed, that event places the request for the system to go to the STOP state on the top of the state Q...and everything stops immediately.

 

Hope this helps.

 

Hummer1

0 Kudos
Message 5 of 5
(2,682 Views)