09-28-2005 01:08 PM
09-29-2005 05:27 PM
Hi Andy,
I did not see anything fundamentally wrong with what you wrote, but there were
a few things that I think could be used to be changed. However, there
were a few things that I did modify that might make a bit of a
difference. In your application you were using sequences and a bunch of
local variables. Since LabVIEW is based upon data flow, you can control
the sequence of execution by making data dependencies and simply wiring one
thing to the next. By simply using LabVIEW the way it is meant to run I
was able to completely remove the sequence structure and also eliminate the use
of all of the local variables, all while having the exact same execution order.
It could be that the local variables were causing the memory leak that you
noticed, but I really doubt they could be the cause of such a large leak.
I really think there is probably something else going on in the application
because from what I saw from this bit of code there really is no way that it
would have such large problems. Users use the FP commands daily without
any problems, so most likely these are not the root of the problem.
Go ahead and try the modified code and see if you can implement similar local
and global variable reducing techniques throughout your application.
Hopefully that will help reduce some of the memory leaks you are seeing.
Typically the largest cause of an apparent memory leak really occurs from
building an array within a loop, so make sure you don't have any situations
where that occurs in your code either.
Regards,
10-03-2005 07:45 AM
Otis,
thank you for this update. Prior to receiving your code, I rewrote my VIs such that they no longer use fieldpoint VIs (e.g., communicate directly via VISA serial VIs). While changing only that, the memory leak has been resolved. I'm attaching the code for that, if you are interested.
I should also mention, in case I hadn't already, in my application there are 4 sub-VIs which interact with fieldpoint modules. Two of them simply measure voltage, using VI's like the ones I've attached, one of them sets relay modules, and the other sets analog output voltages. They are all functionally very similar, so I would not expect any of them to act differently than the rest.
Thanks!
Andy