ayumisano Posted March 1, 2006 Report Share Posted March 1, 2006 Dear all, I am writing a data acquisition program with LabVIEW. The program has a while loop which waits for triggering from outside. The program works properly when there is triggering but there is memory leakage when there is no triggering. I would like to know whether there is any method to solve this problem. Moreover, does hardware triggering require specific I/O cards such as PCI-6534? Thank you for your help in advance! Ayumi Quote Link to comment
Khalid Posted March 1, 2006 Report Share Posted March 1, 2006 How do you know there's a memory leak? Can you post a simpler version of your VI? -Khalid Quote Link to comment
i2dx Posted March 1, 2006 Report Share Posted March 1, 2006 Moreover, does hardware triggering require specific I/O cards such as PCI-6534? hmm ... how to say this? if you want to programm a hardware trigger, you have to use a card, which supports hardware trigger. Most of the NI-DAQ-Cards support at least a rising edge start trigger, but only a few support e.g. a "reference trigger" therefore, yes, you have to use a specific card, but as mentioned above most of the NI-DAQ-Cards are those "specific" cards Quote Link to comment
ayumisano Posted March 2, 2006 Author Report Share Posted March 2, 2006 hmm ... how to say this?if you want to programm a hardware trigger, you have to use a card, which supports hardware trigger. Most of the NI-DAQ-Cards support at least a rising edge start trigger, but only a few support e.g. a "reference trigger" therefore, yes, you have to use a specific card, but as mentioned above most of the NI-DAQ-Cards are those "specific" cards Dear all, Thank you for your reply. I know that it is memory leakage because I open the task manager and I can see that the the ram "comsumed" by LabVIEW is increasing while there is no triggering. I will try to find a simpler version to post here. I would like to know whether PCI-6602, PCI-6601 and PCI-6534 can be used for hardware triggering. Thank you very much for your help. Ayumi Quote Link to comment
Louis Manfredi Posted March 2, 2006 Report Share Posted March 2, 2006 I know that it is memory leakage because I open the task manager and I can see that the the ram "comsumed" by LabVIEW is increasing while there is no triggering. Hi Ayumi: Make sure that you don't create references to the hardware you are using inside the while loop-- that is a sure way to create a bad memory leak and also slow things down badly. Create the reference just once outside the loop, and pass it in to the things that use it repetitively. Also, close the reference after the loop exits-- This is only important if the program is run many times without exiting, but still its good practice to close the reference when the program is done with it. This might not be your problem, but its one of the most common ways new users create memory leaks in LabView, so I thought it was worth mentioning. Good luck & Best Regards, Louis Quote Link to comment
ayumisano Posted March 6, 2006 Author Report Share Posted March 6, 2006 Hi Ayumi:Make sure that you don't create references to the hardware you are using inside the while loop-- that is a sure way to create a bad memory leak and also slow things down badly. Create the reference just once outside the loop, and pass it in to the things that use it repetitively. Also, close the reference after the loop exits-- This is only important if the program is run many times without exiting, but still its good practice to close the reference when the program is done with it. This might not be your problem, but its one of the most common ways new users create memory leaks in LabView, so I thought it was worth mentioning. Good luck & Best Regards, Louis Hi Louis: I don't understand what you mean by "create reference". Do you mean using port config inside a while loop? Thanks for your help! Ayumi Quote Link to comment
Mike Ashe Posted March 6, 2006 Report Share Posted March 6, 2006 It might help us to help you if you could post either a single VI or an image of the DAQ/Trigger loop you are trying to debug. As for specific cards you can go up on the NI sebiste under Products & Services and 20 minutes of reading (tops) will tell you most of what you want to know about the different cards. Quote Link to comment
ayumisano Posted March 7, 2006 Author Report Share Posted March 7, 2006 It might help us to help you if you could post either a single VI or an image of the DAQ/Trigger loop you are trying to debug. As for specific cards you can go up on the NI sebiste under Products & Services and 20 minutes of reading (tops) will tell you most of what you want to know about the different cards. Hi Michael, I have attached the image of part of the DAQ program. I am not sure whether this helps but since the program is too large to use 'screen capture'. I am thinking whether it is the DIG line in the while loop that makes the problem. So now I am trying to use Port Conifg and Port read and DIO clear instead, and I put Port config outside the while loop and Port read and DIO clear inside the while loop. It seems that the memeory leak problem is solved (I ran the program for 12 hours but it didn't show me the message of insufficient ram as it did in the past), but I have not yet tested whether the triggering still works properly (that is, whether it can still receive a signal from the PCI-6534) if I put it this way. Thank you for your help! Ayumi Quote Link to comment
Mike Ashe Posted March 8, 2006 Report Share Posted March 8, 2006 Nothing obvious in the image. Glad to hear the leak seems to have been corrected with your last fix. Hope the triggering still works. Let us know. One note, you might want to consider putting more of this in subVIs. Good luck. Quote Link to comment
didierj Posted March 8, 2006 Report Share Posted March 8, 2006 As a "picky bastard" (didn't anybody else here once stated he was also one :laugh: ) I have seen 2 things that disturbs my eye: 1. Try not to wire overlapping wires (wire that gets hidden behind another). 2. Data flows into a node (sub-vi/control/property node) from left and top and flows out of a node to right and down. It will make your code much more readable, after having not looked into it for several months. Quote Link to comment
ayumisano Posted March 11, 2006 Author Report Share Posted March 11, 2006 Nothing obvious in the image. Glad to hear the leak seems to have been corrected with your last fix. Hope the triggering still works. Let us know.One note, you might want to consider putting more of this in subVIs. Good luck. Dear Michael, I put both Port Config and DIO Clear in the while loop and luckily the triggering still works. Thank you for the help and suggestions from all of you! Ayumi Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.