01-29-2011 02:47 PM
I have a XY graph in the front of my Panal with 2 active cursors. I have also enabled the Anotation option. Is there anyway to distinguish between the cursers in an even structure. Currently when any of the cursors are moved the even structures fires.
Thank you
Solved! Go to Solution.
01-29-2011 08:26 PM
You just have to read the CursIdx event data node on the rifgt side of the event structure.
02-01-2011 04:06 PM
Thanks for the response.
I diduse the CurserIdx but both the curser and the first Annotatioin have the curserId of 0.
Any Idea if I'm doing something wrong? it looks to me that Labview starts IDing the cursers with 0 and also the Annotation as 0. Basically it acts as if they are different classes but at the same time it uses both as curser
02-01-2011 04:14 PM - edited 02-01-2011 04:15 PM
Yes, when any of the cursors are moved, and you have a cursor move event for that graph, the event will fire. As Dennis said, you can read which cursor got moved and act accordongly. For example use a case structure that executes an empty case if an undesired cursor got moved.
It would help of you could attach a simplified version of your program so we get a better idea what you are trying to do.
02-01-2011 04:42 PM
Unless you have been bitten by this behavior, you may not realize that BOTH cursors and annotations will fire cursor move events. CursIdx will return either the annotation or cursor index. A workaround is that the Cursor Grab? event will only fire for actual cursor grabs, so I add a shift register and wire a True constant out of the Cursor Grab? event. In the Cursor Move event I can use the boolean to determine if it is annotation #CursIdx or cursor #CursIdx which is being moved.
02-02-2011 12:56 PM
Thanks Darin,
I wasn't aware of this, possibly because I don't really use annotations, and if I do, they are placed programmatically. If you don't "allow drag" for annotations, the problem cannot occur.
Still, this is an unwelcome entanglement between cursors and annotations. Maybe we should write up an idea to suggest that annotation events and cursor events should be treated seperately. 😉
02-02-2011 01:03 PM
@altenbach wrote:
Maybe we should write up an idea to suggest that annotation events and cursor events should be treated seperately. 😉
02-02-2011 02:24 PM
@altenbach wrote:
@altenbach wrote:
Maybe we should write up an idea to suggest that annotation events and cursor events should be treated seperately. 😉
Kudoed, although I consider this behavior to be a bug (use of word "bitten" was no accident). The fact that the Grab and Move events have different behavior is certainly an indication that this was unintended behavior. Fortunately, it is this difference which allows a workaround.
I ran into this once when I was assisting with an annotation issue, would never have run into it myself. Not like I don't have enough problems of my own...
02-03-2011 10:15 AM
I took a look at your code and it looks like you may be right, that this is a bug. This was reported to R&D (#283714) for further investigation.
I have also attached your workaround and this forum post to the corrective action request, so applications engineers will be able to solve this problem for their customers if it comes up again.
Thank you for the feedback, and great work in figuring out that workaround!