Showing results for 
Search instead for 
Did you mean: 
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.

Simulink Signal-Logging

Simulink Signal-Logging

Often users put many 'To Workspace' sink blocks throughout their schematic. However, they may be best served by using Simulink’s signal logging features. (See “Logging Signals” in Simulink Help which explains all).

You can turn on signal logging for individual signals without the need for any ‘To Workspace’ Blocks, or you can just enable logging for a scope, of course. (In both cases name your signals appropriately first). You can do this programmatically, so could, for example, write a script that will turn on signal logging for all signals in a given subsystem if desired.

You can then access them and plot, analyse etc – using Fixed Point Toolbox functions if desired. E.g.


Here I’ve logged Sim_Sum and dspba_sum

I can then do, for example,

>> logsout

logsout =

Simulink.ModelDataLogs (fixedptlogtest):

Name Elements Simulink Class

dspba_Sum 1 Timeseries

Sim_Sum 1 Timeseries

Or you access by subsystem Simulink.SubsysDataLogs, or by signals logged via a scope Simulink.ScopeDataLogs

>> data = logsout.('dspba_Sum')

Name: 'dspba_Sum'

BlockPath: 'fixedptlogtest/Subsystem'

PortIndex: 3

SignalName: 'dspba_Sum'

ParentName: 'dspba_Sum'

TimeInfo: [1x1 Simulink.TimeInfo]

Time: [1001x1 double]

Data: [1001x1]

>> data = logsout.('dspba_Sum').Data

data =














0.0937 (etc)

>> max(logsout.('dspba_Sum').Data)

ans =


DataTypeMode: Fixed-point: binary point scaling

Signedness: Signed

WordLength: 19

FractionLength: 14

>> plot(logsout.('dspba_Sum').Time,logsout.('dspba_Sum').Data)

Note that one thing that you can’t really do with this is make use of the override features of the fixed point type to identify underflow & overflows – this is because DSPBA explicitly does the maths according to the output type using its own internal format and constructs the result accordingly, rather than do the math using Fixed point types directly

For example, if you change the fixed point preferences :

>> fipref

ans =

NumberDisplay: 'RealWorldValue'

NumericTypeDisplay: 'full'

FimathDisplay: 'full'

LoggingMode: 'Off'

DataTypeOverride: 'ForceOff'

>> fipref.LoggingMode = 'On'

fipref =

LoggingMode: 'On'

>> fipref.DataTypeOverride = 'ScaledDoubles'

fipref =

LoggingMode: 'On'

DataTypeOverride: 'ScaledDoubles'

The Simulink Sum block will record an overflow,

Warning: Overflow occurred. This originated from 'fixedptlogtest/Sum'.

but none of the DSPBA blocks will.

Version history
Last update:
‎06-26-2019 09:36 PM
Updated by: