Overview:
This demo uses a Functional Global Variable (FGV) to communicate with a subVI.
Description:
The main VI launches the subVI using VI Server. It then writes a value to a FGV.
Requirements:
Steps to Implement or Execute Code:
Additional Information or References
"**This document has been updated to meet the current required format for the NI Code Exchange.**"
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
Is this also possible if I start the subVI from an external packed library? It tried and it started, but tranferring data from MAIN to SUB (which comes from packed lib) did not work.
The problem you will run into with the PPL is that the PPL has its own copy of the FGV. Therefore, you will not be communicating between a VI outside of the PPL and one inside of the PPL.
There are much better ways to pass data around than with a FGV. Even a simple Global Variable I would argue is better than this implementation of a FGV (only Set and Get states). See this article for more information about what I'm getting at: A Look At Race Conditions.