LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Global, local variables in SubVI's

Hi,

I'm having a problem with what is probably a 'feature' of labview
(using ver 6.1).

When running multiple SubVI's of the same type, any local variables
declared within the SubVI are globally scoped across all instances of
that SubVI within one VI. Is there any way to prevent this?

I am trying to store the Status of the SubVI in a local, but obviously
each instance of the SubVI ends up with the same status. Currently i
have solved this by having exact copies of the SubVI for each
instance, but obviuosly as far as labview is concerned they are now
different SubVI's, i consider this a bit of a hack and would rather
avoid it.

Any pointers?

Many Thanks,

Ed
0 Kudos
Message 1 of 2
(2,601 Views)
If you make the sub-VI reentrant, you will get the type of local you're looking for. On the sub-VI's menus, goto File >> VI Properties >> Category >> Execution >> Reentrant Execution.
0 Kudos
Message 2 of 2
(2,601 Views)