From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

Create a Step Function Waveform

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview: This VI will build a waveform of a step function with a set number of steps. 


Description:

This VI will build a waveform of a step function with a set number of steps. It uses for loops with shift registers to increment the amplitude of a square wave and then add these square waves together to get the desired waveform.


Requirements: LabVIEW 2012 (or compatible), Hardware: none.


Steps to Implement or Execute Code:

1. Insert parameters.
2. Run the VI.
3. Look at the graph.


Additional Information or References: 

 

Create a Step Function Waveform FP def.png

 

Create a Step Function Waveform sn.png


**This document has been updated to meet the current required format for the NI Code Exchange.**  

Doug Farrell
Solutions Marketing - Automotive
National Instruments

National Instruments Automotive Solutions

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