09-10-2010 02:16 PM
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?
09-10-2010 02:22 PM
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
09-10-2010 02:28 PM
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
09-11-2010 12:31 PM
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.