Example Code

Programmatically Set/Select Range of Waveform Chart's X Axis

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
To programmatically get the same functionality/behavior as the Chart History Length

Description:
When you set the range of a waveform chart, by right-clicking the waveform chart and selecting Chart History Length - LabVIEW will automatically always show you the end of this range of values. However, if you set the maximum range with a property node, we always see the beginning of this range of values. We can programmatically get the same functionality/behavior as the Chart History Length by checking the current history of the chart, and then setting both the maximum and minimum through a property node. Don't forget that the array is zero-indexed!

Instructions:
To implement this example:

  1. Run the VI
  2. Set the Range to Get the Desired Wide of data


To execute this example:

  1. Install the required software.
  2. Open the VI and refer the Implement Steps


Requirements
Software
LabVIEW 2012 or compatible

Hardware
-

bd.pngfp.PNG

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

Regards,


Imtiaz Chowdhury
Project Manager
Green Running / Austin Consultants

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

Comments
G-Money
NI Employee (retired)
on

Thanks for posting this!

brimcd
Member
Member
on

Great start, but only works up to <History Length>

Another way (seems to work for all- cant seem to upload the vi here!) :

SetXscale.png

simyfren
Member
Member
on

Thanks for tips, but these two VIs doesn't work in my imagination. I improved the second VI, now its work for all time, and data start at scale minimum of the graph, not from scale maximum.

LV_programatically_change_x_range_of_graph.png