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

IO145 - Setup

IO145 - Setup — Configure the IO145 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 IO145 I/O module configuration settings.

Main Tab
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.

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")
Clock Base Rate

This setting is only available if the Analog input or Analog output block uses DMA.

The clock base rate is used by the two clock dividers for conversion clocks 1 and 2; for example, if the clock base rate is set to 20 MHz and the clock divider is set to 1000, the resulting conversion clock is 20 kHz. On this basis, a new sample is generated or converted every 50 μs.

Clock Divider

This setting is only available if the Analog input or Analog output block uses DMA.

The IO145 I/O module has two different conversion clocks which can be used by the Analog input or Analog output blocks during DMA operation. During normal operation, the Simulink model triggers each conversion, but during DMA operation, the hardware does this independently from the model and therefore needs a clock. For more information refer to the description of the clock base rate.

Use Frame Trigger

This setting is only available if the Analog input or Analog output block uses DMA.

It enables the frame trigger, which starts the conversion of a new analog data frame at a configurable rate. For more information refer to the usage notes.

Frame Trigger Clock Divider

This setting is only available if the Analog input or Analog output block uses DMA and the frame trigger has been enabled.

It defines the frame trigger rate. One of the conversion clocks acts as the source for the frame trigger. All the blocks using DMA must use the same conversion clock. The frame trigger will choose the appropriate clock.

As the frame trigger uses a fraction of the conversion clock, the maximum frame size is equal to the divider; for example, if the frame trigger clock divider has a value of 100, then the analog input frame size can be between 1 and 100 samples.

Analog Input Tab
Current Input Group 1&2

The following settings correspond to the ADC1 and ADC2 of the IO145 which are dedicated to analog current measurements.

Signal Mode

The signal mode for current measurement is always differential.

Available Channels

This indicates the available channels per input group, which can be activated.

[Note]Note

The input channels can only be used in sequential combination per ADC. This means that if one channel per ADC is required, only channels 1, and 5 can be used. If two channels per ADC are required, only channels 1 and 2, channels 5 and 6 can be used, and so on for three channels per ADC.

Current Range

Differential mode: ±25 mA

The current range applies to all channels within the same input group.

Voltage Input Group 1&2

The following settings correspond to the ADC3 and ADC4 of the IO145 which are dedicated to analog voltage measurements.

Signal Mode

Select the signal mode for each input group: Differential or Single-Ended.

Available Channels

This indicates the available channels per input group, which can be activated depending on the chosen signal mode.

[Note]Note

The input channels can only be used in sequential combination per ADC. This means that if one channel per ADC is required, only channels 9 and 17 can be used. If two channels per ADC are required, only channels 9 and 10, and channels 17 and 18 can be used, and so on for three channels per ADC.

Voltage Range

Differential mode: ±10 V, ±20 V, ±40 V, ±80 V, and ±96 V

Single-ended mode: ±10 V, ±20 V, ±40 V, and ±48 V

The chosen voltage range will apply to all channels within the same input group.

Set Voltage Range per Channel

Enable individual voltage range selection per channel for each input group.

Automatic Data Correction

Enable or disable the data correction. When enabled, the factory calibrated onboard correction values are used to correct every analog-to-digital conversion.

Enable DMA

This setting 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 DMA is enabled, 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 information on configuring DMA.

Sample Clock

Select which clock is used to start the conversion of a new sample. The frequency of the clocks can be changed in the main tab.

Frame Size (samples/channel)

Select how many samples are transferred from the module at each sample hit. The block output of every channel becomes a vector with the same number of values, where the value at position 1 is taken first. Enter "-1" to allow the system to determine the frame size automatically based on the conversion clock and input block sample time.

Either the frame size or the input block sample time must be configured automatically (-1).

Input Block 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 input block sample time automatically based on the conversion clock and frame size.

Either the frame size or the input block sample time must be configured automatically (-1).

Analog Output 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 every output channel: 0-5 V, 0-6 V, 0-10 V, 0-12 V, ±5 V, ±6 V, ±10 V or ±12 V or select the current range for each output channel: 4-20 mA, 0-20 mA, 0-24 mA.

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.

Automatic Data Correction

Enable or disable the data correction. When enabled, the factory calibrated onboard correction values are used to correct every digital-to-analog conversion.

Simultaneous Channel Update

Enable or disable the simultaneous channel update. When enabled, all the analog outputs are updated simultaneously. This increases the task execution time, as the module waits for all the data to be transferred from every active channel before initiating the analog output update. When disabled, each channel is updated immediately after the data transfer.

Enable DMA

This setting enables outgoing data to be transferred over DMA. Frame-based operation is possible, meaning that multiple samples can be transferred in one sample hit. If DMA is enabled, the model or subsystem containing the Analog output block must be triggered with the I/O module DMA interrupt for consistent results. Refer to the usage notes for information on configuring DMA.

Latency

Select the latency between the sample hit and the actual conversion at the output. The available options are As small as possible or Until next frame. If As small as possible is selected, the values will appear at the module outputs shortly after the block sample hit. However, the latency will not be constant, which might lead to lags at the output. If Until next frame is selected, then the module starts to output the data at the next block sample hit. This ensures a constant latency and enables a continuous data output. This is especially useful when both the analog input and output use DMA. Refer to the usage notes for more information on this topic.

Sample Clock

Select which clock is used to start the conversion of a new sample. The frequency of the clocks can be changed in the main tab.

Frame Size (samples/channel)

Select how many samples are transferred to the module at each sample hit. The block input of every channel becomes a vector with the same number of values, where the value at position 1 will be converted first. Enter "-1" to allow the system to determine the frame size automatically based on the conversion clock and output block sample time.

Either the frame size or the output block sample time must be configured automatically (-1).

Output Block Sample Time

Define the base sample time at which the Analog output block gets its sample hit. Enter "-1" to allow the system to determine the output block sample time automatically based on the conversion clock and frame size.

Either the frame size or the output block sample time must be configured automatically (-1).

Digital I/O Tab
Digital Inputs/Outputs

Select each digital channel to be configured either as an input In or an output Out. For output channels, the options to set initial value and reset to initial value are displayed in the Digital Outputs panel.

Initial Values

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).

Use the Reset to Initial Value checkbox for each channel to define whether the initial value is applied once the application has stopped.

Enable Debounce Filter

Enable or disable the debounce filter to eliminate any switch bouncing on the digital inputs. When enabled, the Debounce Filter Time field appears where you can specify the required value.

Debounce Filter Time

Specify the middle of the two debounce filter times you require, where Tpass is always 1.5 times the value of Treject. Pulses with a duration smaller than Treject are filtered and are not passed on to the internal logic. After an input pin performs a rising or a falling edge, Tpass defines how long this new logic level must be stable before the level change is passed on to the internal logic. Please note that pulses with a duration between Treject and Tpass may or may not be filtered. Treject can be configured between 50 ns and 3.2768 ms. Tpass can be configured between 75 ns and 4.9152 ms.

Pull Resistors - Front Connector

Select the reference voltage of the pull resistor for the front I/O: Floating, Weak pull-up 5 V, Pull-up 3.3 V or Pull-down. Note: if Floating is selected, the pull resistors will not be connected to a reference level, but they will still nonetheless be connected to each other. If Weak pull-up 5 V is selected, the external load current cannot exceed 250 µA in order to achieve a valid CMOS high level.

Digital I/O Output Circuit: