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)