LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Metaprogramming - does LabVIEW support reflection?

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.

0 Kudos
Message 1 of 9
(3,871 Views)
Sort of, but it requires scripting
Basically, it is very high level LabVIEW programming that could be very dangerous to your system because it is unsupported. Hense, it is reffered to as "rusty nails in  LabVIEW's attic"
Message Edited by Cory K on 01-05-2009 01:43 PM
Cory K
Message 2 of 9
(3,866 Views)

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

Message Edited by Ben on 01-05-2009 01:42 PM
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 3 of 9
(3,865 Views)

What exactly are you wanting to do? There may be a way of accomplishing it without the added complexity of scripting.

 

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 4 of 9
(3,854 Views)

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.


___________________
Try to take over the world!
Message 5 of 9
(3,847 Views)

Ben wrote:

its called " scripting " and requires a seperate license.


License???

 

Similar to James Bond, "license to script"??? 😮 

Message 6 of 9
(3,843 Views)

Express VIs can be used for Code generation.

 

Ton

(I always had the impression that at least this code makes usefull use of scripting)

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 7 of 9
(3,842 Views)

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. Smiley Wink

 

Ben

Message Edited by Ben on 01-05-2009 01:59 PM
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 8 of 9
(3,841 Views)

>"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!

0 Kudos
Message 9 of 9
(3,834 Views)