09-04-2014 09:13 AM
Hello,
i have one vi that Opens & Starts 10times in a loop the same vi (see picture).
This vi is running very fast and is restarted each second by the calling vi.
Currently there is no "Close reference" at the end of all. Is this needed?
If yes: What is the consequence when running the vi without it?
My current problem is that the CPU usage rises although the program is always doing the same.
Can this be the result of a missing "Close Reference"?
Thx
09-04-2014 09:15 AM
@OnlyOne wrote:
Hello,
i have one vi that Opens & Starts 10times in a loop the same vi (see picture).
This vi is running very fast and is restarted each second by the calling vi.
Currently there is no "Close reference" at the end of all. Is this needed?
If yes: What is the consequence when running the vi without it?
My current problem is that the CPU usage rises although the program is always doing the same.
Can this be the result of a missing "Close Reference"?
Thx
memory leak if you intend on running the program for several days
ask Bloxx about it
09-04-2014 09:32 AM
why are you calling your vi in a loop every time.
Can't you put the while loop inside the called VI.
i do not see wait anywhere in loop so CPU usage will be high.
and yes you need to close references you opened.
09-04-2014 10:04 AM
@Neos wrote:
why are you calling your vi in a loop every time.
Can't you put the while loop inside the called VI.
i do not see wait anywhere in loop so CPU usage will be high.
and yes you need to close references you opened.
He is calling different clone instances of his VI. That is why it is in a loop (a new instance each iteration). I'm just not sure why they just didn't use a FOR loop. The second loop will wait for each instance to complete, so no need to worry about CPU usage.
And yes, you should really close your references.
09-04-2014 10:16 AM
@crossrulz wrote:
@Neos wrote:
why are you calling your vi in a loop every time.
Can't you put the while loop inside the called VI.
i do not see wait anywhere in loop so CPU usage will be high.
and yes you need to close references you opened.
He is calling different clone instances of his VI. That is why it is in a loop (a new instance each iteration). I'm just not sure why they just didn't use a FOR loop. The second loop will wait for each instance to complete, so no need to worry about CPU usage.
Ooooo, Its good for me that i posted a reply to this thread.
Can i give you more than one kudos for same post.
09-05-2014 01:45 AM
What happens if CloseReference is not used?
Does it mean the opened VI stays in memory? So each time i open a new reference of the vis the used memory rises of the vi-file-size?
Thx
09-05-2014 01:50 AM
If you read to that link what crossrulz has given
if LabVIEW leaks a control reference, LabVIEW stores refnums and related control data in memory. However, if LabVIEW leaks a VI reference, LabVIEW stores a whole VI in memory.
09-05-2014 01:56 AM
Oops, i didnt see that link. Looks like part of the signature.
Thx