From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Moving graph`s cursor manually by numeric control

Dear guys,

 

I wonder if is it somehow possible to move graph`s cursor by putting a number to numeric control and preserve the possiblity of moving the cursor by mouse too. Please see the attached screenshot.

 

Thank you for your tips!

Download All
0 Kudos
Message 1 of 13
(4,326 Views)
Yes, it's possible, and relatively easy. Use the Cursor.PosX (right-click on graph and then select Create -> Property Node -> Cursor -> Cursor Position -> Cursor X) and Cursor.PosY properties. You will need to change your indicators to controls and then handle the value change events for them so that you can write to those properties. Obviously in your current "Cursor Move" event you will need to use the Value property for the controls so you can update them if the cursor is moved with the mouse.
0 Kudos
Message 2 of 13
(4,323 Views)

Hello smercurio,

 

thank you for your tip. I  did as you suggeste however the it now doesn`t react to cursor move by mouse.

 

Maybe, I understood "in your current "Cursor Move" event you will need to use the Value property for the controls" wrong. Did you mean just removing Cursor Move event and instead of it set "Value change" event?

0 Kudos
Message 3 of 13
(4,302 Views)

No, that's not what I meant. Attached is your original VI with the mod I was suggesting. A couple of notes:

 

  • There is no point in having a timeout for the event structure just to write the same data to the graph. I removed the timeout and created an event case for the Stop button.
  • I only implemented the handling of the frame control change.Trying to change the Cursor.PosY does not work, and I do not know why yet.
Message 4 of 13
(4,290 Views)

Hi smercurio,

 

your suggested mod works like a charm! Thank you for providing the VI example. I have already implemented it to my broader labview project.

 

I tried to modify it to too, adding another event "Load"-value change. Then I connected the control with property nodes as you did in "Selected frame"-value change, but didn`t work too. Handeling value between Move cursor - Load control works well. However, the rest of handeling chain doesn`t.

 

Thank you for your interest in my issue!

 

Martin

0 Kudos
Message 5 of 13
(4,269 Views)

Could you upload your edited VI?

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 6 of 13
(4,243 Views)

I attached the updated version on plotting_graphMOD and the broader project where I`m implementing it. Basic idea of the project is:

 

Select specific frame on Load-frame curve and then immediately show it next graph.

 

Finaly there is also raw data file that you need to load. Unfortunatelly, *.avi is to big.

Download All
0 Kudos
Message 7 of 13
(4,233 Views)

What exactly is not working?

The only advise I can give is to use the 'Value signalling' property in the 'Cursor move' event .

That will trigger the 'value change' event of the Load control.

However you will get a lot of events, maybe the 'Cursor Release' event is a better choice than the 'cursor move'.

 

Wait maybe I get the point, I think you can't do a Set Y-value of a cursor linked to a single plot. For some reason LabVIEW doesn't generate an error on such action (which it should IMHO, this is a BUG).

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 8 of 13
(4,224 Views)

"you can't do a Set Y-value of a cursor linked to a single plot" - you are right, that`s the problem!

0 Kudos
Message 9 of 13
(4,204 Views)

TonP wrote:

Wait maybe I get the point, I think you can't do a Set Y-value of a cursor linked to a single plot. For some reason LabVIEW doesn't generate an error on such action (which it should IMHO, this is a BUG).


Yeah, that's what I couldn't get to work in my example. I would agree that it looks like a bug to me. 

0 Kudos
Message 10 of 13
(4,160 Views)