How can I save last values of a [3x1] array in real time simulink application?

4 vues (au cours des 30 derniers jours)
Flavio
Flavio le 4 Août 2015
Commenté : Flavio le 5 Août 2015
Hi everyone,
I am interfacing my beaglebone platform with simulink for a real time application. I take data from a sensor and I want to store its values when I send a command by a UDP communication.
I know that there are "to workspace" or "to file" blocks but they save all the date from the beginning of the simulation.
Therefore, I am trying to use fopen, fprintf, fclose in an embedded matlab function, but it does not work because, even if it compiles, it does not save any file.
Do you know how can I save data?
Flavio

Réponses (1)

Sebastian Castro
Sebastian Castro le 4 Août 2015
You're trying to save data on the MATLAB side, and not standalone on the BeagleBone, correct? If so, you can try this out.
  • Replace the "To Workspace" block with a regular output port (Out1) block
  • Go to Simulation > Model Configuration Parameters, in the Data Import/Export pane
  • Make sure the Output option is enabled
  • Enable the Limit data points to last option and set it to 1
- Sebastian
  1 commentaire
Flavio
Flavio le 5 Août 2015
Solidworks compiles the model but at the end of the simulation I do not have any variable on the workspace.
May it be because I do not start the simulation by matlab command window but by the terminal (the platform works with linux)?

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by