-
Code Module Functionality
This box is only visible if your configuration file contains a code
module that is using the analog inputs/outputs. If you want to use one
of these analog code modules, you need to select the corresponding
checkbox. The Analog setup block will then be automatically configured
to support this analog code module. Parameters needing to be set to a
specific value will be grayed out.
Analog input and output channels not reserved by an analog code module
can still be used, but the channel group will be triggered by the code
module. When the DMA interrupt is enabled, the whole channel group will
be automatically disabled.
-
Analog Input Trigger - Enable Individual Trigger
Settings
This checkbox selects between individual trigger settings per channel
group or common trigger settings, which apply for all channels.
-
Trigger Settings - ADC Sample Trigger
The block supports up to four trigger options for the analog inputs
depending on the settings of Enable Individual
Trigger Settings and Enable DMA
Interrupt
Model Step At each model
sample step the analog input channels are triggered and the
driver actively waits until the analog data is converted and
read back. The task execution time will depend on the number
of analog input channels selected. This option is only
available when Enable DMA Interrupt
is not selected.
I/O Module Clock The
triggering of the analog channels is based on the internal
clocking functionality. The ADC Sample
Rate can be configured to the desired
rate.
I/O Module Internal
Signal The triggering of the analog channels
is based on I/O module internal signals. The available
signals depend on what is supported in the corresponding
configuration file.
I/O Module Digital I/O
The triggering of the analog channels is based on a
configurable digital I/O pin. Both input and output signals
can be used for triggering.
-
Read Value From Previous Model Step
At each model sample step the analog input data from the previous time
step is read and new conversions of the enabled analog input channels
are triggered, which will be read in the next model execution. This mode
avoids the active wait time of the analog conversion and therefore has a
lower task execution time.
-
ADC Sample Rate [Hz]
This parameter is used to configure the internal sampling clock of the
ADC.
-
Internal Signal
This parameter is available if ADC Sample
Trigger is set to I/O Module
Internal Signal. A list of available internal trigger
signals is shown in the drop-down menu. If no signal is available, then
the selected configuration file does not include internal trigger
signals; in this case choose a different trigger option.
-
Digital I/O Channel
This parameter is available if ADC Sample
Trigger is set to I/O Module
Digital I/O. Specify the digital I/O channel number to
configure the corresponding signal as trigger signal. If the selected
I/O line is configured as digital input in your model, an external
signal can be connected for triggering. But the trigger signal routing
also works for output signals and as well for code module functionality.
For example if a digital line is configured as PWM-Trigger output
signal, then the signal is also internally routed to the trigger input
of the analog channels and can be used for triggering.
-
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. In Frame-Based mode, only every
nth sample is transferred over DMA. In Sample-Based mode, the filter
acts as a moving average, and the CPU reads out the latest value.
-
Enable DMA Interrupt
The analog input data read back is organized in frames and can be
synchronized using an interrupt. Either a triggered subsystem or the
whole model can be executed based on the DMA interrupt. This checkbox is
only visible, when Enable Individual Trigger
Settings is disabled.
-
Frame-Based Settings - Trigger Resolution [s]
This parameter is shown if Enable DMA Interrupt
is checked. The parameter is disabled and cannot be changed
and only shows the applicable time resolution of the ADC trigger signal.
The ADC sample time will be rounded to an integer multiple of the
Trigger Resolution.
-
Frame-Based Settings - ADC Sample Rate [Hz]
This parameter is available if Enable DMA
Interrupt is checked. The ADC Sample Rate is used to
configure the internal sampling clock, if Sample
Trigger is set to I/O Module
Clock. For the other ADC Trigger Settings it is used to
calculate the expected block sample time.
-
Frame-Based Settings - Frame Size (samples/channel)
This parameter is available if Enable DMA
Interrupt is checked.
Select how many samples are transferred from the module at each CPU
model step. The block port signal 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 ADC Sample Rate and the
Input Block Sample Time.
-
Frame-Based Settings - Input Block Sample Time [s]
This parameter is available if Enable DMA
Interrupt is checked.
Define the base sample time at which the Analog input interrupt gets
asserted. Enter "-1" to allow the system to determine the block sample
time automatically based on the ADC Sample
Rate and Frame
Size.