TwinCAT File Writer

The TwinCAT File Writer block writes .mat files from the TwinCAT environment. The block only fulfills this function if the Simulink® model has already been transferred to a TcCOM or FB and is executed in a TwinCAT Runtime. If the Simulink® model is executed in Simulink®, this block has no function.

TwinCAT File Writer 1:

Parameter

Description

Note

Port data type

Data type of the incoming signal

Support is offered for:

  • Integer Types
  • float
  • double
  • boolean
  • enums
  • bus objects

Port dimension

Dimensionality of the incoming signal

-1 -> Inherit
Otherwise [1.2], [1.5], ..., for example

SampleTime

Block Sample Time in seconds

-1 -> Inherit

file name

File name of the .mat file

Full path or relative path possible. Relative path relative to TwinCAT\3.1\Boot.

Maximum file byte size

Maximum size (in bytes) of the .mat file. When this size is reached, the current file is closed and a new one is started.

0 -> Maximum due to file format

Maximum file count

Maximum number of .mat files to write.

0 -> Infinite files. If the maximum is reached, old files are overwritten, starting with _part0.mat.

Pause writing files

Pauses writing

Parameters on the TcCOM

Write simulation time with data

Writes per date a structure with 2 fields, "time" and "data".

 

Expose Pause as block input

Creates an input via which the TwinCAT File Writer can be paused.