LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

annotation X position, what am I doing wrong

Hi Aaron,

Very interesting.  Yes the behavior you see in LV 2009 is the behavior I would expect.  Just to make sure, you also modified the x multiplier in the 2009 code, in addition to hard coding the label offset to 0?  We have been planning an upgrade, I think we may sooner than later.   I have been putting it off because I hate to upgrade in the middle of a project with a deadline, but this has to do with data gathering and the usefulness of it, so it's a must if it indeed fixes my issue.  I can post back here once that upgrade is done, and I'm able to run.  Thanks for looking into this.

 

Regards,

David Jenkinson

0 Kudos
Message 21 of 38
(1,909 Views)

Hi David,

 

Aaron is out of the office at the moment, so hopefully I can help.  I just tested the example ( Programmatically Annotate a Graph_snglplot.vi ) that you attached earlier, which has both a hard-coded label offset and an X scale multipleir control which I set to .05 and yes, in LabVIEW 2009 the min label appears directly over the minimum point rather than having an arrow pointing.

 

You can download and install LabVIEW 2009 and it will be fully functional for 30 days, after which it will require an activation code.  You can use the trial period to ensure that the upgrade does, indeed, perform as you expect before deciding to purchase it.

 

I hope that answers your question.  Let me know if I can be of any further assistance.

 

Eric V
National Instruments
Applications Engineer
Certified LabVIEW Associate Developer


"I'm a Ramblin' Wreck from Georgia Tech and a helluva (NI Applications) Engineer!"
0 Kudos
Message 22 of 38
(1,891 Views)

Enriquito,

Thanks for checking that out.  We have actually purchased a volume license agreement, just have not had a chance to install the latest version, but plan to ASAP.

 

Thanks,

David J.

0 Kudos
Message 23 of 38
(1,875 Views)

Hi,

So I have installed lv2009 fully, and initiated another automated test run, acquiring data at 20hz, and hardcoding the annotation label x offset to 0, x.multiplier at .05.  The annotations behaved as expected for approximately the first 13 hours, then started behaving unpredicatably.  I unfortunately have lost the annotation data for this run due to a different issue, but I am initiating another run so I can point you to some data.  I am also going to finish the standalone vi, which I will post on this forum, once I finish upgrading my desktop to the latest release of labview.  One thing I did notice though, is in the annotation data, the x and y label offset are not 0, as assigned in my code, but some other small value that is seemingly random.  I will illustrate in detail once this run is complete, and I can post my sample vi.

 

Thanks

David Jenkinson

0 Kudos
Message 24 of 38
(1,853 Views)

Hi,
Though the annotations under labview 2009 have behaved 99% of the time since my upgrade, I have just been able to duplicate what I saw in my last post, this time with data.  I have not been able to duplicate the issue on full runs or with a debug routine since a couple weeks ago.  But on the latest run, after running for the last few days, I went to reload the tdms file to look in more detail at the data.  When I did, I noticed the annotations were way off to the right at the beginning of the run, which strangely enough, do not appear that way in the graph where the data is being acquired.  This time I have been able to save some data for you to analyze. 
So a little more info, my routine is saving the annotations to the tdms file itself, using "tdms set properties", where the group is "AnnotationArrayElementX", and the property names and property values are associated with "index", "name" etc.  When we want to look at the data to post analyze, the standalone routine then reads these annotation groups and re-populates the annotation array, so they will display.  To make sure this was working correctly, I copy pasted the annotation array from the vi which wrote the tdms, and the vi which read the tdms.  I see the annotation data as being exactly the same, and I have attached vi which contains both arrays.  But what is very strange is, notice the label offset X and Y.  They are not 0 and 100 as they are being set in my vi.  To start off with, X is a very very large integer, and Y is something other than the hard coded 100 by some small amount.  And correspondingly, the annotations appear way off to the right, although they do not appear this way in the vi which wrote the annotations (?!)).  When the annotations begin to behave later on in the run (yes they do correct themselves), the X offset goes back down to some small number, as you can see in the arrays around element 124.  This change to a very small value corresponds to the appearance in the graph, where they seem to straighten out, from being pushed way to the right initially. 
So there is some calculation going on with the label offsets behind the scenes, which under certain circumstances, causes a very large integer value to be stored to the X offset, instead of 0 (or a very small number, which I am not sure how that is being generated). 
You can run the attached vi, which is a simulation of what I am doing in the full run.  It is just placing an anotation every 2000 samples.  Take a look at the label offset number in the annotation array after the annotation is placed, and you will see it is some number other than 0, which under certain rare circumstances, is a very large integer.

 

Info on the attachements:

GraphFileSave.png - This is a screen shot of the graph as it appeared in the vi which wrote the tdms file, containing the annotation data.

GraphFileLoad.png - This is a screen shot of the graph as it appeared in the vi which read the tdms file.

Graph_when th ings got better.png - A screen shot of the graph at the point where suddenly the X offset values in the annotation array went from a very large integer to something very small (other than 0 however), around 16 hours into my test.  FYI, the previous run where I posted I was not able to get detailed data, was the opposite.  That is, it started out ok, then 13 hours into the run the annotations went way to the right.

Annotations.vi - This contains the arrays which I copy pasted from the vis which wrote and loaded the annotation data, and they are so named with their control labels. 

Annotation debug routine for NI.vi - The stripped down version of our standalone vi, all non-applicable code either removed or disabled.

The tdms file itself is 18mb, which I assume I cannot attach here, but perhaps I can compress and try if you would like to look at that as well.

So though the problem is much better, this is hit and miss enough where it is effecting my data gathering in a very negative way.  Can someone please take another look at this?  Again I am indeed running LV 2009 now.

Thanks
David Jenkinson

Download All
0 Kudos
Message 25 of 38
(1,786 Views)

Hi,

I seem to still be observing the same strange behavior, please see attached.  These are screen shots of the same tdms file, one at the beginning of the test run, the other at the end.  Somewhere along the way the annotations go haywire.  It seems to be intermittent from file to file, and I'm not sure the rhyme or reason how or why.  I am hard coding all the label offsets when storing the annotations, X=0 Y=100.  

 

As I mentioned earlier in this thread, when storing the annotations, I am only setting the index, and label offset x and y.  Labview seems to be doing some calcuations for the position X and Y.  Also there is apparently something going on behind the scenes in re-calculating the label offsets, because they are never quite exactly 0 and 100 for x and y respectively, when looking at the annotation information after they are placed.  They are random values above and below these values.  In my previous post, I attached a vi which contains the annotation array information, which illustrates what I'm talking about.  

 

The annotation information which I use to re-populate the annotation array upon reading the tdms file is actually stored in channels in the tdms file itself.  If you like I can attach the tdms file that is show in this example, but it is 10mb zipped.  

 

Please let me know what I can supply to help with taking a look at this.  I am now using LV 2009, but the problem still seems to be present, making it difficult for us to use the annotation information for post processing.

 

Thanks

David J. 

Message Edited by david_jenkinson on 11-18-2009 12:53 PM
Download All
0 Kudos
Message 26 of 38
(1,649 Views)

Hi David,

 

Unfortunately, if this doesn't consistantly happen, it'll make it hard to reproduce and to figure out a work around. Since it doesn't happen all the time, I'm tempted to say that there may be a race condition some where. Does this behavior only happen when you run your program for very long periods of time?

0 Kudos
Message 27 of 38
(1,614 Views)

It does tend to happen on long duration runs.  I've attached a screen shot of a test that ran for approximately 35 hours. 

 

I have attached a small vi, which contains the annotation array, writing them to the graph.  There are 308 annotations, which were written hard coding the X offset to 0 and Y label offset to 100.  If you will notice, the X and Y label offsets are never set to 0 and 100 exactly, there are offset by some random amount.  This is a calculation happening behind the scenes for purposes unknown, immediately after writing the annotation element via property write.  Also notice, at element 150 X label offset is actually a very large negative integer.  All of the problem annotation labels correspond with an annotation label that has a very large negative offset.   But when I put in some code (attached) to correct the strange X  label values and put them all back to 0 (as they were written in the first place), things look correc.  Shouldn't the label offset values just be set to exactly what they were written to in the first place?

 

To review early in this thread, when I am writing the annotations, I am writing the index, and X and Y label offsets for each annotation I create, that is it.  I've attached a screen shot of that code There are some calculations, IMO incorrect ones, going on behind the scenes that are re-writing the X and Y label offsets.  

 

I have a workaround whereby I am just setting the X offset back to 0 when reading, but really would like to see this corrected in case I want any custom X label offsets in the future.  I would lose this customization by setting everything back to 0 again.  

Download All
0 Kudos
Message 28 of 38
(1,554 Views)

Hi,

I have just installed labview 2010, and things went a little nutty when running our test afterward, with the annotations.  Basically, under lv 2010, all the annotation labels (not the annotations themselves) walk off the left side, though their location remains correct.  Something changed in a not so good way.  Please take a look at the attached vi, and run it under both lv 2009 and lv 2010 for an example of what I am talking about. 

If I set the graph multiplier to 1, the problem disappears.  But we are setting the x axis multiplier to display the time correctly, because we are acquiring at 20hz.  So it is a bug with displaying the annotation label when the xscale.multiplier of the graph is anything but 1.

0 Kudos
Message 29 of 38
(1,252 Views)

Here is a extra file need to run that annotation debug routine

0 Kudos
Message 30 of 38
(1,228 Views)