"So if i run all day"
After looking at your VI I read this as indicating that you are using the continuous run button OR you are calling this VI repeatedly from another VI.
If either are the case the slow down in performance is indeed the memory and the increase in memory useage of 4k per call all amkes sense.
The VI you are calling opens and closes a VISA refernce.
LV is really like a good assistant taking notes and taking care of all of the deatils for you so you go off an think your higher thoughts. One of the things it does is make sure that any scrap of paper that you left lying around is not lost. Even if you just put a dot on it. One of those scraps of papers shows up as a block of memory everytime you open a reference in LV. If you close it, LV or VISA etc will decrement the access count to that widget but the scrap of paper is still there. The scraps of paper and burned any time you tell LV you are done thinking. This happens when you exit LV. Then and only then does all of the memory allocated for all of the scraps of paper cleaned up.
To fix your poblem take a very close look at what Unclebump posted. He demostrates how to open a resource, use it and then only after he is done does he close it up.
You will also find that your code may run faster because your are not breaking out a new scrap of paper everytime you want to say something.
Ben
PS Thank you for psoting the code. It saves us doing a lot of guessing!
Message Edited by Ben on 05-17-2005 08:39 PM