Documentation search search close
CONTENTS
https://www.speedgoat.com/help/slrt/page/icon_documentation.jpg
v10.0.1.x for R2026a
View other versions

IO94X - Relay Control

IO94X - Relay Control — Controls the IO94X relays

Library

Simulink Real-Time - Speedgoat

Description

The driver block used for configuring the driver is described in the following sections.

Ports

Inputs
Ch n (n is the channel number) Type: boolean

Controls the relay for channel n. When the input value is '1', the relay is energized, '0' puts it back to its idle state. The schematics in the section I/O pin mapping show the relays in their idle state for each module type. The number of these ports is dependent on the channel count, which is specified by the 'Channels vector' parameter. If the option "Combine all channels in one vector port" is checked, there is only one input port named "All Ch". It takes a boolean vector with a width defined by the specified number of channels to be used.

Outputs
Ch n (n is the channel number) Type: boolean

Monitors the current state of each channel's relay. When the output value is '1', the relay is energized, '0' means that the relay is in its idle state. The schematics in the section I/O pin mapping show the relays in their idle state for each module type. The port is only shown when the "Show output ports" option in the mask is checked. The number of these ports is dependent on the channel count, which is specified by the 'Channels vector' parameter. If the option "Combine all channels in one vector port" is checked, there is only one output port named "All Ch". It takes a boolean vector with a width defined by the specified number of channels to be used.

Parameters

IO94x module ID

If your target machine only contains one I/O module, leave the default value (1). If more than one I/O module of this type is present, select a unique number (1-255) for each of your modules.

IO94x module type

Select the specific type of I/O module this driver block is being used with.

Channel vector

This parameter defines which channels are used and how they are ordered on the driver block. The parameter takes a row vector with values from 1 to the number of channels supported by the selected module.

Initial value(s) vector

Defines the initial state of the relays. Valid values are '1': relay energized or '0': idle position. A scalar value or a vector of the same length as the "Channel vector" can be entered. If a scalar value is specified, this value is applied to all channels. If a vector is specified, the values are mapped to the channels as defined in "Channel vector". The relays are set to their initial states between the time the model is downloaded and the time it is started. Before the model is downloaded, all relays are in their idle state (see I/O pin mapping).

Reset value(s) vector

The reset vector controls the behavior of the relays at model termination. A scalar value or a vector of the same length as the "Channel vector" can be entered. If a scalar value is specified, this value is applied to all relays. If a vector is specified, the values are mapped to the channels as defined in "Channel vector". If a value of '1' is entered, the corresponding relay will be reset to the state specified in the initial value vector. If a value of '0' is entered, the relay retains the last state set during model execution.

Combine all channels in one vector port

When checked, there is only one input port named "All Ch". It takes a boolean vector with a width defined by the specified number of channels to be used. This also applies to the output port, if enabled.

Show output ports

Enables or disables the output ports.

Sample Time

Defines the base sample time at which this driver block gets its sample hit. This parameter can also be set to -1 for inherited sample time. The units are in seconds.

PCI Slot (-1: auto-search)

There are two approaches for mapping this block to a specific I/O module installed in your target machine. All modules of the same type must be configured using the same method.

  • Auto-Search: with the default value -1 the I/O module will be automatically located in the target machine. If you have multiple modules of the same type, you must use explicit addressing.

  • Explicit Addressing: to explicitly define the logical address of the I/O module in the target machine, you can provide the PCI bus and slot numbers as a vector: [bus, slot]. To determine these numbers, run the following command in the MATLAB command window:

    speedgoat.getIoInterfaces("TargetName", "mySpeedgoat", "Advanced", true)

    Note that the PCI address can change whenever an I/O module is added or removed.