Support : Knowledge base

Knowledge Base

Welcome to OPAL-RT’s Knowledge Base

OPAL-RT offers a repository of support information for optimal use of its technology.

Loading…

Please note that OPAL-RT knowledge base is not fully optimized for mobile platforms.

For optimal experience, use a desktop computer.

Reference Number: AA-02301// Views: AA-02301// Created: 2024-04-04 16:01:35// Last Updated: 2024-04-04 16:11:36
HowTo
How the naming of .mat files generated by OpWriteFile block gets updated dynamically during simulation

Information for OpWriteFile block can be found in this article1


If you refer to the demo model with the OpWriteFile block, you can take the following configuration for reference, 

 
               For example, assuming:
  • the Filename parameter is 'myfile.mat'
  • the static filename option is unchecked
  • a constant with a value of '12' is connected to the second input pin
  • There is no OpTrigger block




Then, as soon as the simulation starts, the OpWriteFile block will write to a file named 'myfile_12.mat'. Assuming the constant value changes from 12 to 15, then the file 'myfile_12.mat' will be closed (even though the max file is not reached) and a new one called 'myfile_15.mat' will be opened and the recording will continue in the new file.

If the OpTrigger block is present and the Static filename changes, the previous file will be closed but the OpTrigger block needs to be triggered again to start the recording in the new file.

To recover the files from the simulator check this KB article2

-> RT-LAB should be opened along with the project too to recover the files into the host pc

-> Note that the .mat file which is transferred to the host pc (running in windows os) is stored in the OpREDHAWKtarget folder, for more information refer to the KB article https://www.opal-rt.com/support-knowledge-base/?article=AA-00872