LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

creating graph cursors dynamically

Hello All,
 
I am a beginner with lab/windows CVI. I want to create a graph cursors dynamically.
Here is what I want to do,
Once a waveform is displayed i want to create graph cursors dynamically so I can choose different
parts of the waveform and adjust it to different time lengths.
I figured graph cursors are the best way to do it if there is any other better way please let me know.
 
Thanks in advance,
Dipen Shah
0 Kudos
Message 1 of 3
(2,860 Views)
To dynamically activate cursors on a graph control you must set the appropriate number of cursors needed with the statement:
SetCtrlAttribute (panelHandle, PANEL_GRAPH, ATTR_NUM_CURSORS, numCurs);
 
After this, you can set the appropriate attributes for the cursors with:
SetCursorAttribute (panelHandle, PANEL_GRAPH, 1, ATTR_CURSOR_COLOR, VAL_RED);
In any case you may customize your cursors in the UIR editor, next put number of cursors to 0 before saving the UIR: the cursors will not be shown until you set their number as I showed you before.
 
Plot value at the cursor position can be obtained with:
GetGraphCursor (panelHandle, PANEL_GRAPH, 1, &x, &y);
 
Your graph must not be in indicator mode to be able to process cursor events.


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 3
(2,851 Views)

Thanks,

I appreciate your reply.

I will need more help in future

 

 

0 Kudos
Message 3 of 3
(2,825 Views)