LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why do graph cursors sometimes NOT appear in the location that I assign them to?

Attached is a VI with an FFT plot with 6 cursors that need to be set programmatically. The user inputs the frequencies in the first array telling the cursors where to be placed in the plot. The VI places the cursors in the nearest frequency bin to the frequency specified, then reads back the precise location. This location that is read back is always correct. However, the cursor does not usually appear in that exact location!! If you zoom in on a cursor that appears to be off a little, then run the VI, the cursor will then move to the correct place, provided you are zoomed in enough. This seems to be incorrect behavior. How do I resolve this?
Download All
0 Kudos
Message 1 of 11
(3,297 Views)
the cursors were shown correctly on my machine. Have you tried to restart labview or even windows (if your os is windows)?

-Joe
0 Kudos
Message 2 of 11
(3,297 Views)
Yes, I have tride both many times. I actually get the same result on a machine with an evaluation license installed! You have to look very closely to see that the cursor is not in the correct location. Run the program and then zoom in. It will be close, but not exact. Keep that zoom and then run again. The cursor will move a second time!

The most obvious one is the left most blue cursor. After the first execution it appears at about 2.95MHz (after executing under the default zoom).

Do you see it now?
0 Kudos
Message 3 of 11
(3,297 Views)
I played with the VI in LabVIEW 7.0, and I see the error you describe. I double checked your logic and it was ok. I think the problem has to do with a corrupted xy graph. When I placed a new xy graph the cursors worked just fine. At least they worked with the settings the default graph uses.

I recommend seeing if the behavior persists in a new xy graph. If not, make the new graph look like the old one and remove the old graph from your VI.
Message 4 of 11
(3,297 Views)
I just tried you suggestion. To show that it does not work, I have attached new VIs, this time with the data I need to mark. That way, a new graph can be placed to show it does not matter if a new one is there.

I did find that if I looped the attached VI, saw the right 2 cursors not in the correct place, zoomed in on them, then zoomed out by manually entering 0 and 10 on the x-axis, the stayed in the correct place!!! This is true even if I stopped the VI and started it again. Next, I enter NEW numbers in the array input, and the cursors again have the same problem!!

Does anyone else have additional ideas?????
Download All
0 Kudos
Message 5 of 11
(3,297 Views)
Did you try initializing the cursor list first?

-Joe
0 Kudos
Message 6 of 11
(3,297 Views)
I think that you may be running into a bug with the xy graph. I have not been able to isolate the problem. There is a solution however. I found that if you set the cursor to be free and not snap to point, your code works fine. (right click on the graph >> visible items >> cursor legend. Click on the padlock icon on the right side of the legend and choose free.)
0 Kudos
Message 7 of 11
(3,297 Views)
Ok, I just did and added it to the attached VIs. No difference, unfortunately.

Any other ideas? This whole thing makes no sense! Could someone from NI comment?????
Download All
0 Kudos
Message 8 of 11
(3,297 Views)
Yes, it does work when "snap to point" is disabled! It does indeed look like a bug to me. I guess I will get by with it that way, but would like NI to fix it! Thanks for the help!
0 Kudos
Message 9 of 11
(3,297 Views)
Hi all,
I also found out that it works properly only if you set the cursor lock state to free, as Jeremy stated.
But the problem is even worse: try to set only the X position of the cursor in lock to plot or snap to point state...
Take a look at this small example!
I got the same problem with LV 6.1, and obviously only with XY graphs.
Alberto
Message 10 of 11
(3,121 Views)