Labview diagram creation API

301 views Asked by At

I need to drive a testbench with labview. The test scenarios are written in a languages that can be automaticaly translated into labview diagrams.

Is this an API that allow to create "labview diagrams" from another software ? or with labview itself ?

2

There are 2 answers

2
Charlie On BEST ANSWER

I agree that LabVIEW scripting is one approach, but let me throw out another option.

If you are planning to do a one time migration from your test code to LabVIEW than scripting is great, but if you plan to regularly update your test code (because it's easier to use the "test" language than LabVIEW) than it could become quite painful to constantly perform the migration every time your test code has changed.

I've had great success with simply putting my state machine inside of a for loop and then reading in "commands" from a text file that was generated using my "test" language (see pic).

For example, to do an IV sweep my text file might say something like:

SourceV, 5
ReadI
Wait, 1
SourceV, 6
ReadI

This image is greatly simplified - I'm not using a state machine and I don't show how to use "parameters," but I can provide a more comprehensive example if needed. Again, I've had great success doing this with around 30 "commands" controlling multiple instruments and then I generated the text input using VBA or Python. enter image description here

0
Yair On

It's called LabVIEW scripting. You will need to enable an option in the VI Server page in the options dialog to see the relevant features.

A few things to note:

  1. Scripting isn't complicated, but you do need to be aware of how LV code is built.
  2. While scripting is public, it was initially created as an internal tool. There are still corners of it which are incomplete.
  3. Scripting code can be tedious. If you can get away with it, try creating templates of code.
  4. NI has something called CodeGen, which I believe are a series of functions which make some scripting easier, although I never really looked into it.