Programmatically fire graph cursor move event

Is it possible to programmatically fire the Graph Cursor Move Event ?  Assigning a value to the Cursor Index or Cursor Position property node does not seem to do it.
Solved!
Go to Solution.

The graph cursor move event contains processing code for data on the graph along with front panel display of those results.  Data is put onto the graph during data acquisition which occurs in another event.  When that data acquisition event finishes I need to cause the processing code to execute once to update the front panel display so its results are shown for the new acquired data.
I could put the processing code into a different event that fires on say a button value change.  Then the graph cursor move event would fire that button event change by setting its value change property.  The data acquisition event could also fire that button event.

Similar Messages

  • How to avoid built-up for "cursor move" events?

    I have a rather complicated program where several graphs need to be interactively updated according to cursors using "cursor move" events. The problem is that the recalculation is relatively slow and the behavior is less than satisfactory. Since the cursor position needs to be "tweaked" until the result is as desired, I cannot recalculate only at the "Cursor Release" event.
    Lock front panel=enabled makes cursor movements tedious because the cursor movements is very
    jumpy and non-interactive. Not user friendly!
    Lock front panel=disabled queues up way too many move events and once the cursor is released
    the graph continues to jump and recalculate for ages.
    The attached demo (LabVIEW 8.20) shows one solution attempt that actually works pretty well: Skip the recalculation unless the cursor position from the event terminal is equal to the cursor position of the graph property node. This basically races through all unecessary intermediary recalculations on stale positions. However, the code can get complicated very quickly if there are multiple cursors.
    In my opinion, cursor move events should not get queued up! The event buffer should hold only exactly one entry:
    the most recent cursor position for each cursor. Can anyone think of a scenario where the extra cursor position trail is useful? The positions are pretty random anyway, right?
    Does anyone have other (better!) ideas how to work around this problem? I definitely want to keep it simple and not throw lots of code at it.
    The attached demo contains more details. It demonstrates the problem if "selective updates" is checked. If unchecked, it implements the above mentioned workaround.
    LabVIEW Champion . Do more with less code and in less time .
    Solved!
    Go to Solution.
    Attachments:
    CursorDelay.vi ‏29 KB

    Thanks for the example.
    The more I think about this, I strongly prefer my original method. It uses minimal code compare to the other solutions offered here. As a demo, I am attaching an implementation to a slide control.
    Fo those without LabVIEW 8.20.
    All slide events have "lock front panel" disabled.
    TIme delay is 500ms, simulating some complex calculation.
    As you can see, it works extremely well:
    NO shift registers, extra loops, queues, tuning parameters (min times, etc.), etc.etc.
    Just a deceptively simple "equal" followed by a case structure.
    The demo shows a typical recording if I quicky move the slide up and down, then release it. You can see that the raw event structure takes more than 40 seconds to stabilize while my selective solution follows the slider position almost perfectly despite the 500ms stall in each update.
    See for yourself! Can anyone think of a drawback of this method? Even if the slide terminal is not in the same loop, a comparison of a local variable with the newval should do the trick just fine.
    Message Edited by altenbach on 09-28-2006 12:43 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    SLIDEDelay.vi ‏26 KB
    SlideUpdate.png ‏21 KB

  • XY graph "mouse move" event stops generating when click on cursor

    Hello All
    When the mouse is moving freelly inside the XY graph control, the "mouse movement" event is fired.
    The same happens when muse clicks anywhere in the graph with the exception of cursors.
    hen mouse clicks on cursors the "mouse move" event is NOT generated even though the mouse is phisically moved.
    Is there any explanation to this.
    I enclose the example.
    regards
    Pawel

    Just today I had the same problem -> my solution:
    set event timeOut to some value(I have it at 1ms) then
    add to globalVariables some BOOL variable that will signal if mouse is down or up (set the flag in appropriate event),
    then add a case in the timeOut event which will read this
    global variable(flag) -> if it's TRUE then change the needed parameter.
    So even if the mouse move event isn't fired the main timeout event is.
    Not a perfect solution, but better than nothing.
    Peace
    Waldemar

  • Cursor move event dicrease frequency

    Hello!
    A long time ago I remember I saw a forum post or a community doc, where it was explained how to decrease a certain Event to be triggered too frequently.
    I have a graph with a cursor, and when the user starts to move the cursor, I do some minor calculations and output some values into indicators. I would like to discard some of the "mouse move" events, so when the user pulls the cursor "too fast", I do not overload the CPU with processing. I know I could just use the "cursor release" event, but it is not that nice, the user does not get feedback about the values between the two locations.
    So I cannot really remember what was the trick to discard the too frequent triggering, it involved some time stamp comparison I think...
    Could someone help me out, how to properly solve this task?
    thanks!
    Solved!
    Go to Solution.

    In newer LabVIEW version you can limit the size of the event queue. Try this first. (See this completed idea).
    In earlier version I would compare the current cursor position with the position obtained from a property node and execute an empty case structure unless they are equal. The old discussion is here. (Also make sure to disable "lock front panel until event completes").
    The cursor idea in in this reply, see the right side of the following image.
    LabVIEW Champion . Do more with less code and in less time .

  • Cursor move events passing data to dialog

    I have a graph where the user moves the cursor and then I pop up an easy to read dialog with the test number and test description in it.  I tried it with a regular dialog with reentrancy but it locks things up.  Is there a better way to do this?   

    Hi Id,
    I have made a quick example of how to have another window display data to a user using queues. Please let me know if this helps.
    -N
    National Instruments
    Applications Engineer
    Attachments:
    Main2.vi ‏17 KB
    Sub2.vi ‏17 KB

  • Graph cursor move by keyboard

    I have ComponentWorks 3.01 and VB
    is it possible to move the cursor of a graph
    BY KEYBOARD
    When i use mouse ok, but not keyboard
    Thank you

    There is no direct support for this in the graph. The thing that's tricky about this at the graph level is how would you select the cursor that you want to move if you had multiple cursors in the graph?
    Assuming that you only have one cursor, the code snippet below will move the cursor left and right by one point by pressing the left or right arrow keys. To run this example, create a new project in VB6, add a graph to the form, and then paste this code:
    Private Const NumberOfPoints = 50
    Private Const LeftArrowKeyCode = 37
    Private Const RightArrowKeyCode = 39
    Private Sub CWGraph1_KeyUp(KeyCode As Integer, Shift As Integer)
    If CWGraph1.Cursors.Count > 0 Then
    Dim cursor As CWCursor
    Set cursor = CWGraph1.Cursors.Item(1)
    If KeyCode = LeftArrowKeyCode Then
    If cursor.PointIndex > 0 Then
    cursor.PointIndex = cursor.PointIndex - 1
    End If
    ElseIf KeyCode = RightArrowKeyCode Then
    If cursor.PointIndex < NumberOfPoints - 1 Then
    cursor.PointIndex = cursor.PointIndex + 1
    End If
    End If
    End If
    End Sub
    Private Sub Form_Load()
    PlotSampleData
    InitializeGraphCursor
    End Sub
    Private Sub PlotSampleData()
    Dim data(NumberOfPoints - 1) As Double
    Dim i As Integer
    For i = 0 To NumberOfPoints - 1
    data(i) = Rnd() * 10
    Next
    CWGraph1.PlotY data
    End Sub
    Private Sub InitializeGraphCursor()
    Dim cursor As CWCursor
    Set cursor = CWGraph1.Cursors.Add
    Set cursor.Plot = CWGraph1.Plots.Item(1)
    cursor.PointIndex = CInt(NumberOfPoints / 2)
    cursor.SnapMode = cwCSnapAnchoredToPoint
    End Sub
    Hope this helps in getting you starte
    d.
    - Elton

  • Event Precedence - Mouse Move or Cursor Move on Graph?

    Since LabVIEW 8+ introduced cursor events (grab, move, release), is there a conflict that would occur between a mouse move event and cursor move event since a cursor move involves a mouse move?  Or, since the cursor move requires the left mouse button to be down, does that allow LabVIEW to differentiate which event is occurring?  I have some code I am writing to draw a box on an intensity graph (using the new plot.images property for graphs) so as to extract a region of interest.  At first, I want a cursor to follow the mouse as it moves over the graph.  Then, I want to draw the box region when I grab the cursor (with left mouse key down) and drag it.  Differentiation of these two event types will allow me to unambiguously accomplish this task.
    Thanks,
    Don

    Moving a cursor will interleave mouse move and cursor move events.
    However, you can easily keep state of mouse up/down to distinguish what to do in this particular case. See attached draft (8.20).
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    eventqueue1.vi ‏29 KB

  • Programmatically disabling/enabling cursor in intensity graph

    Hello all,
    I am building a LV interface (LV2011) for a stepper XY stage.  The system "scans" a surface, displaying it on the graph.  I set up to cursors to zoom into a region of interest (ROI).  Pressing a button resizes the scales to the ROI (zooming in on the area).  Sections of code move the XY stage, and read a device.  When done I want to zoom into a ROI and use a THIRD cursor to manually move the XY stage.  I have this working with TWO graphs, based on the "region of interest.vi" I found in the dev zone.  
    What I would like to do is have a boolean toggle controlling ONE GRAPH between setting min/max (cursors 0 and 1) and manual stepper position (cursor 2).  If cursor 2 is visible I want cursors 0 & 1 not showing and visa versa. Can I do this?
    I attached the example - bascially what I did was add a cursor to the 2nd graph, grabbing the XY vales and sending to the stepper controllers. Works great!  I am trying to "combine the two" by resizing the orig graph with a button click (works fine) and then click another button to show the XY stage cursor (and hiding the min/max cursors) - thats the brick wall
    On a seond note - controlling a XY stage using the intensity graph's cursor is really nice; however it would be great if I can control the cursor similar to a slider's "coerce" - has anyone done this?  I assume I have to write a routine in the event that performs some modulo function. Just curious!
    Thanks,
    Steve
    Solved!
    Go to Solution.
    Attachments:
    roi.llb ‏40 KB

    Your exmaple works perfect. Howver I am having probs with Val(sngl) on the XY graph.  On the example you gave, lets say I move the cursor with the mouse - event fires, everyone is happy. If I move the cursor with CODE - nada.  I even read the "Value" of the graph and wrote it to "Val(sngl)" to try to fire the event.  How does one force a trigger on an XY chart when you move a cursor (say cursor idx2) using code?
    Better yet - why when I read the Val and write to Val(sngl) does the event not fire??? I have been searching for a basic XY table with sensor -type project but havent found one yet.  Everyting works great - draginng the cursor moves the XY stage. Now I need to do the auto-scan part  Use code to place the cursor - trigger the even that moves the stage.
    Thanks
    Steve
    Attachments:
    XY_Stage_Rev8.vi ‏53 KB

  • How do I get an event-based response to a graph cursor change?

    I want to respond to the user moving a cursor on a data (X-Y) graph. (LV 7.0)
    What I really want is an event called "Graph.Cursor.Value Change", which would supply me with the new coordinates, but I see no such event.
    If I use the MOUSE MOVE event to trigger obtaining the cursor values, it does not give me an event, until the cursor has stopped moving, the button is up, and the mouse moves off the cursor line.
    Sure, I could use a TIMEOUT event, and read it every 100 mSec, but I don't like the time lag.
    What I did was to set a flag TRUE on Graph.MouseDown and FALSE on Graph.MouseUp. I then choose an event timeout of 10 mSec or -1, depending on that flag.
    That works, but is there a more direct way that I'm missing?
    Steve Bird
    Culverson Software - Elegant software that is a pleasure to use.
    Culverson.com
    Blog for (mostly LabVIEW) programmers: Tips And Tricks

    No, unfortunately there is not.
    To code around this limitation, I typically use the timeout event in a more complex way as follows:
    The timeout is wired to a shift register that is initialized with "-1" (no timeout). The value from the shift register then crosses the event structure and feeds to the shift register on the right in almost all event cases.
    I add two special event cases:
    (1) "graph-mouse down" puts a small number (e.g. 10ms) in the right timeout shift register
    (2) "graph-mouse up" puts again a -1 in the right timeout shift register
    (x) All other event cases (incl. timeout) wire the current timeout straight across to the right shift register.
    The timeout event contains the logic to read the graph cursors and associated actions.
    This way there is normally infinite timeout. Once the mouse goes down on the graph, the timeout executes at relatively rapid succession until the mouse is raised again. At which point everything quiets down.
    LabVIEW Champion . Do more with less code and in less time .

  • 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?

    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
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    LV8CursorMove.png ‏6 KB

  • Graph xy move cursor programmability

    Hi, i have this problem,
    i have graphXY with one cursor, "Snap to point" "Channel 1", when programmability associate one position(x) for the cursor, no accept the new position. Why?
    Hola a todos, perdón por mi inglés, pero tengo el siguiente problema, Tengo un gráfico de tipo Xy, en el cual tengo un cursor asociado al Plot 1 bajo la modalidad Snap to point, si programáticamente quiero cambiarle el valor X a ese cursor, no solamente no lo hace, sino que vuelve al princicipio de la señal. Cómo puedo evitar esto?. No quiero que funcione el cursor en forma free, porque no me toma los valores del Plot.
    Podrían saber por qué es esto?
    Muchas gracias, saludos, MFS.

    So what is the question about... I have to use XY graph in my program. It is used in Loop while cycle. It shows the statistic of a variable. I am using cursors in this graph to check the actual value of a variable in different period of time. But there are 7 variables and it is extremely hard for user to check each value independently. So I tried to make them moving on the X axis (TIME) together using the property node (cursors reading the position (only X axis, Y axis status lock to plot) of the major cursor and follow it... Everything looks great? But it did not work when I am trying to move the major cursor manually on graph... It works only when I am using the cursor movement buttons... But they work very slowly when there is a lot of data in graph.
    I want to find out is it possible to make seven coursers mouthing together By the X axe and be Locked each at its plot by Y axe manually (Using mouse moving on a graph). Is it possible? If it is than how to do it?

  • Automatic Cursor Movement in one Graph, in accordance to the cursor in another graph

    I am using two XY graphs each with 4 cursors. I want to assign each cursor of graph A to each cursor of graph B such that the corresponding cursors in graph B moves in accordance to the cursors in graph A.
     I have used Active cursor, Cursor.PosX and it works for one cursor. However when I use the same concept to change the active cursor value and faciliate the automatic movement for all cursors they do not work.
    Message Edited by Chathuri on 08-13-2009 06:26 AM
    Solved!
    Go to Solution.

    Hi,
    As requested I would like to post the solution as to how I tacked the problem. It was actually small mistake on my part. When I connect the two property nodes for each XY graphs I should connect ActiveCursor to ActiveCursor and Cursor.PosX to Cursor.PosX. What I did was connect the Active cursor of A graph to the cursor.index of B graph. I have attached a small screen shot of connecting the first cursor of A graph to the 1st cursor of B graph so that the cursor in B graph follows the cursor in A graph.
    In order to connect more cursors as in my case, the only change to be made is the change in the Acitve cursor constant to, 1,2,......
    Chathuri
    Attachments:
    CursorMovement.JPG ‏7 KB

  • Programmatically Fire Events

    Hello, I am a newbie in Event-driven programming.
    I want to fire a user-defined event from within the same event structure.
    According to tutorials it seems to be possible, but I could not manage to have this simple VI working.
    I explain my point in the block diagram of my Vi.
    thank you very much! I cannot work it out!
    Attachments:
    event-example-1.vi ‏11 KB

    Simple answer!
    Move your create event and the register node outside of the loop.
    See the attached vi.
    Attachments:
    event-example-1[1].vi ‏14 KB

  • Unexpected Windows cursor/Waveform Graph cursor behavior

    Hi,
    I got a very strange Windows cursor behavior with waveform graph. Simplified VI is attached.
    LabVIEW 2014 SP1
    The problem is:
    The VI contains only one waveform graph.
    1. I start the VI. Cursor Movement Tool is selected in the Graph Palette by default. Corresponding “Cross with dot” Windows cursor appears when mouse is moved over the plot area (see image). So far so good.
    2. I select Zoom in the Graph Palette and use it two-five times (second image).
    3. I select Cursor Movement Tool in the Graph Palette again but Windows cursor does not change as it should. It is an open cross now (third image); i.e. the same as shall appear when cross of Graph Cursor Lines is reached.
    4. I click mouse three-seven times anywhere in the plot area and the cursor becomes normal (as in the first image).
    The problem is not only in shape of the Windows cursor. The whole Graph cursor functionality does not work properly if the Windows cursor has the wrong shape.
    Please advise what could cause this problem.

    It seems, i cannot explain the question in good way
    It is not about my data or zooming. It is about strange bahaviour of the Graph. The following sequence of steps illustrates the problem and shows that the zooming is not the issue (or, at least, not the main issue):
    I do the following:
    1. Start the VI.
    2. Select first Graph cursor in Corsor palette and use pop-up menu "Bring to Center".
    3. Zoom couple of times (not too much) keeping the Grapg cursor visible.
    4. Select Cursor Movement Tool in the Graph Palette.
    5. "Open cross" Windows cursor appears from the beginning. I cannot pick up the Graph cursor.
    6. Click left button of the mouse several times in any poin of the graph area.
    7. Windows cursor is changed to the normal "cross with central point".
    8 Now I can pick up the Graph cursor.
    I would suspect problems with zoom until p.5. However p.6-8 are done without any change of the zoom.
    By the way, I found more:
    If I try to move the Graph cursor after p.5, the whole graph moves and fires event "Scale Range Change". It must not happen with Cursor Movement Tool selected.
    I can guess only about some strange setting of the graph. May be I am not aware about them

  • Graph Cursor Question

    I have a cursor on a XY-graph that I'm trying to adjust (x position) via controls on the front panel.  I have one control that works great and adjusts one number at a time (ex. 500 to 501, etc).  I'd like to have two controls one like I have that would be a fine adjustment (I believe) and another for coarse adjustment that would adjust the value by 50 or whatever.  Hence this would be adjusted first (ex 550) and then the other control would be adjusted for fine tuning (ex to say 551 etc). 
    I'm having trouble figuring this out, and was hoping someone could giv eme some tips or ideas as to what to do.  I thought this might be something fairly common, but maybe not.
    Thanks in advance...
    Using Labview 7.0 and 2010 SP1 with Windows XP and 7.

    LabVIEW 8.0 would make these things much easier, because we have events for cursor movements! .
    In LabVIEW 7.0, you need to code around it. For example, you could place the cursor reads into a timeout event which is only active when the mouse is down on the graph (enable timeout with mouse down, disable with mouse up event).
    The attached shows one simple possibility (I don't think you need the course control).
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    DualCursorControl3.vi ‏64 KB

Maybe you are looking for

  • 10.4.8 and my Laptop non-intel

    I'm afraid I may have installed the latest Tiger version 10.4.8 onto my G4 Powerbook before I should have. Is 10.4.8 only for the intel chip? Because since I've upgraded to this version my Laptop doesn't startup sometimes and I have to force reboot t

  • How to activate my bought CS5 after installing SSD as C

    How to activate my bought CS 5 with license [number removed] after changing partition C with old  harddrive into SSD harddrive?

  • Trigger for invoice creation after POD Entry

    Hi, Is anyone familiar with the process surrounding POD? In BW, I am trying to extract to the POD time & date, but it looks as if thats impossible as it only sits in the change header. AEDAT holds the date, but AEDAT cannot be relied on as the only d

  • SO close - location script help

    Hi everyone! I am SOOOO close, Im off by a letter or a _root. or something! At least I think so. Anyhow, im desperate, and coming to you guys, those that know infinitely more than me. So I have a flash file with 2 scenes. Scene one is an intro, scene

  • Gui tris (tic tac toe)

    Hi, i am trying to create the tris game in java (maybe you know this game as tic tac toe). I created windows and the alghoritm to play. But now i have the problem to create the board. My idea is to create a board with nine clickable cells, the player