Paracarro Posted July 31, 2017 Report Share Posted July 31, 2017 Hi all I need to upgrade myself. Using LabVIEW 10, I noticed that a local array can retain his content, among consequent calls. I remember, programming with older LabVIEW 7.1, that the main difference between running a VI using "Run VI" method and using a dynamic subVI Call was that any subVI Call, at start, as the 1st thing to do, it executes a "reinitialize all to default", then it overwrites input parameter passed to the function and, at last, it runs the VI. I remeber to have found in the past an explaination like this, searching LabVIEW Help, but now I haven't found anything about it. Another basic concept was that to statically retain data in a VI, a Shift Register is needed. I thought that FG was founded on this concept Please someone tell me how it works. Thx in advance for the answers. Quote Link to comment
drjdpowell Posted July 31, 2017 Report Share Posted July 31, 2017 1 hour ago, Paracarro said: as the 1st thing to do, it executes a "reinitialize all to default" That's never been true, as far as I know. The reason to use shift registers is that a local variable will involve a data copy, while a shift register does not. 1 Quote Link to comment
Rolf Kalbermatter Posted August 1, 2017 Report Share Posted August 1, 2017 (edited) I second what drjdpowell says. This never happened AFAIK. What you describe about reinitialize to default can happen when you use VI server to load a VI into memory and then call it, both with Run VI, or Call By Reference (asynchronous). When loading the VI with Open VI reference it will be loaded into memory and then all the controls will indeed be initialized to their stored default value. Another thing you may be confusing is that controls wired to the connector pane will always use either the value wired to that connector pane or the configured default value. But that has been like that since the beginnings of LabVIEW and still is. Controls that are not connected to the connector pane however will simply retain their last value for as long as the VI stays in memory and that has been like that since the beginnings of LabVIEW too. And the use of local variables instead of shift registers/feedback nodes is discouraged because of performance reasons! Edited August 1, 2017 by rolfk 1 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.