LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Annotation Label Offset Explanation

Your equations seem to work, but I noticed some odd behaviour when playing around with the vi. One, the annotation does not reliablely redraw itself when run; I had to scroll the screen after each run to see where the label would go. Also, at least once, the label didn't go where I expected it to until after I ran the vi a few times while also tweaking the numbers. I suspect there is some race condition in the annotation drawing code.

 

C

 

btw, I have not had an application with annotations since I was using 8.5, so I still haven't had an opportunity to test my old annotation creation code using 8.6. Did anything actually change with the update?

0 Kudos
Message 21 of 37
(2,321 Views)

Meghan, this bug does not appear to have been fixed with CAR4GIEK3TP in LV 8.6.1. I just played around with the example you posted, and following my own instructions I tested the vi. The very specific symptom of the problem disappeared, but it is not fixed. It appears that the annotation labels now correctly honor the y scale multiplier, but not the y scale offset or the x scales multiplier or offset. I had spent quite a bit of time fully characterizing the issue in a previous post, even including a vi that worked around the problem. I think someone should take another crack at this (and maybe review the material in this thread a little closer).

 

Chris

Message 22 of 37
(2,317 Views)

Hello Everyone,

 

I looked into CAR 4GIEK3TP.  The example VI that was submitted with this report is attached.  You can see that the incorrect behavior as you change the y scale mulitplier was fixed between LabVIEW 8.5 and 8.6.  This is why that particular CAR was marked as fixed.  I will look into the examples that everyone else has posted in the mean time.

 

Thanks for your input

Message Edited by Jon S. on 06-30-2009 08:17 AM
Regards,

Jon S.
National Instruments
LabVIEW NXG Product Owner
0 Kudos
Message 23 of 37
(2,291 Views)

Hello Jon,

 

By now I have made a 'repair' vi. This can be placed before the 'annotations write' property and recalculates the offset for working around the bug. When the bug is fixed this vi can easily be changed to an empty vi or such so existing code doesn't need to be changed.

 

I have tested this repair a lot these days and didn't find problems. The redraw issues in the previous example are caused by the vi itself (it modifies the scale settings and annotations in a undefined way).

 

I quickly replied to prevent unneccesary work for you as this is the best vi, I will now check your post in detail.

 

Kind regards,

 

Mark

---

25+ years long fan of LabVIEW. Move to Emerson looks to be for the better! See the last posts in subscription model thread.
0 Kudos
Message 24 of 37
(2,286 Views)

Hi Jon, thanks for looking into this. The VI you posted is exactly the one that I am referring to in my previous post. You will see that a y-scale multiplier is correctly handled now (as of 8.6), but an x-scale multiplier, or an offset for either scale will still break the annotations. Obviously, I don't know how the original CAR was written, but the problem with annotations was bigger than just handling y-scale multipliers.

 

In the example, changing the scale multipliers or offsets should have no impact on the position of the label with respect to the annotation point. A complete fix of the problem would produce that result.

 

Thanks,

Chris

0 Kudos
Message 25 of 37
(2,283 Views)
Just a a quick note to confirm that a bug is still present in the CAR example. When changing the offset the label position isn't correct. Tested on LV 8.6 on XP-pro.
---

25+ years long fan of LabVIEW. Move to Emerson looks to be for the better! See the last posts in subscription model thread.
0 Kudos
Message 26 of 37
(2,276 Views)

Mark, I was just playing around with your vi. I replaced the Annotation List with a Cursor List and dropped it into the example vi that Jon and I have been discussing. Your vi appears to correctly repair the xlabel offset, but it does not properly handle x or y scale multipliers on the graph. I am supposed to be working on a report (which means I am trying very hard to find other things to do), so I will spend a little time this morning to see if I can compenstate for all the factors.

 

Chris

 

 Cursor_Label_Offsets.png

0 Kudos
Message 27 of 37
(2,274 Views)

You are using the Vi in the intended way... maybe there is an difference between annotations and cursors.

 

In my case I use a graph with sampled data by time. The Y-axis has normal offset and multiplier. The x-axis maps a period.

 

I use the annotations to present the result of some vi while I move the cursor tool. It works without a glitch. Maybe it is caused since offset & multiplier are written at the same time (the race condition issue as in my previous example)?

 

You could try using a reference like I did...

 

Have fun writing your report 🙂

---

25+ years long fan of LabVIEW. Move to Emerson looks to be for the better! See the last posts in subscription model thread.
Download All
0 Kudos
Message 28 of 37
(2,271 Views)

Okay, so I didn't get much done on my report today. BUT, I do have a zip file full of examples (all in 8.6--they wouldn't work correctly in 8.5 anyway). I took all the example vi's from this thread and made them work with a "Repair Label Position" polymorphic vi (for different waveform graph references). This is based on my previous work and the "Repair Label Offset" vi that beuvink provided. I think I've handled most of the situations that mess up the label offsets. That is, calculate the label origin (you'd think it would be the annotation or cursor, but it's not) regardless of cursor/annotation mode, x-scale offset, y-scale offset, x-scale multiplier, y-scale multiplier, and choice of ignore timestamps?. Also, in theory this will handle multiple x or y scales appropriately. The polymorphic vi only includes two types, one for a single waveform waveform graph, and one for a 1D array of I32 waveform graph, but others can be added (remember to index out the correct plot if you use a type with more than one plot).

 

It's not the prettiest thing in the world, but it turns out there are minor differences between annotations and cursors, not to mention the mode. Hopefully this helps get the problem corrected in the future, and provides a workaround for anyone interested in actually using annotations or cursors programmatically on graphs with scaling.

 

There are three examples here:

1) Annotation Creation: this shows how to preempt the built in Create Annotation right-click and allow you to customize your annotation programmatically (not to mention put it on the graph where you clicked, instead of out in space somewhere).

2) Cursor_Label_Offsets: this is the example that NI created originally and was used to illustrate the problems with cursors/annotations labels. It's been modified to compensate for the problems.

3) Annotation and scale offsets3: this is the vi that beuvink put up to illustrate his problem. I just modified it slightly to demostrate that the Repair Label Positions polymorphic vi could be used to fix his issue too.

 

btw, Desired Label Offsets are in units of the current graph scale, so if you want the label to appear 25units above and .5 units to the left on a graph you would use [.5,25]. Also, I changed the input to the Repair Label Position vi from an array of clusters of annotations to a "Desired Parameters" array of clusters to prevent someone from running the Annotation List out of a graph property node and back in (which would cause all the labels to fly across the screen and out of sight if done repeatedly). Also the annotations list and cursor list are slightly different.

 

Chris

Message 29 of 37
(2,255 Views)

Hello Everyone,

 

I have reopened CAR 4GIEK3TP.  I edited the original code that was submitted to include controls for x scale mulitplier, x scale offset, y scale muliplier and y scale offset.

 

Thanks for the input.  Also thanks Chris for the example programs that provide a workaround.

Regards,

Jon S.
National Instruments
LabVIEW NXG Product Owner
0 Kudos
Message 30 of 37
(2,227 Views)