Documentation

File System Basics

Simulink® Real-Time™ file scopes create files on the target computer. To work with these files from the development computer, see File System. The SimulinkRealTime.fileSystem object allows you to perform file system-like operations on the target computer file system.

You cannot direct the scope to write the data to a file on the Simulink Real-Time development computer. When the software has written the signal data file to the target computer, you can access the contents of the file from the development computer.

The software can write data files to:

  • Hard drive — The target computer hard drive supports a serial ATA (SATA) drive. The Simulink Real-Time software supports file systems of type FAT-32 only.

    Check that the hard drive is not cable-selected and that the target computer BIOS can detect it. The maximum file size is limited by the FAT-32 file system type.

    A Simulink Real-Time file scope can access the target computer hard drive, provided it is formatted with the FAT-32 file system. Simulink Real-Time ignores other file systems.

    Note

    In a future release, the SecondaryIDE target setting will be read-only and set to 'off'.

  • ERAM drive — If the target computer has more than 4 GB of RAM, the kernel automatically formats the excess memory as an extended RAM (ERAM) drive. The kernel assigns the ERAM drive the drive letter 'H:'. Use the ERAM drive when you need faster file I/O than you can achieve with other drive types.

    The limitations for hard drives also apply to the ERAM drive.

  • USB drive — To write data files to a USB drive, you must set the USB Support property in Simulink Real-Time.

  • 3.5-inch disk drive – Writing data files to a 3.5-inch disk drive is considerably slower than writing to a hard drive.

There are the following limitations:

  • You can have at most eight files open on the target computer at the same time.

  • The largest single file that you can create on the target computer is 4 GB.

  • A fully qualified folder name can have a maximum of 248 characters, including the drive letter, colon, and backslash.

  • A fully qualified file name can have a maximum of 260 characters: The file part can have at most 12 characters: eight for the file name, one for the period, and at most three for the file extension. A file name longer than eight characters is truncated to six characters followed by '~1'.

  • Do not write data to the private folder on your target computer. It is reserved for Simulink Real-Time internal use.

You can access signal data files, or other target computer system files, in one of the following ways:

  • If running the target computer standalone, you can access a file by restarting the target computer under an operating system such as DOS. You can access the file through the operating system utilities.

  • If running the target computer linked to a development computer, you can access the target computer file system from the development computer using a SimulinkRealTime.fileSystem function.

You can perform file transfer operations using the functions SimulinkRealTime.copyFileToHost and SimulinkRealTime.copyFileToTarget.

You can perform file system-like tasks using functions such as SimulinkRealTime.fileSystem.fopen and SimulinkRealTime.fileSystem.fread on the signal data file. File system functions work like the corresponding MATLAB® file I/O functions.

The SimulinkRealTime.fileSystem class also includes file system utilities that allow you to collect target computer file system information for the disk and disk buffers.

This topic focuses primarily on using the SimulinkRealTime.fileSystem functions to work with target computer data files that you generate from a real-time Scope of type file.

For an example of how to perform data logging with file scopes, see Data Logging With a File Scope.

Was this topic helpful?