Device Profile Area
Manual • Doc.-No.: C.3030.21 / Rev. 1.4
CAN-CBX-AI420
Page 82 of 103
Calculation of the measured values:
The relationship of the objects is described in the figure on page 79. The single steps for the
calculation of the A/D-value, returned in the objects 6401
h
, and 6402
h
are described in the
following.
Firmware-internal variables (can not be read by the user):
AD-value . . . . . . . . . . .measured values of the A/D-converter without correction
Ana_In_32_og_x . . . . .A/D-value corrected with Offset and Gain
Ana_In_32_accu_x . . .A/D-value resulting from addition of n A/D-values
x . . . . . . . . . . . . . . . . . .number of the A/D-channel (1, 2, 3, 4)
Variables accessible via CANopen-objects:
Gain_x . . . . . . . . . . . . . . . . . . . Gain-factor (object 2405
h
, see page 97), default: Gain = 1
Offset_x . . . . . . . . . . . . . . . . . . Offset-value (object 2404
h
, see page 96), default: Offset = 0
n . . . . . . . . . . . . . . . . . . . . . . . . Number of additions (object 2402
h
, see page 94), default n = 1 (no additions)
m . . . . . . . . . . . . . . . . . . . . . . . . Number of the averaged values (object 2403
h
, see page 95),
default: m = 32 (moving average from 32 A/D-values)
Read_Analog_Input_32_x . . . . A/D-converter value, which has been calculated of m A/D-values (which has already
been corrected by gain, offset and addition) by the moving average method
(object 6401
h
, 6402
h
).
Steps of calculation:
1. Correction with gain-factor and offset-value:
Ana_In_32_og_x = Offset_x + (AD-value
Õ
Gain_x)
2. Addition of the measured values:
Ana_In_32_accu_x = Ana_In_32_og_x
(1)
+ Ana_In_32_og_x
(2)
+ ... + Ana_In_32_og_x
(n)
3. Calculation of the moving average:
Ana_In_32_accu_x
(1)
+ Ana_In_32_accu_x
(2)
+ ... + Ana_In_32_accu_x
(m)
Read_Analog_Input_32_x = -------------------------------------------------------------------------------------------------
n
Ö
m