3

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 ?

Fabrice LARRIBE
  • 322
  • 3
  • 9
  • Is my answer clear enough? Would it be helpful to expand? – Charlie Jun 22 '15 at 15:30
  • Your better off going with Matlab or another framework for this sort of thing. I worked with Labview for about 5 years and found most other software were better at this sort of thing. – Greg Oct 11 '15 at 22:19
  • @Greg : There is a reason why I cannot use Matlab: I shall drive a bench which run with Veristand, drived by Labview. – Fabrice LARRIBE Oct 16 '15 at 11:30

2 Answers2

4

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

Charlie
  • 2,004
  • 6
  • 20
  • 40
3

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.
Yair
  • 2,266
  • 12
  • 12