LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

problems in using graph cursor

 Hi all

 

I have two questions

 

1)

 

 I have a Graph control  which has two cursors , cursor no 1 and cursor no 2. The range of X
and Y axes is from -20 to +20 each. I dont want to plot any waveform on this Graph.

I just want to place the cursors on the specific points within the range of x and y axes.
 
In this case, i am using

 

SetGraphCursor(PanelHandle,PANEL_GRAPH, 1 , 10.0,5.0);  // Cursor number 1

 

When i run the program, the cursor does not move to the ( 10 , 5 ). Why is it so?

 

 I have tried the Graph as a control and indicator mode , but the cursor does not move to the specifed position.Why?

 
2)
    If the cursor 1 reaches to the certain position on the graph then i want that cursor 2 also reaches to that position by moving  slowly and gradually on the graph and finally reaches the cursor 1 position. I want that it reaches the cursor 1 position in 5 seconds.
 
 How is it possible?

 

 Any Help will be greatly appreciated.

 

0 Kudos
Message 1 of 4
(3,447 Views)

A1: Which mode have you set the cursors? If you set them to SNAP_TO_POINT you are not likely to be able to move them as there is no plot on the graph. Set them to FREE_FORM instead. Does the function returns any error?

 

A2: you can use SetGraphCursor () to assign the cursor a specific position. You could for example set a timer callback that periodically moves the cursor until it reaches the desired position



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?
Message 2 of 4
(3,444 Views)

 

Hi Roberto,

 

 My problem 1 is solved, as far as problem 2 is concerned , can you send me an example which does that?

 

 Thanks.

0 Kudos
Message 3 of 4
(3,415 Views)

Here there is a little sample project that moves one graph cursor to reach the second one. It may be improved a lot: for example it can be modified to move the cursor a fixed lengh each step (now it splits the calculated routed in a fixed number of steps so that for long routes you see the cursor moving in steps, for short ones you see a more fluid movement). Consider it a conceptual framework that you may adapt to your actual problem.

Hope it may help you.



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?
Message 4 of 4
(3,403 Views)