LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to load a VI and find it's input parameters (connector inputs)

Any ideas? I have searched for an answer on these forums, but have not found a solution. I am creating a VI displaying a list of available VI functions that people can use in a test sequencer. When the user selects the VI, I want to be able to load the VI and display what input parameters it has from either the connector pane or from the VI itself. Can this be done, and if so how? TIA Martin
0 Kudos
Message 1 of 13
(3,599 Views)

Hi Martin,

you can use a property node to read all controls of the selected vi. If you have a list of all, you can check if it is a control or an indicator.

 

Hope it helps.

Mike

Message 2 of 13
(3,587 Views)

Using supported functions it is possible to loacte all of the controls on the FP of a VI by fisr opening the VI and get a reference to the Panel and then use that porperty to get at the ""Control[]" property. This will give you an array of ref's can be used to get the name and get/set their values.

 

The connector Pane is something that requires scripting to access and is not supported. I have never had to use this info in a delivered app.

 

I hope that helps,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 3 of 13
(3,584 Views)

There is a private method (unlocked via scripting) that does this. The method is called 'Export Interface'.

 

Good luck on your journey. See here for an example.

 

Ton

Message Edited by TonP on 09-08-2008 03:20 PM
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!
Message 4 of 13
(3,579 Views)
Hi, Thanks for all your help. With your information I have opened up the VI using the Open VI Reference, and then invoked method Ctrl Val.Get All[Flat]. Looking at the results, I get all the information on each input. For instance, on my knob control I get all four controls, then I get the same four controls on my second knob, and so on. I can't seem to find how to retrieve just the knob's parameters (i.e. unsigned long and it's name). I am still investigating, but if anyone else has this any help, let us know. TIA Martin
0 Kudos
Message 5 of 13
(3,571 Views)

Hi Martin,

use a property node instead of an invoke node. Use the property front panel. You will get the reference to the front panel. Use another property node and connect the front panel refnum to it. Select control elements. Run through a for loop and use a property node with the selection "class id" and "label.text".

 

Mike

Message 6 of 13
(3,567 Views)
Hi, I have created property nodes this time, but I do not understand how to set the selection "class id" and "label.text" for the other property node and loop routine. Martin
0 Kudos
Message 7 of 13
(3,561 Views)

Hi Martin,

see the attached example please.

 

Mike

Message 8 of 13
(3,542 Views)
Hi, Thanks for the example. I did this, and have come up with the same information that the above help covered. The class id gives me each parameter of the knob, (e.g. A, B , C, D), but I want only the connector input parameters (e.g. Linked to a knob of unsigned integer of name this is a knob). I want this so when the user selects the function (VI), the user can add the required parameters to run the VI. Martin
0 Kudos
Message 9 of 13
(3,537 Views)

Hi Martin,

 

I wrote this Nugget on using control references to help out people that are just getting started using them.

 

You may want to review that Nugget for some inspiration.

 

Just rtrying to help,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 10 of 13
(3,530 Views)