Access from the user program
KL320x
46
Version: 4.4
5.6
Control and status byte
5.6.1
Control byte for process data exchange
The control byte is transmitted from the controller to the terminal. It can be used
• in register mode (REG = 1
bin
) or
• during process data exchange (REG = 0
bin
)
.
The control byte can be used to carry out gain and offset compensation for the terminal (process data
exchange). This requires the code word to be entered in R31. The gain and offset of the terminal can then be
compensated.
The parameter will only be saved permanently once the code word is reset!
Control byte:
• Bit 7 = 0
bin
• Bit 6 = 1
bin
: Terminal compensation function is activated
• Bit 4 = 1
bin
: Calibration gain
• Bit 3 = 1 offset calibration
• Bit 2 = 0
bin
: slower cycle = 1000 ms
1
bin
: fast cycle = 50 ms
• Bit 1 = 1
bin
: up
• Bit 0 = 1
bin
: down
5.6.2
Status byte for process data exchange
The status byte is transmitted from the terminal to the controller. The status byte contains various status bits
for the analog input channel:
Status byte:
• Bit 7 = 0
bin
• Bit 6 = 1
bin
: Error (general error bit)
• Bit 5 to bit 2: reserved
• Bit 1 = 1
bin
: Overrange
• Bit 0 = 1
bin
: Underrange
5.6.3
Compensation
Implemented straight-line equation:
Y[Ω] = (X_Adc * G + B_h) * A_h + 100 Ω
Hence:
B_h consists of a component that depends on the gain of the A/D converter and a constant for calculating
the axis offset of 100 Ω. The gain-dependent component calculates the offset of the external components
(the offset of the component can be varied via adjustable amplification).
This procedure is necessary, because compensation at 0 Ω is technically not possible. The line is therefore
compensated around the point 100 Ω (offset to the point and rotated around this point).
B_h: (B_off * G + B_100)
• Offset calibration should therefore be carried out for PT100 at 100 Ω (or PT1000 at 1000 Ω).