Example Code

Stack an Arbitrary Number of Plots on a Chart

Code and Documents

Attachment

If you show the VI Scripting Methods and Properties from the Options menu in LabVIEW, you'll have the Waveform Chart property nodes needed to stack plots programmatically.  Since you can't toggle the Stack Plots property during run time, use a helper VI to toggle the Stack Plots property of a chart in an Idle VI.  After you set the properties of the chart, run the VI.

One quirky thing I ran into was for the chart to adapt to a different number of waveforms between runs, I had to toggle the Stack Plots property off, set the number of visible items in the chart legend to match the new number of waveforms, then toggle the Stack Plots property back on.  If you like, you can then hide the legend, but the number of plot areas within the chart always corresponds to the number of visible items in the legend when the Stack Plots property is toggled on.  If you send more waveforms to the chart indicator than there are plot areas for, the last plot area overlays the extra traces.

2011-02-24_221355.png

I used a private property to line up each digital display with the plot area, and you can find information about that on Lava if you need it.

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
Pie56694
Active Participant
Active Participant
on

As a caveat, VI scripting methods are unavailable in the runtime engine.  If you build a LabVIEW EXE with enhanced DSC support and debugging enabled, the EXE can use the scripting node.  You should understand the caveats of the DSC RTE before you use it.

josborne
Active Participant
Active Participant
on

Is this still true about VI Scripting?  Just want to confirm that VI scripting CAN NOT be used in built executable.

http://www.medicollector.com
Hooovahh
Proven Zealot Proven Zealot
Proven Zealot
on

Old I know but I just found this.  In general you cannot use VI Scripting in an EXE.  Some scripting allows for making VIs from scratch and saving them, and if that could be done the run time engine would be as big as a LabVIEW install.  Some functions however do work, you can open them and look at the help which will state if it isavailable in the Run-Time or not, in this case you cannot use this in an EXE because of the Stack Plots property that is read only in an EXE.

Contributors