Documentation Home Page ◇ RT-LAB Home Page
Pour la documentation en FRANÇAIS, utilisez l'outil de traduction de votre navigateur Chrome, Edge ou Safari. Voir un exemple.
Using your Integration Model with IOs
Page Content
Your system includes custom I/O test models designed to verify the functionality of the simulator's I/O capabilities. These models rely on loopback connections, where signals are generated by the simulator, output through an output card, and then fed back into an input card to confirm proper operation. This process ensures the system can accurately generate, output, measure, and input signals.
For simple configurations, such as a single AO (Analog Output) card and AI (Analog Input) card, loopback testing is straightforward: use a loopback cable to connect the AO card's output to the AI card's input. The same principle applies to DO (Digital Output) and DI (Digital Input) cards. However, when using a DO card, ensure the loopback cable is properly powered. Refer to the System Description Document in the CD or USB drive included with your system package for more details.
For more complex configurations, such as systems with multiple AO or DO cards but only one AI or DI card, testing can be performed sequentially. Start by connecting the first AO card to the AI card and verifying functionality. Additional AO cards can then be tested one at a time, depending on your testing requirements. It is important to note that some test models may only work with specific I/O cards (e.g. the first AO card). If you have any doubts, please don't hesitate to contact our support team.
Although the model used in this guide might differ from the one provided with your system, the general components and steps are similar. Given the variety of system configurations, specific details about I/O pin assignments and card setups are provided in your System Description Document.
Prerequisite
Download the RT-LAB project *.zip file(s) from the Test_models > rtlab_project folder on the CD or USB drive included with your system package.
Step 1: Create a New Project from the Integration Model
Open RT-LAB and click the File menu, then select Import.
In the Import window, choose RT-LAB > Existing RT-LAB Project. Click Next.
In the Import Projects window, choose Select archive file, then click Browse and navigate to the root directory of your project on your computer.
Choose and open your integration model *.zip file.
Click Finish to import the project.
Step 2: Open the Model in Simulink
Right-click on the model and select Edit with, then choose your MATLAB version. MATLAB will launch with your model.
Analyze the model for I/O setup and monitoring.
In the root layer of your Simulink model, you will find two subsystems: SM_[name] and SC_[name]:
SM_[name] (Subsystem Master) contains all the real-time simulation components. It includes all I/Os and is the only part that runs on the simulator.
SC_[name] (Subsystem Console) runs asynchronously on your host computer, acting as the user interface. Avoid placing critical mathematical logic here.
The test model is an excellent resource for understanding how to set up loopback connections. In the SM_[name] (Subsystem Master), I/Os are explicitly labeled, making it easier to determine which connections are needed. Here is a simple example:
Save the model in Simulink.
* As a reminder, consult your System Description Document. Ensure digital output boards are powered with an external source connected to the Vuser pins and grounded on Vrtn pins. For more information about the use of Vuser and Vrtn pleaser refer to this article in the OPAL-RT knowledge base : How to power the different DB37 boards for digital outputs.
Step 3: Build the Model
Right-click your target name and select Set as development node.
Click the Build button in the toolbar. The model will compile within a few seconds.
Step 4: Verify the Configuration
Open the Execution tab and ensure that the Real-time simulation mode is set to Hardware synchronized.
Open the Assignation tab and ensure that the XHP box is checked (enabled).
Step 5: Load and Execute the Model
Click the Load button and wait for the process to complete.
Click Execute. A new Simulink console window will appear.
You can observe the signals in the Simulink scopes and displays.
You can also use an oscilloscope to probe analog and digital outputs of the simulator.
Step 6: Reset the Model
Click the Reset button to stop the simulation and reset the model execution.
OPAL-RT TECHNOLOGIES, Inc. | 1751, rue Richardson, bureau 1060 | Montréal, Québec Canada H3K 1G6 | opal-rt.com | +1 514-935-2323
Follow OPAL-RT: LinkedIn | Facebook | YouTube | X/Twitter