LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatic annotation creation fails if too fast!

I have experienced an odd behaviour of LabVIEW when programmatically creating XY graph plots. Please read:

I have a vi with an XY graph. Subvis load data from files, generate suitable XY data clusters and appropriate annotations and add them to the XY graph. They do this using a strict reference constant to the graph which is passed in and manipulated using Property Nodes. The properties I am using are Value and AnnotationList. The first subvi passes the generated plot data into Value. The second vi passes the generated annotation data into AnnList. Now here's the problem. If I let this run, I get an error from the AnnList property node, complaining of an incorrect datatype. This is wrong, because the annotations are created using the actual LV annotation type definition. What I noticed was, if, for example, 30 plots were to be added, only the first 20 or so would successfully get annotations, and the remainder would not. Now get this - if I include a pause, or only 100ms, between the Value property node write and the AnnList property node write, everything works fine! If I take the pause out, some of the annotations fail to be created! With the pause included I can generate as many curves as I please (I've tested up to 180) and all annotations appear correctly. Without the pause, I can get only about 20 or so.

The error out from Property Value Write is fed into Property AnnoList Write, so I'm sure these are performing in order. So why should adding this pause influence whether or not annotations are created? Are the creation of annotations dependent on the update rate of the graph? For instance, when I ask for 36 plots, do only the first 20 or so manage to get drawn before the Property AnnoList Write performs, hence permitting the creation of only these first 20 (or so) annotations? If true, this could explain why a short pause, permitting the full plot refresh, influences the annotation creation.

Anyone seen this kind of thing before?

Thoric (CLA, CLED, CTD and LabVIEW Champion)


Download All
0 Kudos
Message 1 of 5
(3,091 Views)
It looks like the Annontation of graphs programmatically does take a certain length of time. The following thread discusses this fact, along with the improved performance of annotationList property over Cursors.
 
 
The thread also mentions an example 'Programmatically Annotate a Graph.vi' that may be of use to you.
 
Regards,
 
Dan - NIUK
0 Kudos
Message 2 of 5
(3,023 Views)
Thanks for your efforts Dan, you're the only person to care (it seems). Unfortunately, there's little value in your linked thread. It simply indicates the advantage of Annotations over Cursors. The shipped example "Programmatically Annotate a Graph.vi" also doesn't provide any insight I'm afraid. Looks like I'm stuck with this... Smiley Sad
Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 3 of 5
(3,011 Views)

Hi Thoric,

As a fellow user, I can say that "I care". Smiley Wink

Could you please post a simplified example that demos the issue and document which version of LV you are using.

An AE can verify the bug and get a CAR filed to correct it. I'd do this for you but I have to call in two other issues this AM.

Just trying to help,

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 5
(3,002 Views)
Hi Ben,

Thanks for showing interest! Smiley Happy
I've taken the sections of my code and put them into a new vi, and guess what - no bug!
So I gone back to my code and removed the delay I inserted between the Value and AnnoList property writes, and guess what - no bug!

This is driving me crazy. One day, an infuriating bug that takes up most of my working day to develop a workaround. The next? Nothing!

Why me? Smiley Sad
Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 5 of 5
(2,988 Views)