LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to programmaticly open a type-def control such as a combobox string control, modify it, and close it via invoke/property nodes?

Solved!
Go to solution

This might sound crazy; but I was searching through methods and properties looking for a solution to do the following:

 

  1. Open a strict type-def cluster.
  2. Add an element in a Combobox string control.
  3. Save the control.
  4. Close the type-def.

Does LabVIEW provide the tools to do this within it's vast array of pallets?

 

Step two is easy as long as the control or the parent cluster is not a strict type def.

 

G.R.

 

CLD
0 Kudos
Message 1 of 5
(2,487 Views)

It should be possible to do this using scripting, but it will not be a trivial task.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 5
(2,485 Views)

@mikeporter wrote:

It should be possible to do this using scripting, but it will not be a trivial task.

 

Mike...


 

But they says right there in the original post that step 2 is easy. (Hi Mike!)

 

The important point is the VIs that use the type def must be in edit mode or closed when the change is made.

 

Provided you are not using bundles (not bundle by name but bundles) they code may actully work after the change.

 

Ben

 

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 3 of 5
(2,470 Views)
Solution
Accepted by topic author 92Redstrat

This is tedious, but straightforward using VI server / scripting.  First, make sure the extra scripting items are turned on in the VI server options.  Now, open the typedef like you would a VI.  In scripting, a typedef is like a VI with no block diagram, only a front panel and control.  You can get a reference to the control you need to change in one of two ways:

 

  1. Open its containers from top to bottom, using the container reference as the owner input for opening the new control.
  2. Use the traverse VI on the scripting palette

In any case, after modifying it, save it using the save instrument method and you should be good to go.  The hardest part is getting the reference to the control.  If you run into issues, let us know.

Message 4 of 5
(2,468 Views)

Thank you for the very useful information.  Enabling VI scripting was the main key.  My solution became a bit complcated because I was appending new elements to the string comboBox  which was a strict type def contained by a strict type def cluster.  Anyhow I have a solution that works. 

CLD
0 Kudos
Message 5 of 5
(2,446 Views)