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

  1. Open RT-LAB and click the File menu, then select Import.

  2. In the Import window, choose RT-LAB > Existing RT-LAB Project. Click Next.

  3. In the Import Projects window, choose Select archive file, then click Browse and navigate to the root directory of your project on your computer.

  4. Choose and open your integration model *.zip file.

  5. Click Finish to import the project.

image-20241119-212730.png
image-20241119-212340.png

Step 2: Open the Model in Simulink

  1. Right-click on the model and select Edit with, then choose your MATLAB version. MATLAB will launch with your model.

image-20241120-161534.png
  1. 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:

image-20241120-155858.png
  1. 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

  1. Right-click your target name and select Set as development node.

  2. Click the Build button in the toolbar. The model will compile within a few seconds.

image-20241120-160824.png
image-20241120-160735.png

Step 4: Verify the Configuration

  1. Open the Execution tab and ensure that the Real-time simulation mode is set to Hardware synchronized.

image-20241120-162051.png
  1. Open the Assignation tab and ensure that the XHP box is checked (enabled).

image-20241120-185102.png

Step 5: Load and Execute the Model

  1. Click the Load button and wait for the process to complete.

  2. Click Execute. A new Simulink console window will appear.

image-20241120-164553.png
  1. You can observe the signals in the Simulink scopes and displays.

image-20241120-192926.png
  1. You can also use an oscilloscope to probe analog and digital outputs of the simulator.

Step 6: Reset the Model

  1. Click the Reset button to stop the simulation and reset the model execution.

image-20241120-165210.png

 

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