LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

property node incorrectly placing cursor

Solved!
Go to solution
I have a VI in which I am trying to programatically place a cursor on an XY graph.  It is consistantly placing it slightly off position.  In the code snippet you can see that both the value in the indicator and the cursor.posX are coming out of the same index array.  The values in the x axis of the graph are the array feeding into the index array.  I also checked the representation of the indicator as well as the cursor legend, and all are doubles.


Message Edited by lmtis on 07-08-2008 02:13 PM
Jim

LV 2020
Download All
0 Kudos
Message 1 of 22
(5,606 Views)
We need to see the full code. Can you simplify it to the essential problem, add some typical data as diagram constants (or default values), and attach it here.
 
Why isn't the cursor positioning part of the first property node?
Is the cursor locked to a plot that has fewer points than the solid line?
0 Kudos
Message 2 of 22
(5,592 Views)
I moved the cursor positioning as part of my troubleshooting when I couldn't think of anything that actually made sense.  I don't follow the solid line question, but here is the essential part of the code.
Jim

LV 2020
0 Kudos
Message 3 of 22
(5,585 Views)
This code fixed it:

Don't know why but it does.

Ton


Message Edited by TonP on 07-08-2008 10:03 PM
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 4 of 22
(5,577 Views)
Ton's solution fixes it, but there is clearly a bug. There should be no need to assign a plot, because this is already assigned. Also, if you manually move the cursor to the real minimum, it stays there when you run the VI.
 
I would also disable autoscale for X (even though it does not matter here).
 
Here's an alternative:
If you create a free cursor instead of one that is locked to a plot, and set x and y, it works fine:
 


Message Edited by altenbach on 07-08-2008 01:19 PM
0 Kudos
Message 5 of 22
(5,567 Views)
Odd.  It (Ton's solution) didn't help on mine.  I'm using LV7.1 and XP.  I also opened it with LV8 and trie that modification with no improvement.


Message Edited by lmtis on 07-08-2008 03:21 PM
Jim

LV 2020
0 Kudos
Message 6 of 22
(5,564 Views)
I think it is a coincidence that Tons solution worked for him. It shouldn't. And it did not work for me either!
 
I reported it in the bug thread. Hopefully we get a CAR.


Message Edited by altenbach on 07-08-2008 01:29 PM
0 Kudos
Message 7 of 22
(5,556 Views)
Solution
Accepted by lmtis
To set the position of a cursor that is locked to a plot, you should use the "cursor index" property. It works fine here. Try it!
 
Here's a draft of your code:
 


Message Edited by altenbach on 07-08-2008 01:37 PM
Message 8 of 22
(5,551 Views)
You're right, index works fine (at least on LV8 on my home PC - I'll test on LV7.1 tomorrow).  I know that I tried that, but I guess that I must have wired the wrong index to the property node.  Thanks for your help guys.
Jim

LV 2020
0 Kudos
Message 9 of 22
(5,525 Views)
The behavior of Jim's VI does seem buggy.  However, I have had some trouble re-creating this issue from scratch.  I will keep playing with this, but in the mean time has this been recreated by anyone?  It could be that this behavior only happens after some other property has been written to on a previous run of the VI.  There have also been some recent (7.x-8.x) changes to the properties available for the Cursor.  This may come into play here..

As I said, I will continue to look at this, but would appreciate any other input! (If my guess about already changed properties is correct, then it may be difficult for me to find the right one to recreate the issue without any suggestions).
Brian A.
National Instruments
Applications Engineer
0 Kudos
Message 10 of 22
(5,485 Views)