Target Language Compiler    

Data Logging Information (DataLoggingOpts)

The Workspace I/O page of the Simulation Parameters dialog box gives you the option of selecting whether to log data after executing model code generated from Real-Time Workshop. If you choose to log data, you must select one or more check boxes for Time, States, Output, or Final state. You can use the default variable names shown in the dialog box or replace these with your own name selections.

To conserve memory and/or file space when data logging, you can limit data collection to the final N points of your simulation. Select the Limit rows to last check box and use the default value 1000. Using the default setting saves the selected workspace variables to a buffer of length 1000. If desired, you can provide another value for the total number of points per variable to store. You can also select to store the variables in one of three formats:

All data logging information corresponding to the Workspace I/O page is placed within the CompiledModel.DataLoggingOpts record. This record may change with future enhancements to the Workspace I/O page. It is intended to be used in conjunction with the MathWorks-provided MAT-file logging utility file, matlabroot/rtw/c/src/rtwlog.c.

This table lists and describes the data logging information for model.rtw.

Table A-4: Model.rtw Data Logging Information 
Variable/Record Name
Description
DataLoggingOpts {

Data logging record describing the settings of Simulink simulation (Parameters, workspace, I/O settings).

  SaveFormat

0, 1, or 2 (or Matrix, Structure, or StructureWithTime, respectively)

  MaxRows

Maximum number of rows or 0 for no limit.

  Decimation

Data logging interval.

  TimeSaveName

Name of time variable or "" if not being logged.

  StateSaveName

Name of state variable or "" if not being logged.

  OutputSaveName

Name of output variable or "" if not being logged.

  NumOutputSaveNames

Number of names in the OutputSaveName list.

  FinalStateName

Name of final state variable or "" if not being logged.

  StateSigSrc

Only written if SaveFormat is not Matrix and either the states or the final states are being logged. This is an N-by-3 matrix with rows:
   [sysIdx, blkIdx, blkStateIdx]

giving the location of the signal to be logged as a state. sysIdx and blkIdx give the source (i.e., a Block record), which specifies the states that are logged. The blkStateIdx is used to identify which part of the block the state is coming from.

The blkStateIdx will be:

  • -2 if the logged signal is the continuous state vector
  • -1 if the logged signal is the discrete state vector
  • >= 0 implies the logged signal is the blkStateIdxD Work (data type work vector) of blkIdx block in sysIdx system

    Note that sysIdx and blkIdx are valid even if blkStateIdx < 0, and N is the number of signals being logged as states.

}


  RTWGenSettings Record Data Structure Sizes