Signal Logging with MATLAB

Signal value logging

To log signal values and times, add a real-time file scope with MATLAB®. A file scope creates a file on the target computer that you can download to the development computer for offline analysis.

Objects

SimulinkRealTime.targetRepresent real-time application and target computer status
SimulinkRealTime.fileScopeRecord time-domain data on target computer file system
SimulinkRealTime.fileSystemManage folders and files on target computer

Functions

addscopeCreate a scope of specified type
getscopeReturn scope identified by scope number
remscopeRemove scope from target computer
addsignal (fileScope,signal)Add signals to file scope represented by scope object
remsignal (fileScope,signal)Remove signals from file scope represented by scope object
start (fileScope)Start execution of file scope on target computer
stop (fileScope)Stop execution of file scope on target computer
trigger (fileScope)Software-trigger start of data acquisition for file scope
SimulinkRealTime.utils.getFileScopeDataRead real-time Scope file format data
SimulinkRealTime.utils.bytes2fileGenerate file for use by real-time From File block

Topics

Background

Signal Logging Basics

Acquire signal data while running a real-time application and transfer the data to the development computer for analysis.

File System Basics

Access the target computer file system with the SimulinkRealTime.fileSystem object.

Signal Logging Buffer Size

Calculate the buffer size that is required for signal logging.

Simulink Real-Time Scope Usage

Learn about usage issues that are common to all Simulink® Real-Time™ Scope types.

File Scope Usage

Learn about usage issues that are unique to file scopes.

Scope Trigger Configuration

Learn about configuring scopes so that they wait until triggered to acquire data.

Pretriggering and Posttriggering of Scopes

Learn about configuring scopes so that they acquire data before or after the trigger event.

Trigger One Scope with Another Scope

Learn about configuring scopes so that they acquire data in response to the triggering of another scope.

Signal Logging

Log Signal Data with Outport Block and MATLAB Language

Log signal data by using an Outport block and Simulink Real-Time specific logging functions.

Configure File Scopes with MATLAB Language

Prepare to log data to a file on the target computer.

Minimize Data Gaps with Two Scopes

Acquire data that two scopes acquire consecutively, with minimal overlap or gaps.

File Scope Data Acquisition

Acquire Signal Data with File Scopes

Acquire signal and time data and store it in a file on the target computer.

Acquire Signal Data into Dynamically Named Files

Acquire signal and time data and store it in multiple, dynamically named files on the target computer.

MATLAB Interface

Real-Time Application Objects

Use the MATLAB Command Window to change properties and control the target computer and your real-time application.

Real-Time Scope Objects

Use the Command Window to change properties and control signal logging and signal tracing.

Using SimulinkRealTime.fileSystem Objects

Read, write, copy, and delete files on the target computer file system from the Command Window.

Limitations

Troubleshoot Signals Not Accessible by Name

Investigate issues for some signal types prevent monitoring, tracing, or logging.

Internationalization Issues

Learn about Simulink Real-Time support for internationalization.

Troubleshooting

Troubleshooting in Simulink Real-Time

Troubleshoot problems that you encounter while using the Simulink Real-Time product.

Featured Examples