LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Obtain reference to type def control

Solved!
Go to solution

Hello All,

 

  I have been using VI scripting to update portions of VIs, and have run into a problem in one instance.  I have not been able to obtain a reference to a type def control (.ctl file).  The control is simple enum, and I saved it as a type def because I use it several places in my main VI, although I don't think my problem has anything to do with the fact it is a type def.   

 

  I know how to obtain a reference to a VI (Open VI Reference Function), and I know how to obtain a reference to a control within a VI (Open VI Object Reference Function), but not a stand alone control.  The help file details for the Open VI Reference function imply that I might be able to do this with the "Strictly Typed VI Reference" instructions, but it will only let me select .vi files, and not .ctl files.  Please Advise.

 

Thanks Much,

GSinMN     

0 Kudos
Message 1 of 3
(4,434 Views)
Solution
Accepted by topic author GSinMN

You can open a typedef control by using the Open VI Reference and wiring the control path to the VI path.  You can then modify the control with scripting by getting a reference to the control on its front panel.  If you have an existing VI with the typedef control, you can get a reference to the typedef (not its instance) by getting a reference to its instance and using either the Typedef VI or Typedef Path properties to get the reference or path to the typedef.


This can be confusing because a typedef is literally a VI without a block diagram, and scripting treats it as such.

0 Kudos
Message 2 of 3
(4,423 Views)

Thanks DFGray.  Nice and simple, just as I hoped.  I was making it more complicated than it needed to be.  Excellent advise.

 

GSinMN

0 Kudos
Message 3 of 3
(4,416 Views)