Example Code

Creating a Scrollbar and Adding to a Waveform Graph Using Property Nodes

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

Coding that exemplifies how to use a horizontal slider to mimic the behavior of a scrollbar on a graph using property nodes.

 

Description

Waveform charts have built in scrollbars, but waveform graphs do not. You can use Property Nodes to achieve the same functionality on a graph by using a slider.

The VI generates 1000 random numbers and plots them on both a chart and a graph. The chart scrollbar is visible, and you can scroll through the points, displaying 100 at a time. Using the value of a slider to control the minimum and maximum value of the display area on the graph, you can obtain the same effect as a scrollbar. This code consists on inserting a random number into an array depending on what the user chooses. Within the options the user has, we can select either to insert a value at the beginning, the end, or at any specific index.

 

Requirements

LabVIEW 2012 or compatible

 

Steps to Implement or Execute Code
1. Rum the VI.
2. Move the slider to scroll on the Waveform Graph.
3. When desired, finish the execution with the Stop button.

 

Additional Information or Reference

Capture.PNG

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