Example Code

Display 4 Quadrants in XY Graph

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 programmatically sets X&Y scale grid colors to transparent then creates X&Y cursor positions to divide the XY Graph into 4 quadrants. The quadrants can be altered by changing the Cursor Style control.


Description

The user can change the cursor style by changing the control in the front panel. This is useful for plotting bi-polar sources or photodetector. The property nodes are located inside of an event structure so that the properties of the XY Graph only get updated when the Cursor Style value changes. The timeout is set to 100 milliseconds; therefore, if the value doesn't change in 100 ms or less, it will run the code located in the timeout case. The timeout case is a great place to write to the graph or perform any calculations.


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


Steps to Implement or Execute Code

1. Run the VI.
2. Toggle through the different cursor styles by using the front panel control.
3. When finished, click the stop button.


Additional Information or References:

 

Display 4 Quadrants in XY Graph FP.png

 

Display 4 Quadrants in XY Graph BD.png


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

Andy Chang
National Instruments

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