08-21-2009 03:55 PM
08-21-2009 03:56 PM
Also here are a couple images of the code for each case....
Thanks
David J.
08-21-2009 05:03 PM
08-21-2009 05:21 PM
08-21-2009 05:44 PM
I am using LV 8.5.1. Take a look at the attached image "Graph Display - Zero as X offset.png". That is what I am seeing when I use 0 offset for x. What are your other annotation settings? I attached another image "annotation defaults.png", and am only programmatically changing the X and Y label offset, index, visible, and name from those defaults (see the LV diagram image "Code - Zero as X offset.png"). I am changing the y offset to 100 also, to get the text a little above the annotation away from the data so the arrow can point down to it.
I'd be interested in knowing what default annotation settings you are using. Is it possible to post an image of your default settings?
Thanks
David J.
08-21-2009 06:22 PM
08-24-2009 12:03 PM
Very weird. When checking the content of 2 annotations themselves after inserting them with a label offset X of 0 and Y of 100, The annotation offsets in the annotation list are mysteriously changed to:
Label offset X,Label offset Y
3.48471,100.618
-5.49587,100.214
And the appearance is the labels are railed up against the left of the graph, with the annotation itself properly placed.
I did discover something though. In my graph, I am setting Xscale.Multiplier to .05, because we are acquiring data at 20Hz. When I hardcoded the multiplier to 1, annotations begin behaving as expected, with them perfectly aligned above the annotation. So there is an interaction with Xscale.multiplier and Label Offset x which I can't seem to figure out the rhyme or reason. I see there is a Xscale annotation property, but it takes only integers, and when I try to set it to 20, I get an "out of bounds" error of some sort. I am thinking this may be time to call support.
08-24-2009 12:39 PM
I have always scaled the data instead of the axis, which you could probably do. Just for fun, try the following:
Label Offset.X = Index * (1 - Xscale.Multiplier)
08-24-2009 01:22 PM
Very interesting Darin, I think you may have hit on something, although I am a bit confused as to why. Can you explain? I had previously hardwired the x offset to the index, but did not subtract from 1 first. It appeared to work ok at first, but I got the effect of the annotation slowly walking off to the right over a very long duration (24+ hours). I am going to run my long test to make sure the annotations behave with this new method. Thanks very much for your input.
I have also opened an issue with phone support and am interested what they have to say.
Regards,
David J.
08-24-2009 01:43 PM
I wish I could tell you that I applied my LV Ninja skills and immediately struck upon the answer. However, it was more of a SWAG (stupid wild-a* guess). I knew the index was involved from your original picture, but there was still another number in play. I have never scaled an axis, so that didn't occur to me until you mentioned 0.05. At that point I figured the offset was either 0.95*Index or 1.05*Index and the original picture showed that 1.0*Index was too much, so it had to be 0.95 or (1 - 0.05)*Index.
Probably not the intended behavior by NI, just one of those cases they missed until now. Fortunately in this case there seems to be an easy work-around.