LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Functional global generator

Is there a way that I can build a functional global, modify its icon, populate its connector pane, and save it for every items in a list?

 

For example, I want 50 functional globals and what I have so far is one instance of the code and 50 names.  Is this where scripting comes in handy or should I be thinking about classes or other options?

0 Kudos
Message 1 of 4
(2,758 Views)

At first: use templates. They already save you 90% of what scripting would do for you.

Classes: Use classes, because there is already a scripting tool to generate accessor vi's available with your LV installation.

Scripting: It really depends on how many data types you need to handle. If it's just I32, U32 and string; yes, a way to go. Just look at the vi's that script the accessor vi's (search NI community for the open source post by AQ), then you can judge the effort (it scales with the data types you need to support).

 

Felix

0 Kudos
Message 2 of 4
(2,755 Views)

This is easier now than it isued to be.

 

I once wrote a "cloner" that went through a VI haierachy and saved-off new copies with new pre/post fixes and re-linked all.

 

I believe you can now do it using a source distribution and using the option to add a prefix.

 

Of course you would have to do it 50 times.

 

Is the ability to acces the source distribution in the project prgramatically? never looked since I already have a cloner.

 

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 4
(2,746 Views)

I assume that you don't actually want 50 separate copies, which you place in your code, but rather N copies which are generated dynamically.

 

In this case, a class is probably the best thing you can have. I assume you want to be able to access the specific instance by reference, so you will need to learn about by-ref wrappers as well. This isn't a small topic, but it's probably worth the time you invest in it. To save myself some time, here's a recent post you can start with. There are also various tutorials online which you can start with.


___________________
Try to take over the world!
0 Kudos
Message 4 of 4
(2,702 Views)