From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

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,191 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,168 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,166 Views)