LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can a functional global be reentrant?

I am using a functional global to store values that are used through out my code.  These values can be updated and read by numerous VI's.  If the funtional global is set up as reentrant, can more than one memory space hold these values?  And are these these memeory spaces identical so that if one VI sets a value then another VI can read that new value?  Seems to me that LabVIEW would create a new memory space each time the funtional global is used and the data stored in the funtional global would not be the same for each thread.
0 Kudos
Message 1 of 3
(2,869 Views)
Noramally FG are not rentrant since re-entrancy is realized in LV by create a seperate code and data space for each instances.
 
If you use a template (.VIT) you can open as many as you want seperate spaces. Then all entities that need to access the data in the various instaces of that template can use the reference to one of those instaces to perfom Invoke Node call by reference.
 
Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 3
(2,866 Views)
You can also use the method Ben mentioned just by having the subVI reentrant, which has some advantages. Just be sure to set the flags on the Open VI Reference function to prepare for reentrant execution (8 or 2, I can't remember). You can then use the reference to work on a specific instance.

___________________
Try to take over the world!
0 Kudos
Message 3 of 3
(2,845 Views)