LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

change XControl direction: changing direction of child VIs

Hi,

 

I'm writing an XControl containing several booleans, with a numert output based on which button is True, but I cannot change the direction of the Buttons when the direction of the XControl is changed in the VI using it:

 

In the owning VI, in Edit mode, I change the direction of the XControl via the drop-down menu.

In the XControl, the Direction Change event is triggerd, with {Indicator=True/False; RunMode=False}

I then set the Indicator property of the VIs in the XControl, but recieve an error (see below)

 

I also noticed this bug: wiring the error to an Error indicator on the XControl Facade yields:

Code: 1073
Source: Property Node (arg 1) in ControlSystem.lvlib:Filtermodes.xctl:FilterModes Facade.vi:31->ControlSystem.lvlib:Filtermodes.xctl:FilterModes Facade.vi.ProxyCaller
<APPEND>
Property Name: <b>Indicator</b>

Whereas a probe shows:

 

Error 1073 occurred at Property Node (arg 1) in ControlSystem.lvlib:Filtermodes.xctl:FilterModes Facade.vi:31->ControlSystem.lvlib:Filtermodes.xctl:FilterModes Facade.vi.ProxyCaller
Possible reason(s):
LabVIEW: This property is writable only when the VI is in edit mode, or this method is available only when the VI is in edit mode.
Property Name: Indicator

 

Also, one cannot call 'Explain error/warning' on Error indicators in XControls form the using VIs

 

How can I change the direction of the buttons in my XControl to match the direction of the XControl?

 

TIA,

Jonathan

 

0 Kudos
Message 1 of 7
(3,188 Views)

You don't change the direction, you have controls for both directions and hide the ones which aren't being used.

 

You can't change an indicator to control  at run-time.

 

Shane.

0 Kudos
Message 2 of 7
(3,176 Views)

@Shane:

I understand that I cannot change at runtime, but this is in Edit Mode of the owning VI (confirmed by RunMode=False in ContainerState).

Or does this not matter, is the XControl always in Run Mode??

 

Since I can change the direction of myself (http://forums.ni.com/ni/board/message?board.id=170&message.id=429786&query.id=1338874#M429786) I think I should be able to change the direction of children VIs, no?

 

Seems annoying to have to duplicate every single control even for Edit-mode changes.

 

Am I missing something?

 

Thanks,

Jonathan

0 Kudos
Message 3 of 7
(3,157 Views)

You want to set the direction of other XControls contained within your XControl? Is this right?

 

This is an interesting approach.  Until now, I have always worked with duplicates of any type of control within my XControls as I have mentioned earlier.  Maybe you could make a suggestion on the "Idea Exchange" for this.  It is an interesting approach for XControls at least.

 

Regards

 

Shane.

0 Kudos
Message 4 of 7
(3,143 Views)

Of course something I forgot is:

 

An XControl dropped on a front panel (whether the FP is in an XControl or not) is ALWAYS in run-mode.  It is essentially a parallel process to the VI in which it is contained.

 

I think this is the problem when you are trying to set the direction in your code.

 

Shane.

0 Kudos
Message 5 of 7
(3,142 Views)

An XControl dropped on a front panel (whether the FP is in an XControl or not) is ALWAYS in run-mode.  It is essentially a parallel process to the VI in which it is contained.


 

So even if the VI is not running, all the XControls on it's FP are running?

 

 


I think this is the problem when you are trying to set the direction in your code.

 

 This 'code' is the direction change handler in the XControl Facade, if the above is true, then I'm out of luck I guess

 

 


You want to set the direction of other XControls contained within your XControl? Is this right?


Not exactly, I want to set the direction of normal control (Customized, but not an XControl), contained in the FP of my XControl, although it seems like that won't change much

 

 

Based on the comments LabView adds to XControls, it seems that the Facade is not running in between processing events, so maybe one could change the direction of the controls after the event handling is done (Some kind of callback)?

 

My current work-around is to disable my controls in indicator mode, since disabled Modern OKButton controls look identical to their indicator

 

Thanks,

Jonathan

0 Kudos
Message 6 of 7
(3,129 Views)

JonathanWinterflood wrote:

 

So even if the VI is not running, all the XControls on it's FP are running?


 

Correct.

Shane

0 Kudos
Message 7 of 7
(3,121 Views)