LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Does subVI know which VI opened it?

I was curious if there is a way for a subVI to know which VI opened it.  I've got a subVI that compares some values and if not within tolerances, it writes an error string to a file.  The error string depends on which VI opened it.  I currently pass the string, but would like to add some more information which needs to be retrieved from somewhere else.  Since I'm using this across several projects, it'd be easiest if I knew which VI had entered the subVI and then took an action accordingly.  I could just pass an enum or something, but if I change something, I'd have to propigate it throughout.  Figured there may be an easier way??? 
0 Kudos
Message 1 of 4
(2,750 Views)
The easiest thing would be to make the enum a typedef. You could then change it and it will automatically update in any VI that uses it. To do this, right click the enum control and select advanced -> customize. At the top of this window you will see a dropdown box that says "control." Click this and change it to typedef. Save this control. Then you will have to replace any instances of the enum with the new typedef. After that, you can change the typedef and it will update all instances.

The other option is to use the call chain VI. This is located in the application control palette. It will give you a list of VIs in the order they were called to get to the current one. The first element is the current VI, the second is the VI that called it.
Message 2 of 4
(2,747 Views)
The function 'Call chain' listst the VIs to the top level.

Remember it doesn't lists above a dynamic call

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 3 of 4
(2,742 Views)
THANKS!
0 Kudos
Message 4 of 4
(2,736 Views)