Sure, I can do it by using functional global variable(FGV). At the very beginning of the code, I read the state(booleans, nemeric values, etc.) from FGV and wire the data into shift register in Facade.vi. After while loop terminate itself, I write the data into FGV and I can reuse it next time.
But there is a problem when I use multiple instances of X Control in a VI instead of single instance. The Non-reentrant FGVs used by different instance of X Control share there common state.
Is there a way that I can keep internal states independently from instances of X Control?
Thanks for any help.
Here is my colleague's answer. He actually keeps internal states independently from instances of XControl.
He uses FGV but one shift register contains VI clone name and the other one contains array of cluster(states) of XControl instance respectively. The FGV is still Non-reentrant and multiple instances use a common FGV. When one of instances want to read its own states, it just passes its VI clone name into FGV and then FGV gives it states according to VI clone name. In the other hand, if one of instances completes the works, it passes its VI clone name and states into FGV after terminates while loop. The FGV will stack VI clone name and according states separately into shift registers. This method will keep internal states independently from instances of XControl.