LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to make parts of a XControl invisible or disabled while the owning VI runs

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

Using LabVIEW 8.5 on WinXP
0 Kudos
Message 1 of 5
(3,213 Views)

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

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 2 of 5
(3,206 Views)

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


 

 

Using LabVIEW 8.5 on WinXP
0 Kudos
Message 3 of 5
(3,198 Views)

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

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 4 of 5
(3,193 Views)

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

Using LabVIEW 8.5 on WinXP
0 Kudos
Message 5 of 5
(3,176 Views)