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

IO135 Usage Notes

IO135 Usage Notes — Usage information about the I/O module

DMA Setup

If DMA is enabled for analog input, analog output or both, then the model or the asynchronous subsystem where the module is located must be triggered by the module's interrupt.

This is required so that the sample hits of the blocks are synchronous to the module's DMA engine.

In DMA mode, the model must contain an Interrupt Setup block that triggers a subsystem or the model. Refer to the block documentation for more information.

[Note]Note

For MATLAB releases prior to R2020b, please refer to the interrupt settings described in the MathWorks web documentation.

Output DMA Latency

This note shows the difference between the two configuration options for the latency of the Analog output block in DMA mode.

The configuration is defined in the analog output tab of the Setup block.

Latency as small as possible

If the latency is kept as small as possible, then the module will start to output values immediately after receiving a frame. However, the transmission time will vary, meaning that the delay between the sample hit of the model and the change at the output pins is not constant. If both the analog input and output use DMA, then the latency between measuring a value, processing and writing the value to the output will vary.

If the DMA transfer, during one sample hit, requires more time than the previous transfer, then the outputs will remain on the last value until the transfer has finished.

Latency until next frame

If the latency is fixed to the beginning of the next frame, then the analog outputs will only start to output the data of the frame at the next sample hit. The delay between the sample hit and the outputs, or between the analog inputs and the analog outputs is therefore constant. There is no danger of running out of data at the outputs, however, the latency will be higher.

Frame Trigger

The frame trigger starts the conversion of analog input or output data over DMA. The advantage of operating with the frame trigger is that the data frame can be smaller than the trigger signal and the analog input and output frames can be of different sizes. Without the frame trigger, it is still possible to have different sample times for the input and output, but they must complete their frames at the same time.

The disadvantage of the frame trigger is that different conversion clocks cannot be used for the analog input and output.

Example: Input and output frames are the same size as the frame trigger

In this example, the analog input and output frames have the same size as the frame trigger. If the analog input frame size and analog output frame size are both 100 samples/channel, then the frame trigger clock divider must be 100. This results in a frame trigger with 100 conversions/trigger. With these settings, the IO135 module performs the analog conversions at an interval defined with the chosen conversion clock.

When using the frame trigger, the frames are always synchronized. Consequently, the analog input and output have to use the same conversion clock. The system latency is therefore double the time of one frame.

Example: Input and output frames are smaller than the frame trigger

In this example, the analog input and output frames are smaller than the frame trigger. The analog input frame size could, for example, be 40 samples/channel, the analog output frame size could be 60 samples/channel and the frame trigger clock divider could be 100. The result is a configuration where the system starts converting both the analog input and output samples after a frame trigger. After 40 samples, the analog input frame is full, the ADC conversions are stopped and the data frame is transferred over DMA to the model in Simulink. For the next 20 conversion clocks, the module will continue to update the analog outputs until the output frame has also finished. During the last 40 conversion clocks, the module will not perform anymore conversions. It may however load the next output frame over DMA. The whole cycle will start again after the next frame trigger.

When using the frame trigger, the frames are always synchronized. Consequently, the analog input and output have to use the same conversion clock. The system latency is therefore double the time of one frame. Shorter latencies cannot be guaranteed for every configuration.

Inter-module synchronization setup

With the help of inter-module synchronization, the IO132-IO135 range of modules allows for DMA usage of more than one module. Some of the possible use cases are listed below.

Conversion signals

To use inter-module synchronization, the conversion signals must meet certain timing and voltage requirements. The requirements are listed below. Note that when inter-module synchronization is used with a module from the IO132-IO135 range, these requirements are taken care of automatically.

Conversion clock

The conversion clock signal is an active-high pulse signal that determines the basic frequency of data output or acquisition of the modules.

Frame trigger

The frame trigger signal is a divider of the conversion clock signal. It indicates the time when the DMA shifts the data in the desired direction. The first falling edge of the frame trigger also makes up the starting interrupt signal of the module.

Conversion signal requirements

Hardware setup

  • Front I/O:

    When using inter-module synchronization in Front I/O mode, Connect all the concerned modules' DIO 1, DIO 3 and DIO 5 lines. In a case where only one conversion clock is used, the other conversion clock line can be omitted. The respective DIO line cannot be used for its original purpose, however.

  • Rear I/O:

    If all dedicated modules shall be connected via Rear I/O connection, the DIO ports can all be used for their intended purpose. If you wish to upgrade your system to support Rear I/O configuration, please contact speedgoat to check whether your system supports Rear I/O Configuration

Software setup

  • Initiator and Target modules in the same real-time target machine

    When both initiator module and target module(s) are installed in the same machine, Inter-module synchronization must be activated to use DMA on all modules.

  • Initiator and Target modules in separate real-time target machines

    Another use case for Inter-module synchronization is the synchronous start of several real-time target machines. For this purpose, we need to set the concerned module on every target machine as model trigger. (works also with triggered subsystems). We then need to start the real-time target machine containing the target module first. The application will go to the “running” state, but without the model execution time starting. This only happens when the machine gets the Frame Trigger signal from the real-time target machine containing the initiator module. All connected modules will then start to sample and output synchronously, on different machines.

  • PWM Signal from an external source or a Speedgoat configurable I/O module as synchronization signal

    If the aforementioned conversion signal requirements are met, an external source or another module present inside or outside the dedicated real-time target machine can be used to trigger the IO132-IO135 modules set to target mode. Note that the exact bus/slot number has to be specified at every instance to use the IO132-IO135 as interrupt trigger of your model or subsystem.