LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event structure and waveform graph cursor

I am utilizing a waveform graph and I need to programatically manipulate multiple cursors based upon the movement of a primary cursor.  I would like to use the event structure to avoid processor usesage. 
 
My approach is to create an While Loop/event structure where it goes into a it when there is a "mouse down" on the waveform graph.  Once in it, there is another While Loop/event structure that has two cases: Time Out (set to 25) and a "Mouse Up" on the waveform graph.  In the Time Out case, the primary cursor is read and modifies the location of the secondary cursors.  In the "Mouse Up" case, the primary cursor location is read, other cursors are manipulated, and the While Loop is exited.
 
When I code this up and perform a "mouse down" on the waveform graph, the index on the inner While Loop/Event Structure is advancing but there is no control (can't move it) of the primary cursor on the waveform graph.  When I "Mouse Up", the inner While Loop exits.
 
Obviously, my approach is flawed here based on my lack of understanding of the characteristics of the waveform graph and cursor manipulation.  Has somebody come up with a way to achieve what I am trying to do?
 
 
 
0 Kudos
Message 1 of 4
(4,293 Views)

HI,

 

I think I am close to what you are looking for.

 

I used one while loop and one event structure.  The event struct has an event for Graph: Mouse Up (set time out to -1), Graph: Mouse Down (set time out to 100ms), and time out (set cursor1 x-pos = cursor0 x-pos +20).  Then I  used a shift register to update the timeout node with either the -1 value (no timeout), or the other value (I used 100 ms).

 

This worked OK for me, but  I am not sure of your exact use case.

 

I attached a simeple VI (ver 7.1) so you can test it.

 

Let me know if you have any questions.
joel

0 Kudos
Message 2 of 4
(4,270 Views)
Joel,
 
Very fascinating use of the shift register for the time out.  I had never considered it.  I believe that you have achieved the objective that I had set out to accomplish.  Thanks for your insight!
 
Mike
0 Kudos
Message 3 of 4
(4,256 Views)

This is basically the method I typically used in LabVIEW 7.1 and below as described in this old post.

Of course you could upgrade to LabVIEW 8.0 and none of this is necessary! LabVIEW 8.0 has events for "Cursor Move". 😄

Now you only need the "cursor move" and "stop" cases. Isn't that cool! 🙂
 
 

Message Edited by altenbach on 12-12-2005 07:05 AM

0 Kudos
Message 4 of 4
(4,246 Views)