01-26-2024 12:55 PM
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?
Solved! Go to Solution.
01-26-2024 10:52 PM
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?
01-26-2024 11:20 PM
See if this can give you some ideas....
Here's the caller code:
and here what's in the subVI.
01-27-2024 05:28 AM
If I've de-funked it properly, this code does the same thing:
01-27-2024 10:18 AM - edited 01-27-2024 10:19 AM
Still a bit funky, here's another way:
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: