LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

change control properties of several VIs in a LLB automatically

Hi,

let's assume I have an llb containing several VIs. All VIs contain a control named "Control1". This control has a data range restriction in all VIs (lets say min value 1, max value 5, increment 1). Now I want to change the data range for this control in all VIs (let's say to min value 1, max value 1000, increment 1). Is there any way to do this automatically? Or do I have to open each single VI, right-click on the corresponding control, select "Data Range" and make my changes? I already have a main VI containing all VIs from the library (no real code, just a collection), so maybe there is an automatic way to handle these changes?

 

I am aware of the fact that using a custom control would have been the correct solution here. Anyway, this control was never meant to be changed, so there is no custom control now but a standard control with the same behavior in all VIs... I hope somebody has a suggestion as in fact there are many hundred VIs with this control to be changed...

 

Best regards,

Gabs

0 Kudos
Message 1 of 9
(3,714 Views)

Hi Gabs,

 

here are the steps to go:

-"list" all vis in the llb

-open a reference to each vi in a loop

-get all control references of the vi

-pick the correct one

-use property nodes for this control...

 

Don't forget to save the vis after changing the control properties...

Message Edited by GerdW on 07-16-2009 04:24 PM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 9
(3,712 Views)

Hi Gerd,

thanks for your answer, but that sounds like much more time-consuming work than the simple "open and do" procedure, isn't it? 

Regards,

Gabs

0 Kudos
Message 3 of 9
(3,707 Views)

that sounds like much more time-consuming work than the simple "open and do" procedure, isn't it? 

 

Well, that depends on how many controls you're talking about.

 

All you've said is "several" . If you've got 5 or 10, sure, just do it.  If you've got a hundred, then think about automating it.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 4 of 9
(3,703 Views)

Hi Gabs,

 

when you say "there are many hundred vis" then I would create a small vi, that does those steps in a loop...

 

It really helps when the control in question always has the same label.

Message Edited by GerdW on 07-16-2009 04:55 PM
Best regards,
GerdW


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

It is one control in several hundred VIs, organized in about 10-15 llb's. The name of the control is always the same.

Maybe I didn't understand the automation method correctly. How could I "list" all VIs automatically? If I would have to type the VIs names into an array by hand that would cost too much time. But I would need such an array to be able to open the VI reference in a loop, right?

Regards,

Gabs

 

0 Kudos
Message 6 of 9
(3,698 Views)
The List Folder function will return you the list of VIs in the LLB.
0 Kudos
Message 7 of 9
(3,692 Views)

Ah - right! Sorry, I didn't think of that. I will try that out and will let you know if it worked as expected. Thank you all!

Best regards,

Gabs

0 Kudos
Message 8 of 9
(3,678 Views)

Maybe I didn't understand the automation method correctly. How could I "list" all VIs automatically? If I would have to type the VIs names into an array by hand that would cost too much time.

 

You have a computer in front of you , use it.

 

Write a program to list all LLBs in a folder.

FOr each LLB

    List all VIs in llb 

    For each VI

       Ref = Open VI (path)

       Changed = FALSE 

       Ctls = Get Front Panel Controls (ref)  // I don't remember the exact name

       For each control

          If Ctl.Name = "Control1"

               Ctl.Range.Maximum = 1000

               Changed = TRUE 

          end if

       end for 

       if Changed 

           Save VI (ref)

       end if

       Close Ref

    end for 

end for

 

Make sure you make a backup of the whole shebang before running! 

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 9 of 9
(3,677 Views)