LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Generating events on certain cluster objects

I have a cluster whose constituent objects I traditionally treat as a group of indicators since it seems every object in the cluster must be one or the other, together. I am now trying to trigger an event on a Boolean button inside the cluster and not have the cluster itself pick up on the event. This is because clicking on the red X (Boolean button) and the cluster itself will both be doing something, i.e., bringing up a menu or performing some specific action. I'd like to attempt to keep the overall cluster one event because I don't want the user to have to rely on clicking other various objects inside the overall cluster to trigger the cluster event. 

 

I have changed the red X to a control and changed the mechanical action to 'switch when pressed.' This allows the user event to register the individual Boolean button before the Cluster event, in which I'd hoped to somehow then discard the Cluster event since I detected the red X was pressed. Even in doing that, everything becomes a control and thus the Valve image now shows its ring components as though you are trying to modify them. That is not what I want showing up.

 

This seems like it could be a common issue people face, so I'm sure there's some kind of solution, but I haven't been able to find a particular thread that addresses this.

 

Any suggestions would be appreciated, thanks. Project built in LV 2015.

0 Kudos
Message 1 of 8
(3,131 Views)

Change Cluster to an indicator:

 

Do a mouse down? event for the Halt boolean. You can then decide to keep or discard the event. For event if you keep the event you can change the value of the boolean. I don't think you need any other event cases. Maybe I am not clear on what you are trying to do.

 

mcduff

Message 2 of 8
(3,112 Views)

I would recommend moving the Halt button out of the cluster which allows you to keep the valve UI element as an indicator and have the boolean button as a control.

 

You can still position the button over the cluster by selecting it and then using the keyboard's arrow keys to float it over the cluster.

That means you can easily separate the cluster click events from the button press events and you can event use mouse-down on the cluster.


float.png

 

 

Cheers

 

John

0 Kudos
Message 3 of 8
(3,101 Views)

Okay, I am back to Indicators and using the Mouse Down? event, which seems to work to allow the code to detect the Halt button event first, before the Cluster event.

 

Perhaps my understanding of discard and other Event features is what the real issue here is, so let me try to be more concise about what I'm trying to do:

- Halt button runs a popup, let's call it subVI A

- Anywhere else in the cluster runs a popup, let's call it subVI B.

 

When the user directly selects the Halt button, it triggers events for both the Halt and the Cluster, so both subVIs A and B would eventually pop up. I want a direct touch of the Halt button to only pop up subVI A, discarding subVI B originally used for touches on the general Cluster. 

 

Thanks

0 Kudos
Message 4 of 8
(3,087 Views)

@dest2ko wrote:

Okay, I am back to Indicators and using the Mouse Down? event, which seems to work to allow the code to detect the Halt button event first, before the Cluster event.

 

Perhaps my understanding of discard and other Event features is what the real issue here is, so let me try to be more concise about what I'm trying to do:

- Halt button runs a popup, let's call it subVI A

- Anywhere else in the cluster runs a popup, let's call it subVI B.

 

When the user directly selects the Halt button, it triggers events for both the Halt and the Cluster, so both subVIs A and B would eventually pop up. I want a direct touch of the Halt button to only pop up subVI A, discarding subVI B originally used for touches on the general Cluster. 

 

Thanks


  1. If you want to keep every a cluster, then do a single mouse down event on the cluster. You can look at the coordinates of the mouse down event and see if its on the halt button button or not.
  2. Use VIPM to get the LAVAG UI tools as shown in the image below.

mcduff

 

Snap7.png

0 Kudos
Message 5 of 8
(3,079 Views)

Or even easier, keep both mouse down events for halt and cluster, discard the mouse down event(set boolean to true) when the halt button is triggered. This way you won't trigger another mouse down event for the cluster.

 

mcduff

0 Kudos
Message 6 of 8
(3,074 Views)

Well, now when I have both events as Mouse Down? the Cluster event occurs first. I've also tried reading the status of the Boolean button to discard the Cluster event and it still executes all the code in the event window.

 

I may just have to individually event out every cluster.object or something to make it appear more "seamless"

 

0 Kudos
Message 7 of 8
(3,039 Views)

Sorry, try the LAVAG solution using the mouse coordinates, the bounding rectangle. See Attached, you  may not have all the VIs.

 

mcduff

Download All
0 Kudos
Message 8 of 8
(3,030 Views)