LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Annotation Label Offset Explanation

Can someone please explain the Label Offset property of the Annotation List (or Cursor List)? I can't figure out what the offset is relative to, or how it's magnitude seems to change with the location of the annotation. There is obviously something I am not grokking about it. A negative Y Offset can result in a label above the annotation point, and the same offset values will change the distance of the label from the annotation point depending on the placement of the point on a plot.

This could lead me into a rant about the partially completed feature that is annotations, but I'm too tired to go into it.

Thanks,
Chris
0 Kudos
Message 1 of 37
(5,885 Views)
The X and Y Offset values for the Annotation List Property node should increment one unit up when Y is set to 1 from the original position, and should decrement by 1 when Y is set to -1, and so on.  It should be moving this amount from the position defined by the X Position and Y Position properties of the Annotation List property node.  If you are experiencing different behavior, you might be using them incorrectly.  Please view the attached example and try incrementing and decrementing the Average Annotation in the X and Y direction.  Let me know if you are still having difficulties using this feature, thanks!
0 Kudos
Message 2 of 37
(5,851 Views)
Meghan, thanks for the example. I guess for a simple free annotation like the "Avg" in your example, things make some sense. The position elements locate the annotation point in unscaled units of the axes. The Label offset is in the same units, and is the offset from the annotation point.

The problems seem to appear when I use an annotation that is snapped to a plot, particularly if one of the axes has some scaling associated with it. I'm not sure what the behavior is when that is the case. I am still experimenting with this, but in my application, when I create an element in the Annotation List that is snapped to my plot, the position and label offset parameters seem to get set arbitrarily after I write it into the property; i.e., I can write the appropriate index, the actual position of the point (after taking into account scale multipliers and offsets), and a label offset of 0,0. I would expect this to create an annotation on a plot at the index I specify, with the label sitting right on top of the point. What actually happens is the annotation point seems to be locked to the correct point on the plot, but the position gets changed to something (I have no idea what), and the offset is also changed randomly. It's not really random, because I always seem to end up with the annotation label somewhere off the display, and almost straight up from the point.

I will try to make a stipped down version of my program and post it so you can see what I am talking about. Who knows, I may find the problem in the process..

Thanks,
Chris
0 Kudos
Message 3 of 37
(5,833 Views)
hi i want help
i have project  for (( Remote On-line Monitoring of Temperature ))
pleas  if any body have some onformation  pless send to me
 
and i want  know how Temperature measurement application on LabVIEW by VI
0 Kudos
Message 4 of 37
(5,828 Views)
Here is a simple program that displays a graph, and allows you to create annotations by right-clicking on it. The built-in function is superceded by my simplified create annotation vi with tries to create an annotation that is located where you clicked (anyone else tired of having to hunt down annotations placed randomly--typically off screen..) and with some defaults (snap to plot, color = red...). I discovered that when set to snap to plot, it doesn't seem to matter what I put in for position or offset, it just does what it wants. I should point out that the graph has a multiplier of 22+ applied to the y scale. This vi was created in LV8.5.

What you'll find is that if you create annotations on peaks, the labels will be off the graph display. If you create an annotation at a trough, the label will be visible. It seems to me that somehow the y-axis scale is not properly being accounted for, and since it ignores what I tell it, it's hard to account for.

Chris
0 Kudos
Message 5 of 37
(5,826 Views)

Hi Chris,

I ran your VI and I was able to successfully create annotations where the label was displayed on peaks.  Is there something that I missed?  I ran this in LabVIEW 8.5.  I attached a screenshot of the VI I worked on.  Let me know, thanks!

0 Kudos
Message 6 of 37
(5,798 Views)
Huh. When you created the annotations, did you right-click on the peak so that it popped in right there, or did you have to move the annotations after the fact? This is a bit of a mystery for me.. still, what is the significance of the Label Offset #s. In the screenshot you posted, the first annotation has a Label Offset of -2.24646.. in the y direction. Granted, the "..E-21" or whatever maybe cut off from display in the indicator, but even so, Cursor1 is clearly located above, not below, the annotation coordinate. I'm hard coding the offsets to 0,0 when the annotation is created, and that is obviously not being used.

Also, I'm running mine in XP. Here's what it looks like on my machine.

Thanks for your help,
Chris




Message Edited by C. Minnella on 12-06-2007 02:21 PM
0 Kudos
Message 7 of 37
(5,783 Views)

Hi Chris,

The offset X and Y values represent the coordinates of the front panel; they are unrelated to the x and y axis scales.  The origin is where the cursor is pointing to.  You can change the length and direction of the cursor by left-clicking the annotation when the VI is running.  I would suggest moving this around to see the offset values displayed at different angles and different lengths.  This will give you a feel as to how the coordinates are displayed.  If you move the annotation (cursor) to the left of the origin, or below it, the X or Y offset values will be displayed as negative values. 

I was encountering the same issue as you had described, where creating a cursor on a peak forces the cursor to be so long that it is not on the graph.  It seems like LabVIEW adjusts this length based on the coordinate that the cursor is pointing to.  I would recommend creating the cursors on the lower points of the graph, and then moving them to the desired location.  You can then left-click on the annotation to change the length or direction.  Thanks Chris!

0 Kudos
Message 8 of 37
(5,756 Views)
Ok, I finally figured out how to control where the annotations labels are placed. I am pretty sure this is a bug, because it makes no sense.

I think it should be safe to assume that the annotation label offsets are with respect to the location of the annotation point. Sadly, this is not the case, except in the trivial situation where the scale multipliers are 1 and the offsets are 0.

Here is a example vi which demonstrates how to place customized annotations that are snapped to a plot at the location clicked when you right-click to select "Create Annotation". There is a subvi called Create Annotation that does the work, and is suitable for inclusion in other apps. An image of the block diagram is shown below.

For those that are curious, here are the equations that determine the location of the origin that the annotation labels are relative to:

Actual Offset Origin = scaledPosition * scaleMultiplier + scaleOffset

Origin Offset = ((scaledPosition -scaleOffset)/scaleMultiplier) - scaledPosition

where scaledPosition is the x or y position as seen in the annotation list element (this is in scaled axis units)
and Origin Offset is the offset from the actual origin required to place the label at the location of the annotation cursor (i.e., where you'd expect the origin to be)

You can see that for both of these equations, the trivial case (0 offset and 1 multiplier) produces the expected output:
Actual Offset Origin = scaledPosition * (1) + 0 = scaledPosition
Origin Offset = ((scaledPosition - (0))/1) - scaledPosition = 0

The vi's are saved in 8.5. I expect this bug to be fixed at some point, at which time my vi will really munge up the placement of annotation labels. Be WARNED.





Message Edited by C. Minnella on 12-14-2007 05:13 PM
Download All
Message 9 of 37
(5,712 Views)
Hi Chris,
 
This "bug" that we are seeing seems to be specific to your application.  I created a very simple VI, which writes a sinewave to a waveform graph, and uses the cursor list to control the cursor properties.  You can adjust the cursor offset by changing the last 2 numeric constants within the cursor list cluster on the block diagram.  As you can see, the x and y values correspond the the x-axis and y-axis.  If you change the y offset to .5, it places the cursor label exactly .5 units above the cursor. 
 
I would have to look further into your application to find out what you are doing differently, but I thought that you might be interested in seeing this example.  Let me know what your thoughts are, thanks Chris.
0 Kudos
Message 10 of 37
(5,675 Views)