Skip to main content

Customer Login

This content is for Speedgoat customer only. Log in to see content.

Forgot your password?

Don't have a Speedgoat account? Create an account.

Documentation
CONTENTS
https://www.speedgoat.com/help/slrt/page/icon_documentation.jpg

IO141 - Setup

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

Main Tab
PCI Slot (-1: autosearch)

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

  • Auto-Search: the default value -1 allows the real-time target machine to auto-search for the I/O module. The priority is defined by the module ID (first vector element for a multinode). The module with the lowest PCI bus/slot number is assigned to module ID 1 (or [1 x]) and the next module found is assigned to module ID 2 (or [2 x]), and so on

  • Explicit Addressing: the location of the module inside the target machine can be explicitly defined by using the [BusNumber, SlotNumber] format. To determine the bus number and the PCI slot number, run the following command in the MATLAB command window:

    speedgoat.showInstalledIoModules
Module ID

A unique module ID must be used for each type of I/O module Setup block in your model.

The module ID has two functions:

  • It defines the logical connection to link the I/O module driver blocks with each other

  • It also has an impact on the PCI slot auto-search feature: if only one I/O module is installed, the module ID must be set to 1. If multiple modules are installed, it must be in the range 1:n. Not all the I/O modules installed in the target machine need be used

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. Note that the maximum data acquisition rate of 800 kSPS is only achievable if one channel per Input Group is active. If two channels per input group are active, the maximum achievable rate is 400 kSPS.

Clock Divider

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

The IO141 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
Input Coupling

Select the input coupling 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 input coupling mode.

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, 9, 19 and 25 can be used. If two channels per ADC are required, only channels 1 and 2, channels 9 and 10, channels 19 and 20, and channels 25 and 26 can be used, and so on for three channels per ADC.

Voltage Range

Differential mode: ±0.64 V, ±1.28 V, ±2.56 V, ±5.12 V, ±10.24 V, ±20.48 V, and ±24.576 V

Single-ended mode: ±0.64 V, ±1.28 V, ±2.56 V, ±5.12 V, ±10.24 V, and ±12.288 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 on-board 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 on-board 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
Active Channels

Select each digital channel to be configured either as an input, an output or inactive. For output channels, the opitions to set initial value and reset to initial value are displayed.

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.

Enable Debounce Filter

Enable or disable the debounce filter. When enabled, the Debounce Filter Time field appears where you can specify your filter time.

Debounce Filter Time

Specify the middle of the two debounce filter times you require. Pulses with a duration smaller than Treject are filtered and are not passed on to the internal logic. Pulses with a duration greater than Tpass are not filtered and are 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. Tpass is always 1.5 times the value of Treject.

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