LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

disabling further events until subVI closes

Solved!
Go to solution

So what happens if you use a property to make it Modal, same effect?

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 11 of 18
(811 Views)

Yes, same effect

0 Kudos
Message 12 of 18
(792 Views)

Hi KJmaster, 

 

Have you tried implementing a state machine in your code? It sounds as though this may help you accomplish what you want to do. Here are some articles on state machines and how to use them.

http://www.ni.com/white-paper/3024/en/

http://www.ni.com/white-paper/7595/en/

 

Within the state machine you can use a property node to disable the controls until after the stop button or another event has occurred. You can disable the controls, disable and gray out, as well as make them disappear completely.  Here is a community example and a forum discussion on disabling controls using a property node.

https://decibel.ni.com/content/blogs/Sixclear/2011/12/07/enhance-usability-by-disabling-and-enabling...

http://forums.ni.com/t5/LabVIEW/disabling-controls-on-front-pannel/td-p/723072

 

I hope this helps!

 

Best Regards,

Rachel M.
Applications Engineer
National Instruments
0 Kudos
Message 13 of 18
(752 Views)

Hi rkm44

 

disbaling the control, disbaling and grey and even making it invisible is no good. it still captures the mouse down event.

I don;t understand how state machine has anything to do with a solution.

Thanks

0 Kudos
Message 14 of 18
(732 Views)
Solution
Accepted by topic author KJmaster

OK, i reviewed your situation and dynamic event registration is the key for solving your issue.

Challenge is that LV behaves a little different to expectations when de- and then re-registering the event:

The event re-registration has to be done in a different event case other than the one which de-registers the event!

 

In your case, the code requires the following changes:

  1. Add a dynamic event for numeric 2 (expand the registration node and connect the reference)
  2. Change events "1: Mouse Down" and "2: Mouse Down" to a single event which handles the USER EVENT "Mouse Down".
  3. De-register both events by connecting a "Not a RefNum" constant to the event registration node in the event case.
  4. As re-registering of the event has to take place in a different event case, re-registration cannot be done
    • in the same event case
    • outside the event structure in the loop
  5. Use for instance the timeout case for re-registration of the events.

The code will look similar to this event case, without the disable structures of course (i left them for showing where NOT to place re-registration!):

 

Re-register button event.PNG

 

Norbert

 

EDIT: Improved code shown in screenshot

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 15 of 18
(725 Views)

you are the man!

indeed I see that as you said that the dereg has to be down in the "mouse down" event and the reg on "timeout"

 

thank you very very much for that solution.

it works!

Smiley Happy

0 Kudos
Message 16 of 18
(709 Views)

Just to add something "professional":

I wouldn't go for the timeout event case. This is somehow the "last resort" to solve this.

For a better sophisticated application, i would introduce a user event which is fired once the popup dialog is acknowledged/canceled. That user event would be used in the caller event structure to re-register the mouse down event.

 

This is of course is a more complex and worksome implementation, but is better in terms of "event based execution".....

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 17 of 18
(705 Views)
Hi
I am going to use "value signaling" in the mouse down event and then egister the mouse down again in the value change event.
Thanks
0 Kudos
Message 18 of 18
(702 Views)