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.

OP5110-5120 Quad Generator




The OP5110-5120 Quad Generator block generates quadrature signals on output pins of an OP5110 or OP5120 card, formerly named OPHSDIOcard.

The OP5110-5120 Quad Generator block generates transitions on digital output pins to represent the behavior of channel A and channel B of a quadrature signal, as well as the Index signal. The block also supports differential mode, and in this case, it also generates the 3 complementary signals channel A-, channel B- and Index-. The frequency and direction of the signals can be changed at each time step.

The OP5110-5120 Quad Generator block accepts as inputs the vector of signal frequencies and the vector of directions. The underlying software makes use of the event generation feature of the OP5110 or OP5120 card and can produce as many as 511 transitions per port during one calculation step.

The figure below shows an example of quadrature signals A, B and Index. In this case, channel A leads channel B. The resolution of the signal is 2, so the index pulse is output only at the end of the second cycle.

Synchronization with the model calculation step:
In order to ensure proper synchronization with the model clock, the OP5110-5120 Quad Generator block must be used in conjunction with an OP5110-5120 OpSync block. The OP5110-5120 OpSyncblock is a hardware synchronization block. It ensures the stability of the calculation time-step and serves as a time reference for other OP5110-5120 blocks (such as OP5110-5120 Event Detector, OP5110-5120 Event Generator). Formore information, please refer to the documentation of the OP5110-5120 OpSync block.


Target environmentSelect between RT-LAB and xPC Target.
Bus TypeSelect the bus type of the target node in this list.
Card TypeSelect the car model in this list.
Board IndexEnter the board index of the card [see board index limitations in the characteristics section below].
PCI slot (-1:autosearch)

This option is only available for xPC Target environment.

If only one OP5110 board is present in the xPC target PC, enter


to automatically locate the board.

If two or more boards of this type are in the target PC, enter the bus number and the PCI slot number of the board associated with this driver block.Use the format [BusNumber, SlotNumber]. To determine the bus number and thePCI slot number, in the MATLAB command window, type

getxpcpci all

PortThis popup allows the user to specify which I/O port of the OP5110 or OP5120 board is used. A different OP5110-5120 Quad Generator block must be used for each I/O port.
Pin number ch. A+ [0..7](B+, Index+, A-, B-, Index- on adjacent lines)Enter the pin number of channel A. The block will automatically reserve the adjacent pins for channels B+, I+ (if needed), A-, B- and I- (if needed). If more than one pin value is set in this list, the block will assume that two independent quadrature signals must be generated and that the pin numbers entered here represent channels A1, A2, etc. Enough pins should be left between A1 and A2 for the adjacent lines that the block will automatically reserve.

An example is shown in the table below in which we assume that [0] is entered in the mask. The 'Next Available' column indicates the first pin available for other quadrature signals, Event Generator or APWM Out signals. [Obviously, in differential mode with generation of the Index pulse, it is not possible to generate 2 independent quadrature signals on the same I/O port, since only pins 6 and 7 are left available].

A+B+I+A-B-I-Next Available Pin

Single-Ended with Index012

Differential with Index0123456
Output index channelThis box must be checked for the index signal to be generated.
PolarityThis popup allows the user to invert the polarity of the output signal. Note that all signals (A, B and I) have the same polarity.
ModeThis popup allows the user to choose between single-ended and differential mode. In differential mode, the 3 additional complementary signals for channels A-, B-, and I-(if the Output index channel box is checked) are generated.
Resolution (# of cycles per revolution)Enter here the number quadrature signal cycles that will be output during one period.
Clockwise rotationUse this popup to select whether channel A leads channel B by 1/4th cycle or channel B leads channel A.
Frequency limits [FminFmax] in HertzEnter the minimum and maximum values of the signals that the block is allowed to generate. The maximum value should take into account the fact that the underlying software uses the Event Generator feature of the OP5110 or OP5120 boards, which limits the number of transitions per port per time step to 511.
Reset in PauseThis option is not yet available.


FreqVector of frequency values (in Hz) of the quadrature signals. This inport must have the same size as the output channel selection list.
DirectionVector of direction values. Thisinport must have the same size as the output channel selection list. The underlying software uses only the sign of each value to determine the direction of the quadrature signal.


StateThis output gives the predicted states (high=1 or low=0) of the channel A pins at the end of the current calculation step.
CycleThis output gives the numbers of the current cycle of each quadrature signal.

Characteristics and Limitations

Board Index Limitations

On the OP5120 boards (PC-104 format), the board index is user-selectable in the range [0-15] via a connector on the board. However, boardsOPHSDIO64 labeled v0.01 do not implement this feature, and the board index of these boards is set to the default value 15.

On the PCI boards (OP511x family), the board index is user-selectable in the range [12-15], via the jumpers JP8 on the board:

Connector Pin Assignments

OP5110-5120 boards usually ship with custom-made cables adapted to the signal conditioning required by the system they are to be connected to. Please refer to the documentation of your system for your specific connector pin assignment. If you need to prepare your own custom cable, please contact support@opalrt-com.

Direct FeedthroughNo
Discrete sample timeNo
XHP supportYes
Work offlineNo

OPAL-RT TECHNOLOGIES, Inc. | 1751, rue Richardson, bureau 1060 | Montréal, Québec Canada H3K 1G6 | | +1 514-935-2323