To File Block and MAT-file logging

You can configure your Simulink® models to generate MAT files on the file system of the runtime PC in the form of a TcCOM object in TwinCAT runtime.

To File Block and MAT-file logging 1:

Observe write permissions on the runtime PC

Note the write permissions on the path you want to write to.

MAT-file logging

Configuration from Simulink®:

If a TcCOM object is created with these settings and activated in a TwinCAT configuration on a runtime system, model signals are saved in a MAT file according to the properties specified by MathWorks®.

The MAT file is created on the file system of the runtime PC in the TwinCAT boot directory.

To File Block

Configuration in Simulink®:

If a TcCOM object is created with these settings and activated in a TwinCAT configuration on a runtime system, a MAT file is created at the configured position.

Notice

Sufficient storage space

Note that you must keep enough storage space on the target system to avoid unpredictable behavior of the runtime PC.

TwinCAT File Writer

You can precisely control data logging at runtime with the TwinCAT File Writer. The TwinCAT File Writer can terminate file packages of defined size and generate a specified set of files on the runtime system. Thus, there is no danger of reaching the limit of the target system memory.

Documentation of the block can be found here.