Example Code

Example Code To Split the Waveform Into Two Parts From Threshold With 2 Different Colors on the Graph.


  • LabVIEW

Code and Documents



To split a waveform into two parts from a threshold with different colors on the same graph in LabVIEW, you can use the attached VI. 


How to Use

First, acquire your waveform data and pass it into the Get Waveform Components "data" input. Then, 1. Checking if the signal's 'Y' component is higher than the Threshold, if so it should add that value or add a 'dt' time interval into the Build Waveform Y component input array, which will build a new waveform on the top of the threshold.  After cutting the waveform from the threshold, it merges the 2 waveforms into one.

Additional Information

The LabVIEW code is written in version 2023 Q3. I will attach the code for the following versions: 

  • LabVIEW 2023 Q3
  • LabVIEW 2022 Q3
  • LabVIEW 2021

If you require the code for a previous version, please comment below and I will respond promptly.

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