LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Plot Annotations from subVI

Solved!
Go to solution

Hi all,

 

I have subVI that adds plot annotations to a waveform however I am not sure how to make the annotations show up on the main vi program. How would I have the main program be able to see the changes happening to the subVI?

Teekayy_0-1706295203860.png

 

0 Kudos
Message 1 of 5
(532 Views)

Assuming your graph is in the main program, just wire a reference to it to the correct subvi connector.

 

Code looks a bit convoluted. Who wrote it?

0 Kudos
Message 2 of 5
(493 Views)
Solution
Accepted by topic author Teekayy

See if this can give you some ideas....

 

Here's the caller code:

 

altenbach_1-1706332810489.png

 

and here what's in the subVI.

 

 

altenbach_0-1706332744318.png

 

Message 3 of 5
(482 Views)

If I've de-funked it properly, this code does the same thing:

df.png

Message 4 of 5
(462 Views)

Still a bit funky, here's another way:

 

altenbach_0-1706371459239.png

 

It could be simplified even more if NI would have made the element (instead of the array!) a typedef. I NEVER EVER do typedefs of arrays, only of the element! Not sure what they were thinking. 😄

 

There is absolutely no reason to drag the plot data across the subVI unchanged, just to push the data back to the caller via a variant value. (bottom of your snippet) That makes absolutely no sense and is probably a leftover of some misguided ideas to solve the problem. For that reason, I eliminated all that.

 

Also, instead of two clusters, the subVI should be scalable with an input of an array of positions. Now if could be used with any number of annotations, not just three.. Here's how that could look like:

 

altenbach_1-1706372243824.png

 

0 Kudos
Message 5 of 5
(444 Views)