Page Content
Table of Contents |
---|
...
Depending on the system you purchased, you may have received an integration model specific to your hardware configuration; it was designed to interact with the hardware included in your simulator. Each system is delivered with a special model that uses all I/Os available on your simulator.
The model used in this guide may be different from the one you received, but the general components and instructions are similar.
1: Create a new project based on the integration model
...
|
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
...
Importing project window
...
. 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 project
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]
...
Depending on your system, you may see the following blocks:
- Analog input (Ain) and output blocks (Aout),
- Static digital input (Din) and output blocks (Dout),
- PWM input (PWMin) and output blocks (PWMout), and,
- Event detector (TSDin) and Event generator blocks (TSDout).
SC_[name] stands for subsystem console. This will be an asynchronous subsystem that will run on your host computer and will act as a user interface. No critical mathematical logic should be included in this subsystem.
...
color | #D3D3D3 |
---|
Note: Some components of the model will be in both SM (computation) and SC (interface) subsystems (computation components are only in the SM subsystem).
Each of the simulator I/O configurations are described in “SystemDescription_[Customer Name]_[Project Number].pdf” included in the DVD. The I/O model will read and simulate all of your system’s I/Os.
3: Build the model
- Drag the integration model onto your target to preconfigure it.
- Since you have already configured the build process, simply click the Build toolbar button and wait a few seconds while the model is compiled.
4: Verify the configuration
Since this model uses I/Os, some additional steps are required.
...
(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
...
Sample of possible interactions with the running model
6. See external I/Os
The specific I/O configurations for your simulator are provided in the SystemDescription_[Customer Name]_[Project Number].pdf document of your Integration Binder (in section B – Mapping I/O Blocks to signal conditioning).
...
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.
...