12-16-2008 10:28 AM
Hi,
I am using the compactDAQ system with the thermocouple module and an Instek programmable power supply for an experiment. I am using the power supply to control the current output in a resistive wire. The temperature profile of the resistive wire has to match a certain waveform and that is accomplished by using 4 thermocouples, the thermocouple module and the compactDAQ system. This issue is that the time step between each iteration is too large. To lower it, I've tried to increase the rate the DAQ system reads the data but this causes the system to crash. The errors stem from the DAQ assistant and state there is not enough data to write to the file and I should increase the rate or there is too much data and I have to increase the buffer size. Through trial and error I found the right balance between number of samples, 4, and the rate, 5, which doesn't the system to crash. The thing is that this experiment will last several hours and I cannot have the code crash in the middle of the experiment.
Any suggestions would be greatly appreciated.
Thanks,
M Mixa
12-17-2008 02:05 PM - edited 12-17-2008 02:09 PM
Hi M Mixa,
Depending on the module you are using with the compact DAQ system, the results may vary. The basic ideas are as follows. The DAQ card accumulates samples from the thermocouples. These are stored mometarily in small FIFO buffer on the module. As the FIFO fills, the data is transferred over the USB connection to the computer. This is done automatically with the DAQmx driver. Once transferred, the data is stored in PC memory. Both the FIFO and the PC memory comprise something we refer to as a double buffer. When you call the DAQmx read (DAQmx low level vi's) within LabVIEW or use the DAQ Assistant, the samples are transferred from this double buffer to LabVIEW memory. From the way it sounds, you are talking a very low number of samples (4) at a slow rate of 5 Hz. My advice would be to consider using our lower level DAQmx vi's to gain a bit more control over the acquisition. Using these vi's and the DAQmx buffer vi, you can directly set the buffer size to be larger and you can better control the rate at which your program is grabbing data from the buffer. The errors your describing sound like they are due to not reading the data from the buffer fast enough. If you don't, the buffer will fill up and begin overwriting data which will cause the program to error. If you are using the DAQ assistant or the DAQmx read in a loop, make sure that the loop is executing fast enough to appropriately grab this data from the device. In addition, you can use a number of samples as -1 to read all available samples from the double buffer. This is often a great way to reduce the possibility not reading fast enough or reading too fast from the buffer. For additional help, please include the error messages and a screenshot of your code if possible.
I would also recommend taking a look at some of our example programs. These can be accessed by going to Help » Find Examples within LabVIEW. From here, you can navigate to Hardware Input and Output » DAQmx.
I hope this helps,
Paul C