Simulink Real-Time Data Logging with File Scope

I am using a File Scope in my Simulink Real-Time model to log data. However, after simulation no data has been logged. Additionally, when trying to access the file system of my target from MATLAB, I get the following error:
>> tg = slrt; >> fsys = SimulinkRealTime.fileSystem(tg); >> dir(fsys)
Error: -8: invalid file system

 Accepted Answer

In the File Scope, specify the full path of the data logging file, e.g. 'D:\data.dat'. If only the file name is entered, the file scope automatically tries to write to the 'C:\' drive. If the target has no 'C:\' drive, the data will not be written anywhere. 
Tp find more information on  File Scope usage, please run the following command in the command window of MATLAB R2020a to access the release-specific documentation:
>> web(fullfile(docroot, 'xpc/ug/file-scope-usage.html'))
Additionally, if you omit the drive letter from the "dir" command, it assumes that the folder path is relative to the default drive. Therefore, please specify the correct drive letter for your computer if it has no "C:\" drive, for example:
>> dir(fsys, 'D:\')
Please follow the below link to search for the required information regarding the current release:

More Answers (0)

Categories

Find more on Prepare Model Inputs and Outputs in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!