LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to display structure elements(4) in run time with the cursor on a graphic control?

Using the GetGraphCursor() and SetCtrlVal() function in LabWindow v.5.5, I am able to display and update the two elements in a structure. How can I display and
update the other two elements in the structure with the
moving cursor? Any suggestion and reference will be greatly appreciated.
0 Kudos
Message 1 of 3
(3,036 Views)
From your description, I am assuming that you are trying to plot two sets of data and use two cursors to check their value on the graph.

There is a good example for Graph Cursors that is installed with LabWindows CVI. It is called "graphcursor.prj" and it is located in the C:\...\MeasurementStudio\CVI\samples\userint directory.

This graph cursor example plots some random data and demonstrates 3 different types of Graph Cursors ( the cursors are setup in the properties of the Graph Control in the User Interface). It also retrieves data from one of the cursors to place in a numeric indicator.

To make this example work for two sets of data, you need to add another PlotY command with your second array of data points. This will plot both of the arrays on
the same X-Y graph. In the callback function for the graph, the updating of the numeric indicators are done by SetCtrlVal() functions. By adding another Numeric indicator and a GetGraphCursor command, you can display the location of any of the other cursors.

Good Luck!

Mike Rakolta
Applications Engineer
National Instruments
www.ni.com/ask
0 Kudos
Message 2 of 3
(3,036 Views)
Hi Mike,

Thanks for you input, I have check out the sample graphcursor.prj and not able to use that sample to
solve the problem. Attach is the source file for your reference. The purpose of the program is
to collect ethernet data and display the target with x, y coordinate which represent the range and degree from North and also the ID and altitude data associate with this xy point. When I ran the GetGraphCursorIndex, I got a ( -1) value, indicating the cursor is not attached to the plot. The plotpoint routine is run from a menuitem, and the GetGraphCursor is run from the panel control. Thanks for your help.

Rosa Leung
0 Kudos
Message 3 of 3
(3,036 Views)