File System I/O

You can use file I/O blocks in Simulink® normal 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 external mode, the Simulink Desktop Real-Time™ software does not include a file system. Therefore, 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 external 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 external 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 external mode to execute a Simulink Desktop Real-Time application, see Execute Real-Time Application in External Mode.

Was this topic helpful?