How do you store output data in a text file during simulation ?
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Our project requires a non-corruptible form of data storage in the sense that even if there is a power failure or an emergency shutdown, we want to be able to retrieve previously logged data and resume operations. We currently log data around every 5 seconds and have been making use of the To File Block in Simulink. I want to know if there is a way to store this logged data in a text based format instead, in Simulink.
If not, is there a way to ensure that the .mat file doesn't get corrupted if the file doesn't close properly ? We ran an experiment where the computer was hard reset (forced shutdown) and tried to open the .mat file. This gave us junk values (the data was constant at -209.8 for all the logging intervals and only logged arbitrarily and at non-specified time stamps).
I would appreciate if someone could shed some light on this issue.
0 Commenti
Risposte (1)
Kaustubha Govind
il 2 Lug 2013
You might need to write a custom block (perhaps using a MATLAB S-function) to do the logging to a text file for you. I don't think the "To File" block closes the MAT-file until simulation is stopped - in fact, I wouldn't imagine that it writes to the file immediately either. My guess is that the block has an internal buffer that it writes to, that is then written to file only when the buffer gets full.
0 Commenti
Vedere anche
Categorie
Scopri di più su Prepare Model Inputs and Outputs in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!