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

IO191 - Setup

IO191 - Setup — Configure the IO191 input/output blocks

Library

Simulink Real-Time - Speedgoat

Description

Your model can contain only one Setup block for each I/O module in your target machine.

All the supported I/O types for this module can be configured in the Setup block dialog box. This block will therefore have an impact on all the other driver blocks (Analog input, Analog output, Digital input and Digital output).

Ports

This driver block has no input or output ports.

Parameters

The four tabs of the setup parameter dialog box contain the IO191 I/O module configuration settings.

Main Tab
Module ID

The Module ID has two functions:

  • It defines the logical connection between the Setup block and its I/O blocks

  • It also informs the auto-search feature of the PCI Slot parameter. If only one I/O module of this type is installed, the Module ID must be set to 1. If n modules are installed, it must be in the range 1:n. Not all the I/O modules installed in the target machine need to be used. To see how each I/O module maps to a Module ID, use this Speedgoat API:

    speedgoat.getIoInterfaces("TargetName", "mySpeedgoat")
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 kind, the Module ID defines which module is associated with this block. To see how each I/O module maps to a Module ID, use this Speedgoat API:

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

  • 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 – usually, auto-search is the best option.

Analog Inputs Tab
Active Channels

Choose the active input/output channels by selecting the corresponding checkboxes. For each active channel, a separate row for the channel settings is displayed.

[Note]Note

Analog Input channels must be selected in consecutive order.

Mode

Select either Single-Ended or Differential. For single-ended channels, each output signal is referenced between the Analog Input line and the analog ground. For differential channels, the voltage is referenced between the Analog Input (+) line and the Analog Input (-) line. For more information, refer to the I/O pin mapping section.

Enable DMA

Enables incoming data to be transferred over DMA. It also allows much higher system sampling rates to be achieved as the CPU does not have to process the data transfer. In addition, frame-based operation is possible, meaning that multiple samples can be received from the I/O module in one sample hit. If Enable DMA is active, the model or subsystem containing the Analog input block must be triggered with the I/O module DMA interrupt for consistent results. Refer to the usage notes for more information.

Frame Size, Clock Divider and Sample Time

Parameter dependency is as follows: Frame Size = Sample Time × (ADC Rate / Active Channels). By defining two parameters, the system will determine the third parameter automatically when the third parameter is set to -1.

Example Frame Size equal to 1, Clock Divider equal to 6250, and Sample Time as -1. Sample Time is computed automatically to be 1 [ms].

Frame Size

Defines how many samples are transferred from the module at each sample hit. The output ports of every channel become a vector with the same number of values, where the value at position 1 is the first taken. Enter "-1" to allow the system to determine the Frame Size automatically.

Clock Divider

During non-DMA operation, the Simulink model triggers each conversion, but during DMA operation, the hardware does this independently from the model and therefore needs a clock. The ADC Rate is calculated internally by dividing the base clock of the module (50 [MHz]) by the Clock Divider value. The ADC Rate defines the available frequencies. Enter "-1" to allow the system to determine the Clock Divider automatically.

Sample Time

Define the base sample time at which the Analog input block gets its sample hit. Enter "-1" to allow the system to determine the Analog input block Sample Time automatically.

Input Range

Select the voltage range for the input channels. Single-ended: ±0.64 V, ±1.28 V, ±2.56 V, ±5.12 V or ±10.24 V. Differential: the same as the single-ended plus: ±20.48 V or ±24.576 V.

Analog Outputs Tab
Active Channels

Choose the active input/output channels by selecting the corresponding checkboxes. For each active channel, a separate row for the channel settings is displayed.

Output Range

Select the voltage range for the output channels: 0–5 V, 0–10 V, ±5 V, ±10 V or ±2.5 V.

Initial Value

Define the initial signal level present on the specific output after the application has been downloaded. The values can be set individually by entering the initial value for each channel according to the selected output range.

Reset to Initial Value

Define whether the initial value is also applied once the application has stopped. The behavior can be set individually for each channel using the checkbox.

Digital I/O Tab
Channels 1-8

Select the Input or Output direction for channels 1 to 8. For Output, the options Initial Value and Reset to Initial Value are displayed for each channel.

Channels 9-16

Individually select the Input or Output direction for channels 9 to 16. For Output, the options Initial Value and Reset to Initial Value are displayed for each channel.

Initial Value

Define the initial signal level present on the specific output after the application has been downloaded. The values can be set individually by choosing the initial value for each channel to be either Low (0) or High (1).

Reset to Initial Value

Define whether the initial value is also applied once the application has stopped. The behavior can be set individually for each channel using the checkbox.