Example Code

Get mouse track and coordinates using LabVIEW

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

Download All

 1. Overview:

This VI performs draws the track that the mouse pointer peforms on the graph and set points in the graph when user clicks over it

 

2. Description: 

Get the coordinates of a mouse click or track the movement of the mouse are requirements that could be tough to handle if the properties of the event structure are unknown. In this example, it is shown how to use this structure and its properties to get the track of the mouse over a graph and get the coordinates of a mouse click. Both track and point coordinates will be represented in a XY Graph.

 

3. Requirements

  • LabVIEW 2012 (or compatible)

4. Steps to Implement or Execute Code

  1. Unzip "Click Points LabVIEW 2012 NIVerified"
  2. Run Click Points LabVIEW 2012 NIVerified.vi
  3. Position the mouse over the graph and move it. The track will be drawn in the XY Graph.
  4. Click the mouse over the graph. The coordinates of this mouse click will be represented in the graph with the mouse track.

 5. Additional Information or References 

VI Block Diagram

 

Block Diagram.JPG

 

 

 

**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.