Skip to main content
Documentation
CONTENTS

IO104 - Setup

IO104 - Setup — Configure the IO104 input/output blocks

Library

Simulink Real-Time - Speedgoat

Description

For each IO104 module in your target machine there must be exactly one Setup block in your model.

The Setup block dialog box allows all of the supported I/O types of this module to be configured, and therefore impacts on the other driver blocks (Analog input, Analog output, Digital input, Digital output).

Ports

This driver block has no input or output ports

Parameters

Main
PCI Slot (-1 = autosearch)

If only one module of this type is present in the target machine, leave as default ('-1') to automatically locate the board. If more than one module of this type is present, enter the bus number and the PCI slot number of the board associated with this driver block using the format '[BusNumber, SlotNumber]'. To determine the bus number and the PCI slot number, type 'getxpcpci' in the MATLAB command window

IO104 module identifier

As it's possible to have more than one IO104 module in a target machine, this parameter is used by the other driver blocks to identify a specific module. Select a unique number (1..10) for each of your modules. If your target machine only contains one IO104 module then leave the default value (1).

Inter-Module Frame Synchronisation

The IO104 features a trigger signal, which indicates the start of each frame. It can either be generated by the card itself or it can be connected to another source.

Initiator: Let the internal rate generator produce the frame bursts trigger impulses based on the Frame Time setting. The TRIGGER I/O pin is configured as output and can be used to trigger other modules.

Target: Use the TRIGGER I/O pin as input for triggering frame bursts. The internal rate generator is disabled. This setting only defines the source of the trigger signal. Both analog inputs and outputs can be configured separately to use the trigger or not.

Frame Time (Burst Trigger Interval)

This is the interval time for the Trigger signal. For continuous frame based sampling it must be defined as the product of frame size and sampling time. You can set a value of '-1' to have the module calculate the correct value for continuous sampling itself. The frame time is shared between the analog input and output channels. The time value is divided from the module's 40.32MHz clock. This frequency value might seem quite odd, but it is intended to produce accurate audio frequencies, such as 24 or 48kHz.

Autocalibrate

We recommend always enabling this option, otherwise the measured and generated analog values might be off by a few percent. Check this box if the module should calibrate itself the next time this model (target application) is downloaded and initialized. The autocalibration function compensates for component aging, and minimizes the effects of temperature on accuracy. We recommend keeping this enabled. The calibration normally takes approximately 2 seconds, so we recommend increasing the host-target communication time-out in the model configuration parameters to allow for this. The status of the calibration is displayed on the target screen. The calibration is not re-executed during normal start/stop operation once the target application has been downloaded. All input channels are calibrated to a single internal voltage reference. Offset and gain error corrections for each channel are determined during the autocalibration process, and are applied to each channel in real-time during data acquisition.

Warning: During the calibration process various signals may be present at the output pins, but they will stay inside the configured voltage range.

Analog inputs
Active Channels

Select the active inputs channels in a vector. The IO104 supports 8 AD channels. The order inside the vector defines the output port order of the Analog input block, e.g. "[2 5 1 8]" or simply "1:8".

Voltage Range for Channels [ 1 2 5 6 ]

Select the voltage range for the input channels 1, 2, 5, and 6: ±10V, ±5V or ±2.5V

Voltage Range for Channels [ 3 4 7 8 ]

Select the voltage range for the input channels 3, 4, 7, and 8: ±10V, ±5V or ±2.5V

Input Coupling

Either differential or single-ended operation is supported. This board has dedicated differential inputs. In single-ended mode, the inverting input ('-') is internally connected to the input return signal. (see picture below this table)

Use Frame Burst Trigger

If checked, the analog input frames are aligned with the Trigger signal (see Main tab). In this case, with every Trigger impulse the module starts the input of the defined number of samples (Frame Size) at the speed defined by the input sampling clock (see next two parameters).

Input Frame Size [samples]

Number of samples in one frame. The product of of frame size and sample time must be smaller or equal the frame trigger time.

Inter-Module Input Clock Synchronization

Initiator: Let the internal rate generator produce the input sampling clock impulses based on the Input Sample Time setting (below). The INPUT CLK I/O pin is configured as output and can be used to drive the clock of other modules. Target: Use the INPUT CLK I/O pin as input for clocking the input sampling. The internal rate generator is disabled.

Input Sample Time (Clock Generator)

This is the interval time for the input clock sampling signal. The time value is divided from the module's internal 40.32MHz clock source and the minimum is 0.49603μs (20/40.32MHz). The clock source is the same for inputs, outputs and the frame burst trigger, so if the Frame Time equals the product of Frame Size and Sample Time, a perfect alignment of the frames is guaranteed.

Analog Outputs
Active Channels

Select the active output channels in a vector. The IO104 supports 4 DA channels. The order inside the vector defines the input port order of the Analog output block. Examples: use all channels but change order: "[2 1 4 3]", simply use all channels in straight order: "1:4", use only channels 2 and 3: "[2 3]".

Initial Values

Define the initial voltage level on the analog outputs after the model is download. The voltages can be set individually by entering a vector, which maps to the Active Channels vector. A scalar value applies to all defined channels. Examples: individual values: "[-1 -1.5 0 2.5]", all channels to 0V: "0"

Reset to Initial Values on model stop

Define if the Initial Values shall also be applied after the model is stopped. The behaviour can be set individually for each channel using a vector which maps to the Active Channels vector. A scalar applies to all defined channels. '1' means "use Initial Value" and '0' means "keep the latest value". Examples: "[1 0 0 1]" or "0"

Voltage Range

Select the voltage range for all output channels: ±10V, ±5V or ±2.5V

Use Frame Burst Trigger for Outputs

If checked, the analog output frames are aligned with the Trigger signal (see Main tab). In this case, with every Trigger impulse the module starts the output of the defined number of samples (Frame Size) at the speed defined by the output sampling clock (see next two parameters).

Output Frame Size [samples]

Number of samples in one frame. The product of of frame size and sample time must be smaller or equal the frame trigger time.

Inter-Module Output Clock Synchronization

Initiator: Let the internal rate generator produce the output sampling clock impulses based on the Output Sample Time setting (below). The OUTPUT CLK I/O pin is configured as output and can be used to clock other modules. Target: Use the OUTPUT CLK I/O pin as input for clocking the output sampling. The internal rate generator is disabled.

Output Sample Time (Clock Generator)

This is the interval time for the output sampling clock. The time value is divided from the module's 40.32MHz clock and the minimum is 0.99206μs (40/40.32MHz). The clock source is the same for inputs, outputs and the frame burst trigger, so if the Frame Time equals the product of Frame Size and Sample Time, a perfect alignment of the frames is guaranteed.

Digital I/O
Digital I/O 1..8 Direction

Define whether the first eight digital I/O pins shall be configured as inputs or outputs.

Digital I/O 9..16 Direction

Define whether the second eight digital I/O pins shall be configured as inputs or outputs.

Active Output Channels

Depending on the direction settings, enter a vector defining the set of pins to be used as digital outputs. Example: see picture.

Initial Values

Define the initial state on the digital outputs after the model is download. The states can be set individually by entering a vector, which maps to the Active Output Channels vector. A scalar value applies to all defined channels. Examples: individual values: "[0 1 1 0 0 1 0 0]", all channels to '1': "1"

Reset on stop

Define if the Initial Values shall also be applied after the model is stopped. The behaviour can be set individually for each channel using a vector which maps to the Active Channels vector. A scalar applies to all defined channels. '1' means "use Initial Value" and '0' means "keep the latest value". Examples: "[1 0 1 0 1 1 1 1]" or "0"

Active Input Channels

Depending on the direction settings, enter a vector defining the set of pins to be used as digital inputs. Example: see picture.