07-21-2010 12:16 PM
I am trying to pull 15 channels from the DAQ Assistant Express VI. 4 thermocouples, 4 pressure transducers, and one mass flow rate sensor are currently connected with the rest of the channels available as I expand the number of instruments attached to my CompactDAQ cDAQ 9174.
I initially wrote the VI using random number generators to simulate the rest of the VI, how it processed data, whether the files were saving correctly, etc. With this setup, I could change the number of samples/s/channel and the VI would respond as expected.
Now that I've managed to make the sensors talk to LabVIEW, however, it is moving very slowly (which I guess makes sense) and say, 8 samples/s/channel looks like 1 sample/s/channel, if that.
I've tried changing the sample rate, number of samples, and other variables in the DAQ Assistant VI to no avail. I'm guessing that my loop is just trying to do too much and I can't see how to streamline it. My admittedly lousy VI is attached if you can offer any insights. Please feel free to tell me that what I've written is stupid, just no exclamation points. My ego can't afford to be bruised.
As always, thanks!
Greg
07-21-2010 12:43 PM
First, the 9174 is just a chassis provide the model numbers of the modules that you are using.
Second, the samples/s/channel control has absolutely no affect on the sample rate. Your DAQ Assistant has a sample rate of 50Hz. Your delay just controls how often the DAQ Assistant is called. Get rid of the wait.There is no way to change the sample rate without editing the DAQ Assistant so no front panel user control is possible unless you use the lower level DAQmx functions.
Third, with the build array, you are probably causing a lot of memory reallocation because you do not bound the size of the array.
Fourth, I don't understand what you are writing. Since the shift register grows and grows, you are constantly writing a file that grows and grows, You are not appending new data to old. Get rid of the shift register and write just the current 1D array to file by setting the 'append to file?' input to True
Fifth, it would be better to move the file write to a consumer loop (after you fix how you are writing to file).