LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DATA acquisition error

I am using a DAQ6052E, SCXI 1125 and SCXI 1121. I am acquiring data from 4 channels continously. I am sampling continoulsy at 1K hz and reading 100 samples.

1-Thermistor
2- Thermocouple
3-Thermocouple
4- ECG.

The thermistor acts like the CJC of the 2 TCs.

I need to read data, process it, save it and grah it.
I ran my application several times and I kept missing data points. I was adviced to avoid graphing in the same loop that i was reading and writing. But since I also wanted to continously display, I made local variables of the temperatue and ECG values and displayed them in another parallel loop. For the ECG waveform I need to see at least 1-2 seconds of data on the screen. Hence in the while loop I have added a for lo
oop to add the samller bits of data to 1 second or more.

STill I keep getting -200279 error. I tried different 'number of samples to read' from 1000 to 100 but that didnt solve the probelm. I increased my buffer size to 20000, but that also didnt work.
I keep getting this error, and I cannot reduce my sampling rate less than 1Khz. How can I eliminate this problem. It was my understanding that doing a parallel loop to display would not slow down the first loop in which I read. Am I correct in my assumption ?

Also I am saving text as ASCII. Should I save it in Binary ?. The NI engineer told me that going to binary would be a little beneficial but wouldnt solve my problem.

Or should I increase my buffer size even further ?.
I have attached in vis.
There are 3 while loops in it.
The first, reads it, processes it and saves it.
The second displays the temperature
The third displays the ECG,. I have made a for lopp so that I can see 1-2 seconds of ECG data at a time.
Download All
0 Kudos
Message 1 of 8
(3,528 Views)
Can you save this as a LabVIEW 7.0 file? I don't have 7.1, but would like to look at this. Do you know what the -200279 error is?

Mark
0 Kudos
Message 2 of 8
(3,528 Views)
Could you provide the rest of the VIs to run this program. You left out a couple thermister conversion VIs and what not.

I tried to run your program with those VIs left out and I got no errors, so I must be missing something.

Allan S.
Applications Engineering
National Instruments
0 Kudos
Message 3 of 8
(3,528 Views)
I have attached the rest of the vis.

My basic aim is to aquire, process, save and display the data of 3 channels as efficiently as possible.

I also have a push button on the front panel which i use to marks certain events.

The data should be saved right, without any loss of samples, or any error. Also, I can sacrifice slightly on the display.. however right now.. the graph is delayed by almost 5-8 seconds.. can I improve that ?.

Is the parallel loop technique a good way to do this or are there better ways.?.
thanks
shubha
0 Kudos
Message 4 of 8
(3,528 Views)
How can I save this as a 7.0 ? I only have labview 7.1
0 Kudos
Message 5 of 8
(3,528 Views)
From the top toolbar, select File->Save with options, and then you select "save for previous".

Mark
0 Kudos
Message 6 of 8
(3,528 Views)
You are saving data continuously to the data file. (after each read). The data file will become big enough where accessing it takes time. Delay will be created ansd the error will be reported.


Put a case structure around the write to spread sheet file.vi (save or no save). If set to False (no save) and the problem is gone, then the conversion of data (raw to calibrated) is not creating too much delay, and the delay is actually coming from the save process. In this case, save you data every 10 seconds or so (whatever is appoproiate)(instead of after each read) , but you need to keep appending your current data to an array )preallocated or otherwise) or a queue, then at the end of the 10 second period save the data. You may want to move the save prcocess
to a loop of its own.

If the file size is becoming big, you may want to save to multiple files (file0001, file 0002, etc....)

Currently you are using the save to spread sheet file. each time it opens the file and closes it. You need to open the file once (initially, use WriteFile+.vi whenver you want to write, and at the end of the test, close the vi. (the closefile.vi should be out side the loop (when the vi stops/exits.
0 Kudos
Message 7 of 8
(3,528 Views)
Thank you for you suggestion.

I replaced the vi with the writefile.vi and i am no longer getting any error.

However I would very much like to implement your idea of saving data in a queue and writing evvery 10 minutes or so to multiple files.

That would definitely be a great improvement to my program in general.

I tried to do that but to no success. ( also i am sure i am doing it in a wrong manner).

I would really appreciate it if you could give me a vi or some more info on that procedure.

thanks
0 Kudos
Message 8 of 8
(3,528 Views)