Question

I need to write some code that will

  1. Load some pre-existing virtual instrument (for example, from .vi file) or built it from scratch
  2. Customize it on a flow, for instance, replacing the data format of some input wire or add some new one
  3. As an output, to have the vi file, but not the compiled as a whole, but also as the LabVIEW project, which the end user can easily "reverse-engineer" since it will look like any usual LabVIEW virtual instrument project.

So, in general, instead of producing the VI as a black box, that can be easily implemented with any programming language that can be compiled to DLL, I'd like to deal with LabVIEW's pre-defined VIs' metainformation and to have some LabVIEW project as an output. Is there some API to do it? Google says nothing on it, but maybe there are non-obvious ways to do it?

Was it helpful?

Solution

The API for generating or editing LV code is known as LabVIEW scripting. In recent versions of LV it's an official part of the environment and you can enable it from the options dialog. Keep in mind that it was originally created as an internal feature, so it does have some holes, but it is mostly complete. You can find materials online on working with it. Note that in general, while LV scripting is not particularly complicated, it does require a good understanding of the class hierarchy and modelling of LV block diagrams.

Also, note that if you want a more complex application, LV 2012 and later has a built-in feature which will generate a complete project from a template, and you can create your own templates. This is useful if you have projects with the same structure.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top