Some courses and learning paths on NI Learning Center may not appear on learner dashboards. Our team is actively investigating.

If you encounter access issues, please contact services@ni.com and include the learner’s name, email, service ID or EA number, and the list of required courses.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW / G Code Generator? (aka metacoding)

Metacode, aka code that writes code. Is there any way to write a code generator (in any language) that outputs LabVIEW / G code, something I can call as a VI?

For example, writing DB interface code is tedious. Not hard, but repetitive, and with mindless repetition comes mistakes. Concrete example of metacode: I have a parser that takes the SQL create table statements and generates PHP code to do things like ReadFoo, WriteFoo, FindFoo. I only have to debug my read/write/find logic once, and each table gets its own set of functions.
0 Kudos
Message 1 of 3
(3,817 Views)

@batesbc wrote:
Metacode, aka code that writes code. Is there any way to write a code generator (in any language) that outputs LabVIEW / G code, something I can call as a VI?

For example, writing DB interface code is tedious. Not hard, but repetitive, and with mindless repetition comes mistakes. Concrete example of metacode: I have a parser that takes the SQL create table statements and generates PHP code to do things like ReadFoo, WriteFoo, FindFoo. I only have to debug my read/write/find logic once, and each table gets its own set of functions.



You might want to look on the LAVA user forum website under 'LabVIEW scripting', as they call it: http://forums.lavausergroup.org/index.php?showforum=29
0 Kudos
Message 2 of 3
(3,794 Views)
Maybe. There have been several postings here and on the LAVA site about LabVIEW Scripting. While I don't think it is far enough along to actually build a true metacode generator, I think it might get you something close.

There are also templates and merge VIs that can help you come up with some standard VIs that just need to be tweaked.

Hope that this helps,
Bob
0 Kudos
Message 3 of 3
(3,792 Views)