How to quickly save large variable, which will increase its length by time?

Hi, iam using serial pulling of data from device. Iam transmitting a code to serial device and it gives data (time taken : 0.17 sec) again i have to send the code for every 0.3 sec and receive the data. So i have 0.13 sec to save the variable. when the variable length is more (reaches 133000 X 3)(increases by 1x3,2x3,nx3), it is taking 0.15 sec so the time is exceeding 0.3 sec and the serial device gives me error. So i need to save the variable quickly and continuously. fast saving of variable or parallel saving of variable without distrubing the pulling

4 commentaires

Where does it have to be saved to ?
What is the maximum amount of data that must be saved in memory? Do you have that much free memory? Would it be acceptable to save to a file and read it afterwards? Is there a maximum number of iterations of fetching data? Would it be acceptable to bundle the data in chunks in memory and assemble the chunks into a whole after the acquisition stopped?
The acquisition will be running for 365 days 24 X 7 continously. the maximum amount of data is 288000 X 6 matrix, all doubles. I have lots of free memory in my computer. Actually the acquisition goes on....., never be stopped.
@johnphilip bhimavarapu: do you mean that you have lots of computer memory (RAM), or lots of hard drive space? These are two totally different things. For limits on memory used by MATLAB, see:
You read the data from the serial line, and then what has to be done with it? Is it just immediately plotted? Are you writing it to hard drive?
288000 X 6 ... I am not clear on the time frame that arrives in?
You mentioned 133000 X 3 double and implied that could come through in 0.17 seconds. You do not mention format, but you mention serial.
If it is text format, then double needs 21 characters to fully represent, plus a 1 character delimiter between fields (or at end of line), which would get you to 8778000 characters in 0.17 seconds. I calculate that would require that the serial port run at over 500 megabits per second. 8 byte double instead of text would need about 188 megabits per second. MATLAB's serial routines cannot handle those rates. Possibly the Data Acquisition Toolbox could handle that with a good card, but that would not be serial (more like PCIe doing DMA.)

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Signal Integrity Kits for Industry Standards dans Centre d'aide et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by