FB_HVACConfigureKL32xx
Application
With the function block FB_HVACConfigureKL32xx, the type of sensor of a channel of the KL3201/02/04, the KL3208-0010 or the KL3228 can be set from the PLC. To do this, the variables byStatusKL32xx, iDataInKL32xx, byCtrlKL32xx and iDataOutKL32xx must be linked in the TwinCAT System Manager with the variables Status, Data In, Control and Data Out of a channel of the KL3201/02/04 or the KL3228.
The resistor elements specified in Table 1 can be selected with the Enum eSensorType.
The KS2000 configuration software is no longer needed for setting the temperature sensor.
When measuring resistances from 10 to 5000 Ω with the KL32xx, 1 digit = 0.5 Ω, i.e. the indicated raw value must be divided by 2 in the PLC. Example: 2500 Ω would be represented in the controller by a raw value of 5000. The raw value must be divided by 2 in the PLC in order to arrive at the ohmic value of 2500 Ω. |
The measurement of resistances from 10 to 10000 Ω is possible only with the special terminal KL320x-0027. Exclusively the resistance measurement 10...10000 Ω can be performed on this special terminal. |
The EL3692 EtherCAT Terminal is a resistance measurement terminal that covers the measuring range up to 10 MΩ. |
VAR_INPUT
byStatusKL32xx : BYTE;
iDataInKL32xx : INT;
bSetSensor : BOOL;
bScanSensor : BOOL;
eSensorType : E_HVACSensorType;
tTimeOut : TIME;
byStatusKL32xx: the status byte (Status) of the Bus Terminal must be assigned here in the TwinCAT System Manager for the respective channel. If this is not the case, then this is indicated as an error with bErrorCommunication if the function block has been activated with a rising edge on bSetSensor/bScanSensor. If scanning or setting has been concluded with a rising edge on bSetSensor/bScanSensor, then this is indicated with a TRUE on bReady and byOutStatus := byStatusKL32xx. If scanning or setting is activated, bReady = FALSE, then the value of byStatusKL32xx present before activation is output on byOutStatus.
iDataInKL32xx: the raw value (Data In) of the Bus Terminal must be assigned here in the TwinCAT System Manager for the respective channel. If this is not the case, then this is indicated as an error with bErrorCommunication if the function block has been activated with a rising edge on bSetSensor/bScanSensor. If scanning or setting has been concluded with a rising edge on bSetSensor/bScanSensor, then this is indicated with a TRUE on bReady and iOutDataIn := iDataInKL32xx . If scanning or setting is activated, bReady = FALSE, then the value of iDataInKL32xx present before activation is output on iOutDataIn.
bSetSensor: the type of sensor specified on the Enum eSensorType is set in the Bus Terminal with a rising edge on bSetSensor. If the procedure has been concluded, scanning is activated internally in the function block and the type of sensor that has been set is indicated via the Enum eStatusScanSensorType.
bScanSensor: the scanning of the respective channel of the Bus Terminal is activated by a rising edge on bScanSensor. The type of sensor that has been set is indicated via the Enum eStatusScanSensorType.
eSensorType: Enum with which the sensor type for the respective channel is specified for setting via bSetSensor.
tTimeOut: specifies the time until the abortion of the function and bErrorCommunication goes TRUE. If no time is specified, then T#5s is used internally in the function block.
VAR_OUTPUT
bReady : BOOL;
byOutStatus : BYTE;
iOutDataIn : INT;
byCtrlKL32xx : BYTE;
iDataOutKL32xx : INT;
eBusTerminalKL32xx : E_HVACBusTerminal_KL32xx;
eStatusScanSensorType : E_HVACSensorType;
bErrorGeneral : BOOL;
byError : BYTE;
bErrorCommunication : BOOL;
bErrorBusTerminalNotSupported: BOOL;
bErrorSensorType : BOOL;
bErrorScanSensor : BOOL;
bReady: if the function block is activated via a rising edge on bSetSensor/bScanSensor, then bReady goes FALSE. If scanning or the setting of the type of sensor has been concluded, then bReady goes TRUE.
byOutStatus: if scanning or setting has been concluded with a rising edge on bSetSensor/bScanSensor, then this is indicated with a TRUE on bReady and byOutStatus := byStatusKL32xx. If scanning or setting is activated, bReady = FALSE, then the value of byStatusKL32xx present before activation is output on byOutStatus.
iOutDataIn: if scanning or setting has been concluded with a rising edge on bSetSensor/bScanSensor, then this is indicated with a TRUE on bReady and iOutDataIn := iDataInKL32xx . If scanning or setting is activated, bReady = FALSE, then the value of iDataInKL32xx present before activation is output on iOutDataIn.
byCtrlKL32xx: the control byte (control) of the Bus Terminal must be assigned here in the TwinCAT System Manager for the respective channel. If this is not the case, then this is indicated as an error with bErrorCommunication if the function block has been activated with a rising edge on bSetSensor/bScanSensor.
iDataOutKL32xx: the data output (Data Out) of the Bus Terminal must be assigned here in the TwinCAT System Manager for the respective channel. If this is not the case, then this is indicated as an error with bErrorCommunication if the function block has been activated with a rising edge on bSetSensor/bScanSensor.
eBusTerminalKL32xx: Enum that displays the type of Bus Terminal if the function block has been activated with a rising edge on bSetSensor/bScanSensor.
eStatusScanSensorType: Enum that displays the type of sensor for the respective channel if the function block has been activated with a rising edge on bSetSensor/bScanSensor.
bErrorGeneral: goes TRUE as soon as either bErrorCommunication, bErrorBusTerminalNotSupported, bErrorSensorType or bErrorScanSensor is TRUE.
byError: returns all error messages and warnings of the function block
byError.2 := bErrorGeneral;
byError.3 := bErrorCommunication;
byError.4 := bErrorBusTerminalNotSupported;
byError.5 := bErrorSensorType;
byError.6 := bErrorScanSensor;
bErrorCommunication: goes TRUE if, for example, the variables byCtrlKL32xx, iDataOutKL32xx, byStatusKL32xx and iDataInKL32xx have not been assigned to a channel of the Bus Terminal. Communication to the Bus Terminal is then interrupted during scanning or the setting of the type of sensor. bErrorCommunication likewise goes TRUE if the tTimeOut time is not sufficient when scanning or setting the sensor type.
bErrorBusTerminalNotSupported: becomes TRUE if the Bus Terminal is not supported by the function block.
bErrorSensorType: becomes TRUE if the type of sensor specified at eSensorType is not supported by the Bus Terminal.
bErrorScanSensor: becomes TRUE if, when scanning, the type of sensor is not supported by the Bus Terminals specified in the Enum eBusTerminalKL32xx.
Sensor type | KL3201/2/4-0000 | KL3201/2/4-0010 | KL3201/2/4-0012 | KL3201/2/4-0014 | KL3201/2/4-0016 | KL3201/2/4-0020 | ||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| Raw value |
| Raw value |
| Raw value |
| Raw value |
| Raw value |
| Raw value |
PT100 | x | 1/10 °C | x | 1/10 °C | x | 1/10 °C | x | 1/10 °C | x | 1/10 °C | x | 1/10 °C |
PT200 | x | 1/10 °C | x | 1/10 °C | x | 1/10 °C | x | 1/10 °C | x | 1/10 °C | x | 1/10 °C |
PT500 | x | 1/10 °C | x | 1/10 °C | x | 1/10 °C | x | 1/10 °C | x | 1/10 °C | x | 1/10 °C |
PT1000 | x | 1/10 °C | x | 1/10 °C | x | 1/10 °C | x | 1/10 °C | x | 1/10 °C | x | 1/10 °C |
Ni100 | x | 1/10 °C | x | 1/10 °C | x | 1/10 °C | x | 1/10 °C | x | 1/10 °C | x | 1/10 °C |
Ni120 | x | 1/10 °C | x | 1/10 °C | x | 1/10 °C | x | 1/10 °C | x | 1/10 °C | x | 1/10 °C |
Ni1000(DIN) | x | 1/10 °C | x | 1/10 °C | x | 1/10 °C | x | 1/10 °C | x | 1/10 °C | x | 1/10 °C |
Ni1000(Tk5000,LS) | not supported |
| not supported |
| not supported |
| not supported |
| not supported |
| not supported |
|
Resistance measurement 10 ... 1200 Ω | x |
| x |
| x |
| x |
| x |
| x |
|
Resistance measurement 10 ... 5000 Ω | x |
| x |
| x |
| x |
| x |
| x |
|
Resistance measurement 10 ... 10000 Ω | not supported |
| not supported |
| not supported |
| not supported |
| not supported |
| not supported |
|
Sensor type | KL3201/2/4-0023 | KL3201/2/4-0025 | KL3201/2/4-0029 | KL3201/2/4-0031 | KL3228 | KL3208-0010 | ||||||
|
| Raw value |
| Raw value |
| Raw value |
| Raw value |
| Raw value |
| Raw value |
PT100 | x | 1/10 °C | x | 1/10 °C | x | 1/10 °C | x | 1/10 °C | not supported |
| not supported |
|
PT200 | x | 1/10 °C | x | 1/10 °C | x | 1/10 °C | x | 1/10 °C | not supported |
| not supported |
|
PT500 | x | 1/10 °C | x | 1/10 °C | x | 1/10 °C | x | 1/10 °C | not supported |
| not supported |
|
PT1000 | x | 1/10 °C | x | 1/10 °C | x | 1/10 °C | x | 1/10 °C | x | 1/10 °C | x | 1/100 °C |
Ni100 | x | 1/10 °C | x | 1/10 °C | x | 1/10 °C | x | 1/10 °C | not supported |
| not supported |
|
Ni120 | x | 1/10 °C | x | 1/10 °C | x | 1/10 °C | x | 1/10 °C | not supported |
| not supported |
|
Ni1000(DIN) | x | 1/10 °C | x | 1/10 °C | x | 1/10 °C | x | 1/10 °C | x | 1/10 °C | x | 1/100 °C |
Ni1000(Tk5000,LS) | not supported |
| not supported |
| x | 1/10 °C | not supported |
| x | 1/10 °C | x | 1/100 °C |
Resistance measurement 10 ... 1200 Ω | x |
| x |
| x |
| x |
| not supported |
| not supported |
|
Resistance measurement 10 ... 5000 Ω | x |
| x |
| x |
| x |
| not supported |
| not supported |
|
Resistance measurement 10 ... 10000 Ω | not supported |
| not supported |
| not supported |
| not supported |
| not supported |
| not supported |
|