LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to work around dataflow order in front panel simulation?

I'm on the steep part of the Labview learning curve.  The attached vi is my attempt to simulate the user interface of the product I'm working on.  I'm posting because every workaround I dream up to deal with Labview's dataflow architecture results in more complexity.  I think I'm putting bandaids on top of bandaids!
 
If you run the vi you should see what I'm trying to accomplish.  The 5 Mode Select buttons send the machine into one of 5 available modes, implemented with a case structure.  Delay blocks within the cases simulate how the machine will react.  Random number generators simulate occurrence of fault conditions.  RS flip flops simulate momentary contact buttons.
 
Some rules:
- pushing a mode button should instantly switch the machine to the selected mode (my vi doesn't work that way).
- probe test mode should execute just once.  My vi simulates this one-time operation by latching the test result - kludge!
- if a fault occurs, it can only be cleared by "power cycling" (stopping and restarting the vi)
 
Questions:
1) is there an simpler way to simulate momentary contact buttons?
2) is there a simpler, better way to select the cases?  I'd like to automatically go from Test to Stop after a single execution of the test case.
3) what is an efficient way to initialize the mode indicators?  They 'remember' their last state through a power cycle.
 
Thanks for any and all insight!
 
Jeff
 
Jeff
Climbing the Labview learning curve!
Sanarus Medical
Pleasanton, CA
0 Kudos
Message 1 of 13
(4,588 Views)
You didn't attach your VI but it sounds like you're missing some of the basic skills in LabVIEW programming.
 
You want to look at the mechanical action of Booleans. The different latch behaviors is what you want to try. You just have to right click on the Boolean and select this.
 
Look into using the event structure (assuming you have 6.1 or greater and don't have the base version of LabVIEW). Another option is the state machine. Both of these have shipping examples that you should look at.
 
One way to restore defaults is to use the VI method called Reinitialize All to Default. Go to the Application Control pallete, and select the Invoke Node. Right click on it, Select Class>VI Server>VI. Right click again and select Methods>Reinitialize All to Default.
 
0 Kudos
Message 2 of 13
(4,574 Views)

Thanks for the feedback!  Yes, I am a noob.  I thought I did the attachment steps correctly, but I'll try again.  I'll look into the event and state machine structures.

I understand the different Boolean control modes, maybe if the attachement makes it through it will clarify what I'm trying to do.

Jeff
Climbing the Labview learning curve!
Sanarus Medical
Pleasanton, CA
0 Kudos
Message 3 of 13
(4,568 Views)
Is this a LabVIEW 8 VI? It's either that or something got corrupted with the attachment as I can't open it. If it's an 8.0 VI, can you save it as 7.1?
0 Kudos
Message 4 of 13
(4,565 Views)
The original attachment was ver 8.  This one is (I hope!) 7.1.     -Jeff
Jeff
Climbing the Labview learning curve!
Sanarus Medical
Pleasanton, CA
0 Kudos
Message 5 of 13
(4,557 Views)
This VI definitely screams of using a state machine as Dennis initially mentioned. You will probably want to use a combination of the event structure with a state machine, aka producer-consumer. LabVIEW ships with examples of these.
0 Kudos
Message 6 of 13
(4,551 Views)
Yeah, a state machine or event structure would greatly simplify the program. I'm not sure what exactly the program is supposed to do but I made a simple example with your front panel controls and indicators that might give you some ideas.

Message Edited by Dennis Knutson on 02-24-2006 02:00 PM

0 Kudos
Message 7 of 13
(4,543 Views)

Thanks, Dennis!  I'll build on your example.  One key behavior it does not support is the latching of the mode indicators.  That latching is what drove me to the (overly complex?) SR flipflop structures.

The design does scream state machine, which is how I'll implement it in the microcontroller.  I just don't know how to make that work in a vi yet.  But you guys are helping me get there!

Jeff

Jeff
Climbing the Labview learning curve!
Sanarus Medical
Pleasanton, CA
0 Kudos
Message 8 of 13
(4,527 Views)
An alternative method for the UI is to use the radio buttons control. You can customize the standard one to use the square buttons, and I believe this would give you the equivalent effect that you're doing with the lights. See attached VI along with customized control. For the customized control I took a standard radio button control, opened it for editing, and replaced the circular booleans with square buttons. The radio button control is an enumeration, with the enumeration items being the labels of the individual controls (not the text inside the buttons). The control is set so that the labels on the individual square buttons is not visible.
Download All
0 Kudos
Message 9 of 13
(4,523 Views)

You don't have to use the Control Editor to change the appearance of the buttons inside a Radio Buttons control.  You can just delete the booleans that are there and drop new ones in there, or use the Replace menu option.

Under the hood, a Radio Buttons Control is just like a cluster, only you're restricted to only dropping booleans inside it...oh yeah, and it has an enum datatype.

-D

Message 10 of 13
(4,517 Views)