Jump to content

still "reinitialize all to default" executed 1st when a SubVI is called?


Recommended Posts

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.

Link to comment
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.

  • Like 1
Link to comment

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 by rolfk
  • Like 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.