启动信号测井模型
Enable and Disable Logging at the Model Level
记录一个信号,马克日志。为维etails, seeConfigure a Signal for Logging.
Enable or disable logging globally for all signals that you mark for logging in a model. By default, signal logging is enabled. Simulink®logs signals only if theConfiguration Parameters>Data Import/Export>Signal loggingparameter is checked. If the option is not checked, Simulink ignores the signal logging settings for individual signals.
When signals are marked for logging, the signal data is logged to the workspace and also sent directly to the Simulation Data Inspector, by default. You can disable logging signals to the workspace through the Configuration Parameters dialog box or programmatically.
In the Configuration Parameters dialog box, clear theConfiguration Parameters>Data Import/Export>Signal loggingparameter check box.
From the command line, use the
SignalLogging
parameter.set_param(bdroot,'SignalLogging','off')
Data for signals marked for logging is always sent to the Simulation Data Inspector.
Selecting a Subset of Signals to Log
You can select a subset of signals to log for a model that has:
Signal logging enabled
Logged signals
为维etails, seeOverride Signal Logging Settings.
Specify Format for Dataset Signal Elements
Logged signal data is saved inDataset
format (asSimulink.SimulationData.Dataset
objects). To specify whether you want the data for individual signals in the dataset to use MATLAB®timeseries
ortimetable
elements, set theDataset signal formatconfiguration parameter. The default istimeseries
. For details, seeDataset signal format.
Migrate Scripts That Use LegacyModelDataLogs
API
For scripts that simulate a model created in a release earlier than R2016a that usesModelDataLogs
format for logging, update the code to log inDataset
format.
If you have already logged signal data in theModelDataLogs
format, you can use the
function to update theSimulink.ModelDataLogs.convertToDataset
ModelDataLogs
signal logging data to useDataset
format. For example, to update theolder_model_dataset
fromModelDataLogs
format toDataset
format:
new_dataset = logsout.convertToDataset('older_model_data')
Converting a model from usingModelDataLogs
format to usingDataset
format can require that you modify your existing models and to code in callbacks, functions, scripts, or tests. The following table identifies possible issues to address after converting toDataset
format. The table provides solutions for each issue.
Possible Issue After Conversion to Dataset Format | Solution |
---|---|
Code in existing callbacks, functions, scripts, or tests that used the |
Check for code that uses For example, suppose that existing code includes the following line: logsout.('Subsystem Name').X.data
Replace that code with a logsout.getElement('x').Values.data
|
Muxblock signal names are lost. |
The |
信号观众cannot be used for signal logging. |
Simulink does not log signal logging data in the Signal Viewer. Use the signal logging output variable to view the logged data. |
The |
The For example, if the data in For For
|
The |
If necessary, add signal names. In
For example, In For both |
Test points in referenced models are not logged. |
Consider enabling signal logging for test points in a referenced model. |
Script uses |
Consider using |
Specify a Name for Signal Logging Data
You use the model-level signal logging name to access the signal logging data for a model. The default name for the signal logging data islogsout
. Specifying a model-level signal logging name can make it easier to identify the source of the logged data. For example, you could specify the signal logging namecar_logsout
to identify the data as being the signal logging data for thecar
model.
To specify a different model-level signal logging name, use either of these approaches:
In the edit box next to theConfiguration Parameters>Data Import/Export>Signal loggingparameter, enter the signal logging name.
Use the
SignalLoggingName
parameter, specifying a signal logging name. For example:set_param(bdroot,'SignalLoggingName','heater_model_signals')