Welcome to OPAL-RT’s Knowledge Base
OPAL-RT offers a repository of support information for optimal use of its technology.
Please note that OPAL-RT knowledge base is not fully optimized for mobile platforms.
For optimal experience, use a desktop computer.
Reference Number: AA-02083 // Views: 11 // Created: 2022-08-03 23:23:48 // Last Updated: 2022-09-09 15:25:05
Using OPAL-Boards with RT Events
Using Opal Boards with RT Events
Although our Opal boards workflow handles I/O mapping differently than our older s-function workflow, it is still completely compatible with RT Events and the Event Generator/Detector blocks. This article will show you how to set up your model and configure the I/O Interface.
For this example, we will need to create a model with the following blocks:
In this model, we will use the SPWM block to create a PWM signal, convert it from the RTE data type to two vectors (one for states and one for timestamps) with the RTE Conversion block, and then send it out over the digital out card which is connected to the digital in card. Once the two vectors are brought back into the model via the digital in card, we will convert them back to an RTE data type with the complimentary RTE Conversion block. After that, we will send the data to an RTE Frequency block to convert the data into the frequency and duty cycle of the PWM signal. Refer to the image below:
A link to download this model is provided at the end of the article
We need to make sure that the maximum number of events is the same for the RTE SPWM block, the RTE Conversion blocks, the OpInput blocks, and in the Opal board configuration. Refer to the following screenshots for each of these blocks:
For the Opal board (OpInput block), we need to set the default value equal to the maximum number of events. In our example, we have set this to 100, so we will need to create a vector of 100 zeroes to represent each events value (one or zero) and timestamp.
Now that our model is set up, we need to configure the Opal boards.
OPAL Boards and I/O Interface
Before we can configure the OPAL Boards, we need to make sure that the I/O Interface has been set up properly. Refer to this article for instructions: How To use Opal-RT Boards
Once the I/O Interface has been set up, we are ready for the next step. After the model has been built, you will see in the RT-LAB project explorer that the OpOutputs have 100 elements for states and 100 elements for times: