LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Log changes in controls.

Solved!
Go to solution

Hello friends!
How do I make the attached vi recognize changes in the state of the controls if the controls are inserted in the tab. When the controls are outside, everything works fine, but if I insert the control into the tab, changes to it are not detected.
Thanks for the help!

0 Kudos
Message 1 of 7
(449 Views)
Solution
Accepted by topic author MarceloPinto71

Hi Marcelo,

 


@MarceloPinto71 wrote:

How do I make the attached vi recognize changes in the state of the controls if the controls are inserted in the tab.


You need to get the references to those controls, too.

To do so:

  1. The VI already gets the references of all controls on the VI "Panel".
  2. Now you need to determine if there is a reference to a tab control to determine all controls inside the tab (pages).
  3. Build an array from all references from step 1 and all references found in step 2 to register the event as shown in the example VI.
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 7
(434 Views)
I'm sorry for asking more, but could you give me an example with the boolean and boolean2 controls inside the tab? I think it will be easier for me to understand. I'm a bit confused.
0 Kudos
Message 3 of 7
(422 Views)

@GerdW 

I'm sorry for asking more, but could you give me an example with the boolean and boolean2 controls inside the tab? I think it will be easier for me to understand. I'm a bit confused.

0 Kudos
Message 4 of 7
(394 Views)
Solution
Accepted by topic author MarceloPinto71

Hi Marcelo,

 

like this:

  1. Get all control references for VI panel
  2. for each reference: check if it is a tab container (using ToMoreSpecificClass)
  3. for each tab container: get all pages and get all controls per page
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 7
(387 Views)

@GerdW , It is working! Thank you very much!

0 Kudos
Message 6 of 7
(374 Views)

I see that you have a solution for your current requirements. However if you use splitters or have a Tab control on a Tab control this will fail.

A more flexible option is to use: Traverse for GObjects.vi. This vi will recursively find objects nested within container objects.

It's under the VI Scripting umbrella but is available in the Run Time Engine so you can use it in executables.

 

This vi can be found here (substitute your LabVIEW version):

C:\Program Files (x86)\National Instruments\LabVIEW 2021\vi.lib\Utility\traverseref.llb\Traverse for GObjects.vi

 

To enable searching for it with Quick Drop - turn on Scripting:

LabVIEW Menu: Tools >> Options >> VI Server >> VI Scripting > Show VI Scripting functions ...

 

You may ask "Why have a Tab on a Tab?". I like to use invisible Tabs for different system configurations.

 

Traverse BD.png

Traverse FP.png

See attachment (LabVIEW 2021)

----------------------------------------------------------------------------------------------------------------
Founding (and only) member of AUITA - the Anti UI Thread Association.
----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 7 of 7
(284 Views)