04-29-2010 03:49 PM
This may seem like a silly question, but one that's been on my mind for awhile. On the block diagram, where is the ideal location to place front panel controls? For an event structure, I notice that if I don't place the boolean controls directly outside the event window, then the mechanical 'latch when released' action does not work corrrectly. But what do you do when you have lots of controls that take up too much space (outside of creating a cluster)?
I personally like to line up controls on the LHS and indicators on the RHS.
04-29-2010 04:02 PM
04-29-2010 04:10 PM
I agree with Jeff. The best to place the control is inside its event case. Then you don't have all those controls taking all that space as in your picture. Wherever you put it, the important thing is for the boolean to be read when the value has changed so that the latch action can be completed, so that the True will go back to False.
04-30-2010 12:52 PM
These are all good answers. It is considered appropriate LabVIEW style to place controls in the event case that catches them. If you are concerned about BD real estate, you can use Captions for your front panel, and labels on your block diagram. Also, may I ask why you have opted against using a cluster, or perhaps and array?
04-30-2010 01:54 PM
Jeff and tbob already explained what is correct style, but I want to explain the why.
The latch mechanism is doing the resetting of the button when you read the terminal (even if no wire is connected). So your code is performing the following sequece when you click 'Write power supply 2':
1. Execute the Write hardware state, supposing that this goes back to Idle
2. Read the terminals, thus resetting the button and entering the event structure
You should be able to notice this behaviour when you use the highlight execution mode or use a breakpoint in the 'Write hardware' state and check the FP when you hit the BP..
If you place the Control inside the event frame for the value change event of this control, you get the resetting before the execution of the next state
I think if you understand this mechanism, You can figure out where to place the controls for more complicated architectures than a simple SM.
Felix
05-03-2010 05:38 PM
Hi Wes P,
I generally use clusters in my programs. I just wanted to know what the proper coding etiquette was