LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Cluster as Control and Indicator

I have a cluster of indicators that I use in several places in my program.  I would like each cluster to have a "Reset" button to clear the data for the channel that the cluster represents.

 

Obviously, a cluster cannot have both controls and indicators.  Also, an "OK Button" cannot be clicked if it is an indicator.

 

What is the best way to do what I'm trying to do?

0 Kudos
Message 1 of 12
(7,770 Views)

Do you have an array of clusters where each element of the array represents a channel?  or are all channels located within the same (one) cluster?

 

R

0 Kudos
Message 2 of 12
(7,764 Views)

I'm not an expert but i would look at using local variables...

 

Though people advise caution when using local variables as they can increase the operation time/memory usage if  used heavily, and can result in race conditions if incorrectly sequenced.

0 Kudos
Message 3 of 12
(7,761 Views)

I had planned to put 16 of these clusters in a larger cluster on the front panel, and iterate through each one every second.

 

Plan A:

I could make the entire cluster a control (to activate the OK Button) and disable (but not grey out) all other "indicators" (to prevent user modification).  Since the cluster is a control, I'd modify the "indicators" using their "value" property.

 

However, I feel like going through all this trouble and using a "control" as an "indicator" is poor coding.

 

Plan B:

I could just place a button "on-top" of each instance of the cluster on the front panel.

 

However, I feel like the button should be part of the cluster.

 

--------

Thoughts?

 

Message Edited by StevenATK on 09-29-2008 10:25 AM
0 Kudos
Message 4 of 12
(7,754 Views)

I would not recomend that you use the value property. It's significantly slower than using a local variable. Used correctly and avoiding race conditions, a local variable is perfectly acceptable and very common. With many types of GUI's it's very common to use locals.

0 Kudos
Message 5 of 12
(7,735 Views)

One other option is to make the cluster an indecator and then handle the mouse down event for the Reset Button.  That is when the mouse down event occurs, set the button true, then wait .5 seconds, reset all including the reset button to false.  This gives the feel of a true reset button but really your Cluster is an indicator.

 

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
Message 6 of 12
(7,731 Views)
It sounds like using local variables is the way to go.  In my case, should the actual cluster be a control (so the value of the button can be clicked) or an indicator (so the values can't be changed by the user)?
0 Kudos
Message 7 of 12
(7,726 Views)

Hi Paul,

 

I was thinking about suggesting your way. But I would feel the need of handling the mouse up event and the mouse move event, so the user might press but move the mouse away if suddenly unsure if he/she really wants to reset. That would be to much extra code.

 

Felix

0 Kudos
Message 8 of 12
(7,714 Views)
Yes This is just a simple when pressed button.  Doing more complex actions would require more code and can be done nicely with dynamic events.  If This is a control to be used many times it probebly could be done one time elecantly with an X control but this is an overkill 99% of the time.  The advantage of it is that there are no locals required for writing to.  It was just a possible solution.
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 9 of 12
(7,687 Views)

I agree that it may not be the most scalable solution, but just as a thought experiment:

 

You can set the mouse down event to change the boolean to True, and use the mouse leave and mouse up events to differentiate between backing out of the decision or actually selecting the action.

Message Edited by JeffOverton on 09-29-2008 02:07 PM
0 Kudos
Message 10 of 12
(7,670 Views)