LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Control placement event structure

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.

Download All
Message 1 of 6
(4,099 Views)
One common practice is to place controls inside the event that handles them (especially the latching bools and tab controls).  Works pretty well for me but I use short labels for naming and show the caption for controls that the user needs a readable name Smiley Wink to save BD space

"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 6
(4,095 Views)

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.

 

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 3 of 6
(4,089 Views)

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?

Wes Pierce
Principal Engineer
Pierce Controls
0 Kudos
Message 4 of 6
(4,039 Views)

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

Message 5 of 6
(4,009 Views)

Hi Wes P,

 

I generally use clusters in my programs. I just wanted to know what the proper coding etiquette was Smiley Happy

0 Kudos
Message 6 of 6
(3,965 Views)