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-02083// Views: AA-02083// Created: 2022-08-03 23:23:48// Last Updated: 2022-09-09 15:25:05
HowTo
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.

RT-Lab Model

For this example, we will need to create a model with the following blocks:

  • OpInput and OpOutput
  • RTE Conversion Event Generator and Event Detector
  • RTE SPWM
  • RTE Frequency Meter

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:

RTE SPWM

RTE Conversion

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:

In the OpalBoards, set the Digital out as Event Generator, set the time unit as Time Ratio, and set 100 events per channel (only 1 channel used by your model though):

In the Configuration panel, connect the States OpInput to Events and connect the Times OpInput to the Timestamps:

Finally, make sure you have a DB37 cable connected between your digital in and digital out cards with a digital reference voltage set.

RTEvents_OpalBoards.zip 14.7 Mb 14.7 Mb