08-16-2005 09:43 AM
08-16-2005 10:06 AM
LabVIEW has automatic memory management. It does not have pointers. This allows for much greater simplicity when writing code, but can be a problem if things aren't done right. There are quite a few methods for improving memory management, so I suggest you post your code and we could probably give you a few pointers (no pun intended). As a wild guess - if you see that LV is taking all the CPU resources, this is probably because you have a loop with no wait function. Such a loop runs all the time.
Note that if this is only an exercise and your program works, you should probably focus on the program working and not on optimization. A good way to read about some of the tricks mentioned earlier is to go to Help>>Search the LabVIEW Bookshelf and reading the white paper about memory management and performance.
To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. Here and here are a couple you can start with. You can also contact your local NI office and join one of their courses.
In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf).
08-17-2005 07:55 AM
08-17-2005 09:35 AM
If you don't want to lose data you should use a queue (Advanced>>Synchronization palette). Feed the data into the queue in your acquisition loop and take it out of the queue in your processing loop. As long as you're not reading data faster than you're processing it, you should be fine. If you are getting data faster than you can process, your queue will start getting bigger and bigger and you will eventually run out of memory (unless the acquisition stops or slows down).
If you give the Dequeue Element VI an infinite timeout the processing loop will hold whenever the queue is empty.
08-17-2005 09:44 AM
08-17-2005 09:58 AM
I think there is some misunderstanding between us, so I will repeat my suggestion: Use a queue.
The queue VIs can be found in the Advanced>>Synchronization palette and they will allow you to keep all your data and do the processing in another loop, parallel to the acquisition. The queue will only grow if you are not processing fast enough and even if it does grow all the time, it will take a long time until it causes a memory problem and by then your acquisition will probably be over and it will stop growing.
Search the example finder (Help>>Example FInder) for examples of how to work with queues.
08-18-2005 06:42 AM
08-18-2005 07:40 AM
08-18-2005 12:40 PM
I would guess you don't have access to LVRT anyway.
First of all, I don't see any relation between this VI to the system you described. Where are the arrays you talked about? I see you're worried about the buffer (I think), but if you are, just make it bigger. I don't have DAQ, so I hope I got it right.
I still don't understand what your problem is with using queues. If the AI Read VI outputs something, you should be able to create a queue of that type and use it. You will NOT lose data and you will probably not over burden the computer. Open the example finder and go to the Search tab. type Q and you will see the queues topic. Select it and you will find several examples for how to use queues. If this isn't good for you I want to know why. Also, if you post your code, you should post the code you talked about.
08-18-2005 12:52 PM