MATLAB: Are the functions to transfer files to or from the Simulink Real-Time target not available in R2020b

copyfiletohostcopyfiletotargetfilesystemopenftpslrt

After upgrading to R2020b, the following Simulink Real-Time functions in my script do not work anymore:
  • SimulinkRealTime.openFTP
  • SimulinkRealTime.fileSystem
  • SimulinkRealTime.copyFileToTarget
  • SimulinkRealTime.copyFileToHost
I am getting the following error when using any of them:
Unable to resolve the name SimulinkRealTime.openFTP.
How can I access the file system of my Speedgoat target computer, and transfer files to or from my target computer, in R2020b or later?

Best Answer

With the removal of "File Scope" and "From File" blocks in R2020b, there is little reason for a user to manually transfer files to and from the target computer.
Note that FTP is still supported and can be used directly via the MATLAB "ftp" object. However, manually moving files between host and target is discouraged.
Consider the following alternative workflows depending on your use-case:
Use-Case 1: Transfer simulation data logged on the target computer to the host PC
The block "File Scope" was replaced by "File Log" in R2020b. When using "File Log" block, the file log runs are either automatically transferred from the target computer to the host PC at the end of the simulation, or they can be imported using dedicated functionality. For detailed information, see the section "How do I I manually import File Logs into MATLAB?" on the following page:
Use-Case 2: Transfer input data for the real-time simulation to the target computer
Use root-level input port data to supply input data for your real-time simulation. See the following page for more details: