01-05-2009 01:29 PM
Does LabVIEW support reflectivity in metaprogramming?
By this I mean, can LabVIEW programatically generate LabVIEW code? Can one write a VI whose output is other, new VIs?
I think this amounts to a question of whether there is a way to create data having the same type as VIs do, for example by writing binary files. I've looked at .vi files in a text editor, and there is not much I can make sense of.
01-05-2009 01:40 PM - edited 01-05-2009 01:43 PM
01-05-2009 01:41 PM - edited 01-05-2009 01:42 PM
Yes (as Cory posted seconds before me), its called "scripting" and requires a seperate license.
In my experience I have yet to find a situation where it was worth the effort to use in an app. The best I have seen come out of scripting was utilities that would auto-wire tunnels or clean-up a icon connector.
Of course you may be the FIRST person to harness that critter.
Ben
01-05-2009 01:46 PM
What exactly are you wanting to do? There may be a way of accomplishing it without the added complexity of scripting.
Mike...
01-05-2009 01:52 PM
Ben wrote:
Of course you may be the FIRST person to harness that critter.
Definitely not the first. NI created scripting so it could be used (for the vision builder, if memory serves) and use it they do. When you use LVOOP, for instance, you use scripting every time you create an accessor VI. I'm sure there are other places where it's used and it looks like NI is making it more organized. 8.6 has a folder of VIs which seem to translate XML into scripting commands. I haven't looked into this, but I assume this was done because it's used somewhere, not because NI felt like playing around.
01-05-2009 01:55 PM
Ben wrote:its called " scripting " and requires a seperate license.
License???
Similar to James Bond, "license to script"??? 😮
01-05-2009 01:55 PM
Express VIs can be used for Code generation.
Ton
(I always had the impression that at least this code makes usefull use of scripting)
01-05-2009 01:56 PM - edited 01-05-2009 01:59 PM
tst wrote:
Ben wrote:
Of course you may be the FIRST person to harness that critter.Definitely not the first. NI created scripting so it could be used (for the vision builder, if memory serves) and use it they do. When you use LVOOP, for instance, you use scripting every time you create an accessor VI. I'm sure there are other places where it's used and it looks like NI is making it more organized. 8.6 has a folder of VIs which seem to translate XML into scripting commands. I haven't looked into this, but I assume this was done because it's used somewhere, not because NI felt like playing around.
What can I say?
Yep!
Ton wrote "(I always had the impression that at least this code makes usefull use of scripting) "
So NOW what can I say?
So little apetite, and so much humble pie to eat. ![]()
Ben
01-05-2009 02:02 PM
>"rusty nails in LabVIEW's attic"
Ooo, that is too good to be true. So, the rope is available, to those who imagine they need it?
Thank you, I will follow the links - I'd never have guessed to look at "scripting" to find it.
I don't have a reason I need it yet, but I use reflective metaprogramming in other languages and it occurred to me that I have no idea how to write even the simplest LabVIEW program without using the Development Environment to draw it on a block diagram. I have many times already used simple metaprogramming with LabVIEW as the metalanguage and other languages (like the scripting languages built into instruments and motor controls) as the object language, and had to wonder about the obvious next step.
I don't have any project needs right now that couldn't be done without it, but that's bound to change.
Thanks!