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

IO131 - Setup

IO131 - Setup — Configure the IO131 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 and Analog output).

Ports

This driver block has no input or output ports.

Parameters

The three tabs of the setup parameter dialog box contain the IO131 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 IO131 I/O modules with each other. This parameter ensures that samples are taken at the exact same time for analog inputs and that updates occur synchronously for analog outputs. For no synchronization, choose "Independent". If using synchronization, one module with the Inter-Module Synchronization parameter set to "Initiator" is required. For all the other modules, the Inter-Module Synchronization parameter must be set to "Target". If using DMA with inter-module synchronization, ensure that the module generating the interrupt is the one set as "Initiator". If you intend using inter-module synchronization, please discuss this with Speedgoat so that your hardware can be set up accordingly.

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

Enable Continuous Sampling

If checked, the IO131 I/O module is configured for continuous sampling. Consequently, on a block sample hit, the block will only read the latest values from the module. Otherwise, the module is configured for manual sampling. This means that on every block sample hit, the block triggers a conversion and waits for the module to finish the conversion before reading the value. By enabling continuous sampling, the total execution time of the Analog input block can be significantly reduced. On the other hand, this can cause signal distortion. For more information on this topic, refer to the "Sampling Mode" usage note.

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.

Number of DMA Channels

Select for which channels DMA is enabled. This could either be channels 1 to 4, 1 to 8, 1 to 12 or 1 to 16 (all). Channels for which DMA operation is not enabled still work in non-DMA mode.

Sample Rate

Select how many conversions per second are performed for every channel. Note that the conversion period must be a multiple of 100 ns. The sample rate entered will be rounded to the closest valid rate automatically. Enter "-1" to allow the system to determine the sample rate based on the input block sample time and frame size.

Frame Size (samples/channel)

Select how many samples are transferred from the module at each sample hit. The block output of every channel with DMA operation enabled 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 sample rate, 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 sample rate and frame size. The Block Sample Time dialog field of the Analog input block is overwritten by this value when DMA is enabled.

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

Analog Outputs 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.

Output Range

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

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.

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.

Number of DMA Channels

Select for which channels DMA is enabled. This could either be channels 1 to 2, 1 to 4, 1 to 6 or 1 to 8 (all). Channels for which DMA operation is not enabled still work in normal operation mode.

Latency

Select the latency between the sample hit and the actual conversion at the output. The available options are "As small as possible" or "1 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 in the output. If "1 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 and is especially useful when both the analog input and output use DMA. Refer to the usage notes for more information on this topic.

Sample Rate

Select how many conversions per second are performed for every channel. Note that the conversion period must be a multiple of 100 ns. The sample rate entered will be automatically rounded to the closest valid rate. Enter "-1" to allow the system to determine the sample rate based on the output block sample time and frame size.

Synchronous to Analog Inputs

This feature is only available when analog input DMA is enabled as well. If checked, the sample rate specified for the analog outputs is ignored. Instead, the conversion is synchronized with the analog inputs. To avoid synchronization problems between the system and the analog outputs, the recommended approach is to always use synchronous configuration if DMA operation is enabled for both inputs and outputs.

Frame Size (samples/channel)

Select how many samples are transferred to the module at each sample hit. The block input of every channel with DMA operation enabled 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 sample rate and the output block sample time.

Either the sample rate, 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 sample rate and frame size. The Block Sample Time dialog field of the Analog output block is overwritten by this value when DMA is enabled.

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