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

IO132 - Setup

IO132 - Setup — Configure the IO132 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 IO132 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

Inter-Module Synchronization
Use this parameter to synchronize multiple IO132-IO135 I/O modules. This parameter ensures that for all the I/O modules concerned: a). all the analog outputs are updated synchronously; b). the samples of all analog inputs are taken exactly the same time. In an inter-module synchronization setup, one of the I/O modules is required to be set to "Initiator", while all the other I/O modules concerned must be set to "Target". This forces all target I/O modules to sample and update their ports synchronously with the Initiator (the Frame Trigger and both Conversion Clocks are transmitted between I/O modules).
  • None: This is the default value. No inter-module synchronization is enabled for the I/O module. Updates and samples occur independently of any other I/O module present in the setup.

  • Initiator - Front I/O: Choose this setting if you wish to use the module in question as the Initiator of the inter-module synchronization. The synchronization signals (Frame Trigger, Conversion Clock 1 and Conversion Clock 2) are sent over Digital I/O 1, Digital I/O 3 and Digital I/O 5. Note that these lines are not available as normal Digital I/O lines when this setting is selected.

  • Target - Front I/O: Choose this setting if you wish to use the module in question as the Target of the inter-module synchronization. The synchronization signals (Frame Trigger, Conversion Clock 1 and Conversion Clock 2) are received over Digital I/O 1, Digital I/O 3 and Digital I/O 5. Note that these lines are not available as normal Digital I/O lines when this setting is selected.

  • Initiator - Rear I/O: Choose this setting if you wish to use the module in question as the Initiator of the inter-module synchronization. The synchronization signals (Frame Trigger, Conversion Clock 1 and Conversion Clock 2) are sent over a rear connection inside the real-time target machine. Note that this setting requires your real-time target machine to be equipped with a connection between the different I/O modules. If you do not have this connection installed or are unsure about whether your real-time target machine is capable of using this feature, please contact Speedgoat.

  • Target - Rear I/O: Choose this setting if you wish to use the module in question as the Target of the inter-module synchronization. The synchronization signals (Frame Trigger, Conversion Clock 1 and Conversion Clock 2) are received over a rear connection inside the real-time target machine. Note that this setting requires your real-time target machine to be equipped with a connection between the different I/O modules. If you do not have this connection installed or are unsure about whether your real-time target machine is capable of using this feature, please contact Speedgoat.

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 IO132 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
Active Channels

Select the active input/output channels in a vector. A defined number of channels can be selected using square brackets, for example [1 2 3]. A sequence of channels can be selected using a colon, for example, 1:4.

Input Range

Select the voltage range for the input channels: ±5 V or ±10 V. The chosen voltage range will apply to all channels. The selected voltage range refers to the ground-related voltage range analogue to that of a single-ended input. Due to the module's full differential input, this results in an extended full scale range of each ADC.

Oversampling Factor

Select the oversampling configuration: none, 2, 4, 8, 16, 32 or 64. If oversampling is active, the I/O module takes the selected number of samples and averages them to one sample. This improves the signal-to-noise ratio, but also increases the total sampling time (for example, at oversampling configuration 64, 64 conversions are necessary for one sample).

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.

Conversion 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

Select the active input/output channels in a vector. A defined number of channels can be selected using square brackets, for example [1 2 3]. A sequence of channels can be selected using a colon, for example, 1:4.

Initial Values

Define the initial signal level present on the outputs after the application has been downloaded. The values can be set individually by entering a vector: the value at a certain position in the Initial Values vector is applied to the channel as defined in the Active Channels vector. A scalar value applies to all the channels; for example, for individual values, type "[1 1.5 0 2.5]", and to set all channels to zero, type "0".

Reset to Initial Values

Define whether the initial values are also applied once the application has stopped. The behavior can be set individually for each channel using a vector. A scalar value applies to all the channels; for example, for individual values, type "[1 0 0 1]", and to set all channels to zero, type "0". "1" means use the Initial Value and "0" means keep the latest value.

Output Range

Select the voltage range for every output channel: 0-5 V, 0-10 V, 0-10.8 V, ±5 V, ±10 V or ±10.8 V.

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.

Conversion 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 Output Channels

Select the active output channels in a vector. A defined number of channels can be selected using square brackets, for example, [1 2 3]. A sequence of channels can be selected using a colon, for example, 1:4.

Initial Values

Define the initial signal level present on the outputs after the application has been downloaded. The values can be set individually by entering a vector: the value at a certain position in the Initial Values vector is applied to the channel as defined in the enabled channels. A scalar value applies to all the channels; for example, for individual values, type "[1 0 0 1]", and to set all channels to zero, type "0".

Reset to Initial Values

Define whether the initial values are also applied once the application has stopped. The behavior can be set individually for each channel using a vector. A scalar value applies to all the channels; for example, for individual values, type "[1 0 0 1]", and to set all channels to zero, type "0". "1" means use the Initial Value and "0" means keep the latest value.

Active Input Channels

Select the active input channels in a vector. Check the active output channels to avoid conflicts.

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