Example Code

Monitor Cursor Movements 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: VI demonstrates how to access the cursor coordinates using property nodes and determine if it was moved.


Description: In LabVIEW, you can add cursors to the Waveform Graph and track their values through the Cursor Legend. If you need programmatically access the coordinates of each cursor, you can do so by manipulating the properties of the graph and its cursors. The attached example program demonstrates how to access the cursor coordinates using property nodes, and then determine if the cursors' position has been moved. The VI uses the Property Node "Cursor List" to get the location from the graph and then parses the data into arrays using Index Array and the assigns that to a Unbundle By Name to get the Position. This general idea can be manipulated to make a more robust graph indicator.


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


Steps to Implement or Execute Code:

1. Press the Run arrow to run this VI.
2. Click and drag one of the cursors on the graph
3. Watch the 'Moving' indicator illuminate and the cursor positions update.


Additional Information or References: 

 

Monitor Cursor Movements using Property Nodes FP.png

 

Monitor Cursor Movements using Property Nodes BD.png


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

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