Simulink Real-Time Data Logging with File Scope

15 vues (au cours des 30 derniers jours)
MathWorks Support Team
MathWorks Support Team le 11 Juin 2018
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

Réponse acceptée

MathWorks Support Team
MathWorks Support Team le 30 Sep 2020
Modifié(e) : MathWorks Support Team le 30 Sep 2020
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. More information on File Scope usage can be found here:
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:\')

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by