LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Cursor control

Solved!
Go to solution

I am trying to write a VI (LabVIEW 2017) to replace some ancient and buggy software.  I have a graph with two cursors, each tied to a data set.  I would like the users to be able to set the X-coordinate (Frequency) to move both cursors horizontally, and have the VI display the two corresponding Y-coordinates.

 

Displaying the Y-coordinates works correctly, but the control for the X-coordinate does not seem to move the cursors.  This is my first time using property nodes, unbundling/rebundling, and the like, so it's been a "learn by example and try to figure it out" type of experience.  I have tried a couple different variations of the VI shown (e.g., one "read" property node and one "write" property node), but they seem to show the same behavior.

 

Any help or insight is appreciated.

 

Incidentally, I haven't been able to find a way to change the size of the cursors, either.  Do X Scale and Y Scale do this?  Or are we just stuck with tiny cursors?

0 Kudos
Message 1 of 8
(2,718 Views)

Hi Fear,

 

but the control for the X-coordinate does not seem to move the cursors.

When the cursors are connected to a plot then they only move from sample to sample of the plot. You cannot move the cursors by randomly choosen "frequency" steps…

 

I haven't been able to find a way to change the size of the cursors, either. Do X Scale and Y Scale do this? Or are we just stuck with tiny cursors?

When the cursors shoul dmove along the X axis I would choose a vertical line cursor.

Just see the cursor legend for the possible options… (There also is a list of cursor properties.)

 

Btw. why do you need so many ExpressVIs and DDT wires? Especially for that simple IndexArray operation…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 8
(2,662 Views)

That feedback node is wrong.

 

The fist iteration, the data from the feedback node is empty. And you put that result in your property node, effectively clearing the cursor properties. Then you read the empty list, and change the Y of each element (0 in total) and set it again the next iteration.

 

Ditch the feedback node. Read the cursor properties, change them and write them. No need for a previous value mechanism such as a feedback node.

Message 3 of 8
(2,650 Views)

That makes sense.  That was the only way I could figure out to write to the X position property, though.  Do you mind walking me through how to read one property and write to another properly?

0 Kudos
Message 4 of 8
(2,634 Views)

"You cannot move the cursors by randomly choosen "frequency" steps…"

Will it work as long as the value corresponds to the x value of one of the data points (give or take a bit or so)?

If not, I could calculate an index, if I can move the cursor that way.

0 Kudos
Message 5 of 8
(2,628 Views)

Hi Fear,

 

how to read one property and write to another properly?

Use wires - and 2 property nodes:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 8
(2,624 Views)
Solution
Accepted by topic author DoctorFear

@DoctorFear wrote:

That makes sense.  That was the only way I could figure out to write to the X position property, though.  


I'd skip that altogether:

Cursor position.png

Message 7 of 8
(2,612 Views)

Thanks, wiebe, that helped.  It now works perfectly.

 

Thanks for the other input, as well.

0 Kudos
Message 8 of 8
(2,594 Views)