08-14-2008 01:33 PM
Hi all,
I am currently building a VI (using 8.5.1) to monitor and control a pressure tank system. It mainly uses a while loops to retrieve the pressure data and export commands and signals using a DAQ. I am running into a problem when trying to record the data. Recording is done at a much slower rate than the sampling, so I used a timer to trigger a case structure. This then retrieves all of the readings and writes them to an excel spreadsheet. The problem is that while the recording is taking place, all other sampling has to wait for the recording to finish. Is there any way to make the while loop continue to run simulataneously with the case structure? Or am I approaching the entire recording process in the wrong manner? I'm new to Labview, and this seemed to be the simplest way to accomplish the task. Any feedback would be much appreciated. Thanks - Dan
08-14-2008 01:49 PM
08-14-2008 01:50 PM
Hello Dan,
You should look into a Producer Consumer architecture. You can find a template for how to set this up under File>>New>>VI>>From Template>>Frameworks>>Design Patterns>>Producer/Consumer...
Feel free to ask any questions!
08-14-2008 01:58 PM
08-14-2008 03:04 PM
Hi DrPhunk,
other ideas:
- using a subvi for parts of code used more than once? See attachment...
- cleaning up your logics for the boolean part in the upper right corner of the big loop? Look at my comments (from simple replacements to wel-known Rube-Goldberg!)
For your problem:
Put independent DAQ parts into seperate loops. Use consumer-producer pattern
08-15-2008 01:02 AM - edited 08-15-2008 01:03 AM
Hi DrFunk,
forgot to say:
after removing this huge sequence structure you can further mnimize the block diagram by putting all those Visa-R/W into a for loop using autoindexing over an array of device commands...
08-15-2008 01:12 PM