LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI Call Configuration, Call Setup problem…

Solved!
Go to solution

       I am loading a simple MainVi w/Timer SubVI in Call Setup, ”Reload for each Call.” The problem is that the MainVI compiles the SubVI into memory, when setup is set to ”Reload for each Call”-Loads the subVI when the caller VI makes the call to the subVI if the subVI is not already in memory. This option does not guarantee that the subVI stays in memory after the call.

        

       When I do it by using “Open VI Reference”, “Call by Reference” and “Close Reference.” The VI works by loading and unloading the SubVI in memory, which ”Reload for each Call” is supposed to do…..?

0 Kudos
Message 1 of 7
(3,927 Views)

anyone notice this problem,is there a fix or should i report this, please look at the link above.....

0 Kudos
Message 2 of 7
(3,898 Views)
Solution
Accepted by topic author apok

A strictly typed static VI reference also reserves any subVIs when a top-level VI is reserved, thus making it ineligible for the Run VI method. Refer to the Run VImethod for more information.

LabVIEW loads the referenced VI into memory when you load the top-level VI. When the Static VI Reference function outputs a strictly typed VI reference, LabVIEW reserves the referenced VI as long as the top-level VI is running. LabVIEW closes this reference when the top-level VI is no longer in memory.


So the call set-up options really should be greyed out with static vi referances since the static ref loads the vi with the caller and cannot change call setup.   With this mod to your code the call set-up pop-up is properly disabled

Snip.png




Also- Watch out for that infinate loop in MAIN2.vi (You really should not use default if unwired and have some means to stop on the second callSmiley Wink


"Should be" isn't "Is" -Jay
Message 3 of 7
(3,888 Views)

What is really interesting about this feature is how easy it is to write the code that does not do what you want.

  1. Drop the vi you want to reload for each call
  2. Right-Click select Call Set-up
  3. Select "Reload on each call"
  4. Press OK

Bug maybe.png

 

And presto LabVIEW rewrites your code for you to disable the ability to do what you just asked it to do.

 

Smiley Embarassed

I Think I'll wait for NI to weigh in on this before declaring it a bug but maybe there is a lack of understanding on my part.


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 7
(3,865 Views)

OK further reading through the help file. 

 

I am/was confussed.  The ACBR or CBR created by the call setup method does perform the way I expect.  (It reloads the vi on each call)  The Caveat that Apok and I missed is that it only reloads the vi if it is not allready in memory and does not "Force" removal from memory.

 

SO Apoks code MAY work differently with timer in memory and out of memory when MAIN2.vi is run.  The Mod I made placed a Strict Type Def CONSTANT on the block diagram and the constant forces timer to be in memory.  which was properly reflected by gyeying out the call setup options .

 

Thanks for straightening me out Jeff!


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 7
(3,858 Views)

with this block diagram, it does as it is prescribed...."loads and unloads" it from memory. i just dont understand the "reload for each call"?

MAIN2_BD.png

 

thanks for the research Jeff

Message 6 of 7
(3,850 Views)

@apok wrote:

 

thanks for the research Jeff


No Problem-  I learned something new.  You are not guarenteed to unload with a Call set-up.  Although, I would suspect a call to request memory de-alocation would improve the chance that the vi unloads.  If you try it let me know


"Should be" isn't "Is" -Jay
0 Kudos
Message 7 of 7
(3,845 Views)