Log Signals on an SD Card

You can use SD card logging to save signals from Simulink® models on an SD card mounted on a VEX® EDR V5 Robot Brain. The signals from these models are saved as data points in MAT-files. With the data you log, you can apply fault analysis, search for transient behavior, or analyze sensor data collected over a long period. The data points can be saved in: Structure, Structure with time, or Array format. Simulink supports logging signals on the target hardware from only these three blocks:

This topic is for Simulink Coder™ Support Package for VEX EDR V5 Robot Brain.

Without MAT-file logging on SD card, you can only log and analyze the data on the target hardware by using the Monitor and Tune feature or by sending the signal to a computer (using Serial) and storing it in MATLAB®. These mechanisms need an active connection between a computer and the target hardware when logging data. With SD card logging, you can log data without any need to connect the target hardware to a computer. Other advantages of logging data to SD card over other mechanisms are:

  • The ability to collect data over a long duration for analysis.

  • The ability to store the data in a well-structured MAT-file, including timestamp information.

Before you start to save signals from Simulink models on an SD card, complete the steps listed in Prerequisites for Logging Signals.

  1. Configure Board Parameters and Enable MAT-File Logging: To save MAT-files on an SD card, the MAT-file logging option in the Configuration Parameters dialog box must be selected. Also, the target hardware parameters must be specified.

  2. Configure Model to Log Signals on SD Card: SD card logging is supported in models containing To Workspace, Scope, or Outport blocks. You must specify the values for several block parameters.

  3. Run Model on Target Hardware: Simulink deploys code and logs signals on the SD card. These signals are saved as MAT-files on the target hardware.

  4. Import MAT-Files into MATLAB: After logging is complete, you can open MAT-files in MATLAB and use them for further analysis.

Related Topics