Main Content

File System I/O

You can use file I/O blocks in Connected IO mode or accelerator mode simulation in real time. In these modes, the real-time kernel does not perform I/O, Simulink® itself does.

When run in Run in Kernel mode, the Simulink Desktop Real-Time™ software does not include a file system. In a Simulink Desktop Real-Time model, you cannot use blocks that generate file I/O calls such as fopen or fprintf. Examples of such blocks are To File and From File. To access files in Run in Kernel mode, use the Packet Input, Packet Output, Stream Input, or Stream Output blocks, and select the driver Standard Devices > File.

If a Simulink Desktop Real-Time model contains an I/O block, an error can occur when you try to compile or use Run in Kernel mode with the model. Even if no error occurs, the block has no effect on either simulation or code execution.

To log signal data without a file system, use the techniques described in Signal Logging to the Workspace. For information about using Run in Kernel mode to execute a Simulink Desktop Real-Time application, see Execute Real-Time Application in Run in Kernel Mode by Using Run in Real Time.

Related Topics