02-11-2010 12:14 PM
Hi all,
I am struggling with a XControl. The owning VI of the XControl is in run mode, so I can't use the exec state change event of the facade VI. I use the execution state property of the owning VI to detected the state. Now I need an event that fires whether the owning VI starts or stops.
To detected the start seems to be easy using a data change, direction change or user event (maybe with dynamic registration?). To detected the stop is even more complicated, I should capture the panel close? and the application instance close? event. But how can I capture the abort button of the toolbar and how to deal with the keyboard short cut?
I would like to have all the code inside the facade VI, but it seems that isn't possible since I must capture the start and stop of the owning VI. I really miss mandatory event for that.
Maybe someone has a work around or solve this problem differently.
All ideas and suggestions are welcome.
Thank you in anticipation
K-Bot
02-11-2010 12:34 PM
K-Bot wrote:Hi all,
I am struggling with a XControl. The owning VI of the XControl is in run mode, so I can't use the exec state change event of the facade VI. I use the execution state property of the owning VI to detected the state. Now I need an event that fires whether the owning VI starts or stops.
To detected the start seems to be easy using a data change, direction change or user event (maybe with dynamic registration?). To detected the stop is even more complicated, I should capture the panel close? and the application instance close? event. But how can I capture the abort button of the toolbar and how to deal with the keyboard short cut?
I would like to have all the code inside the facade VI, but it seems that isn't possible since I must capture the start and stop of the owning VI. I really miss mandatory event for that.
K-Bot
Hi K-Bot,
your very is a little bit unclear to me.
What do you mean by run-mode, is the VI in run-mode but not actually running (like ctrl-m)?
I have played a little bit with this scenario, but I don't think it's possible to make a distinction between a VI in Run-mode and an actual running VI.
What is the reason that the VI is in run-mode? And does it really matter whether the VI is in run-mode or actaully running?
Ton
02-11-2010 01:10 PM
Hi Ton,
thank you for your reply. Yes I put the owning VI in run mode using ctrl-m. Now if I start this VI I want to make parts of the XControl invisible or disable them. You can make distinction between run mode and running of that VI by using execution state property node. The reason why the VI is in run mode is that the users can't edit the controls on the frontpanel or change some settings. I know that the exec state change event of the facade VI didn't fire when the owning VI switches from run mode to running, that's the source of my problem.
Hope this make my query clear.
K-Bot
02-11-2010 01:27 PM
Yes, that makes it clear.
I have never dealt with that (only hand executables over to my users). However would a 'locked' VI be better suitable?
Ton
02-12-2010 08:21 AM
I tried locking and password protection of the owning VI, both cases come up with the same behavior as putting the VI in run mode (ctrl-m). It seems that the only reason of the state change event of the facade VI is to make a distinction between edit mode and run mode. But the annotation in the facade VI says:
"LabVIEW calls the Facade VI with Exec State Change event whenever the VI containing the XControl is switching from idle mode to running and vice-versa."
This is definitely not the same. I don't know what's happening if you put such a XControl in a executable. Should the exec state change event fire when the executable starts?
K-Bot