11-11-2011 07:27 AM
Hello,
I have a Problem with Labview and my USB-6009. Also I found a very similar problem here on the board it does not solve my problem. The problem is, that my application allocates more memory over time and there is no other program thats doing it, I checked it. The application does not do it, when the USB-6009 is not working, only when it is on.
So I stripped down my application to only do the data aquisition and the problem still exists. I tested it also with an USB-6008 and the same happens.
Im using DAQmx 9.0.3 with Labview 2009 on Win XP with SP3.
Regards NN
11-11-2011 07:39 AM
I think the problem is in your code. Can you please post your code. As VI or LLB not some picture 😉
11-14-2011 02:09 AM
Ok, here is the code. I am sorry I thought I had it attached.
11-14-2011 06:45 AM
Hi NN70,
when looking for a memory Leak my first step would be to clean up the BlockDiagram to make your code more readable.
For example remove the Sequence Structure and replace it with Dataflow programming.
There is a finite Analog Input Measurement. When calling DAQmx Read you should wire the "Samples to Read" Input with "Number of Sampels" at the DAQmx Timing VI. The default Value is -1 with means that only Samples that are available at the Time when DAQmx Read is called will be returned.
So there might be Sampels missed.
Regards!
Moritz M.
11-14-2011 10:00 AM
I programmed it with a flat sequence and then replaced it with a stacked one. I know that I don't really need a sequence here after the dataflow-principle of Labview. I think my main problem is that I am not familiar with DAQmx and might have used it wrong.
I have tried it with the default value -1, so that the available samples are read, but my problem still exists. I also tried different combinations of "sample rate" and "samples to read" but the only outcome is that I slow down the time thats needed to fill up the memory.
Regards.
NN
11-15-2011 02:51 AM
Hi NN70,
i ran your Programm for about one hour an i was unable to see any Memory leak. (using Perfmon and Taskmanager)
Since i have Windows 7 and you are using Win XP, i recommend you to check this Knowledgebase:
http://digital.ni.com/public.nsf/allkb/A165C4C5DC2E0AB486257834007762F8?OpenDocument
I hope this helps.
Regards!
Moritz M.
11-15-2011 03:59 AM
@NN70,@Wetzer The only way this program may run for a longer period is to use the continuous run button. In labview that is a BIG NO-NO.
And also NN70 you use a frame as a tool to "clean" up a diagram so it do not get so big. In fact the frame is not needed. And by doing some cleaning up. The diagram could easily be fitted in one screen. And we also have the concept of using sub VIs. So all in all NN70. You are in the process of developing some very very bad programming habits. That will cause you severe problems if you do not do anything about it. I am sure Wetzer can point you to some good free Labview lessons.
If you do not know it NN70. Labview is shipped with a lot of good examples. Go to help in the toolbar. Select help and find examples. Then search for DAQmx. This will give you a long list of examples. Then locate the "Cont Acq&Chart Samples-Int Clk.vi" and take a look at it. This program is nice and compact. And it do much the same as your program do. Note how it is done. The setup and closing. Are done only ONCE. Then the part that is repeated is placed in a loop. This is the correct structure of any program made in Labview. The continuous run button is a tool ONLY for debugging.
I suggest you use the structure in the the example I pointed you to. Then you also clean up your program and get rid of the frames. Post it here for comments if you feel for it. If not your problem is gone (which I am quite sure will be the case). We will at least have something sane we can work on.