Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

How to save the data from AI Read.vi?

Hi,

The main target is that testing the strength of a object which is extended by a force. The desired results are
1. The strength of object under the force(main target, I am trying now);
2. Displacement of object being extended(I have mimicly done);
3. Images of deformation of the object extended(I have mimicly done).
4. The sub procedure will stop when the object under testing is broken. I intend to use the big pulse from force sensor by analizing the data acquired.( it is more difficult if using machine vision).

What I am mainly trying to do now is implementation of a sub vi to collect the data which is acquired from channel 0 of PCI-6052E which is connected to a force sensor. I have tried to use an existing exam
ple as attached with some modifications. I have tested the data from the sensor by comparing to measurement by multimeter and it takes sense. But
1. I still don't know how to save data displayed by AI Read.vi? And use what kind data type could save more memory?
2. I think that memory management is very important because each points of the result includes its strength, image and displacement. How can I acquire enough significant points for the final results being reliable and save these data down to an array or cluster synchronously? (each sub procedure has no time limited)
3.Because I think that a continuous data acquisition would occupy ALL CPU TIME and their related images and displacements would have no chance to be taken down by CPU at the same moment. Am I right?--I am sure that it is not very difficult problem but my mind is still in caose and the time is quite limited to me now.

I am looking for your sugguestion or solution or control philosophy too. You can modify the fi
le attached if you can. I will learn from your idea.

Thank you very much for your time and energy!

Your
Swedlin
0 Kudos
Message 1 of 3
(3,488 Views)
Hello;

Regarding your question on the data type that would use less storage space, the answer is binary type. Actually, you can use another shipping example as start point of your application. The example I'm mentioning is a data logger, that saves binary data to a file on your hard drive. You can find that example at Search Examples->I/O Interfaces->Data Acquisition->Data Logger->High Speed Data Logger.

Regarding your question about the CPU time, the statement is valid. In case you use a synchronous AI task, the CPU execution will get stuck inside the AI Read.vi untill the buffer is ready to be read. One thing you can do about that is to change the acquisition task to be asynchronous. There is a good example in Labview showing how you can accomplish that.

You can find the example at Search Examples->I/O Interfaces->Data Acquisition->Analog Input->DAQ Occurrences.

You can combine both examples to accomplish the task you need.

Hope this helps.
Filipe A.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 3
(3,488 Views)
Thank you very much, Philip!

I met some other problems and still haven't fully understand how to combine both VIs into one in your suggestion. Maybe I should change its control philosophy.

By the way I found that Write Spreadsheet File.vi takes no any actions on "appending data to an existing file", and I don't know why. See attached file "Aquire N Scans 1_22.vi"please.Could you tell me why?

Thanks!
Swedlin
0 Kudos
Message 3 of 3
(3,488 Views)