07-25-2019 05:24 PM
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?
Solved! Go to Solution.
07-26-2019 01:18 AM - edited 07-26-2019 01:19 AM
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…
07-26-2019 02:46 AM
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.
07-26-2019 07:44 AM
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?
07-26-2019 07:48 AM
"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.
07-26-2019 07:54 AM - edited 07-26-2019 07:54 AM
07-26-2019 08:11 AM - edited 07-26-2019 08:12 AM
@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:
07-26-2019 10:28 AM
Thanks, wiebe, that helped. It now works perfectly.
Thanks for the other input, as well.