I have problems with data acquisition using National Instruments and Python. I use magnetic field sensors with 3 axes x, y, z, and I am using National Instruments library(Python) to get data. I made the setting to collect 100 data for every 1 second, and they return 3 lists with 100 elements for every one second.
time_memory = [k + i/100 for i in range(100)] # dividing 1 second into 100 intervals
x = [100 elements]
y = [100 elements]
z = [100 elements]
Below one is for writing data into files.
for i in range(self.samples):
self.time_memory[i] = file_time + self.time_index[i]
f.write("{0} {1} {2} {3}\n".format(self.time_memory[i], x[i], y[i], z[i]))
So, the resulting data files must be look like this.
time_value, x, y, z
time_value, x, y, z
1.01, 32, 36, 123
1.02, 32, 38, 123.4
...
So I tried to get the data as long as possible, but after 8000 seconds, the program showed the weird error as shown in the photo.
It is shown that
The application is not able to keep up with the hardware acquisition.
Increasing the buffer size, reading the data more frequently,
or specifying a fixed number of samples to read instead of all available samples
might correct the problem. Property: DAQmx_Read_RelativeTo Corresponding Value:
DAQmx_Val_CurrReadPos Property: DAQmx_Read_Offset Corresponding Value: 0
Task Name: _unnamedTask<0> Status Code: -200279
In order to solve this error, I googled and asked to many people, but I couldn't find the actual cause. The most convincing answer among them was that for a computer with HDD, writing 400 data less than 1 second (using for loops in Python) is much beyond the computer's capability, but I still can't believe this one and can't find the solutions to solve this problem.
Please help me guys :(