MP_PTH
This function block is used to control and monitor a PTH sensor.
MP_Address is used to specify the MP-Bus device with which the function block is to communicate. bStart activates communication with the MP-Bus device. bBusy indicates that the function block is active. If bStart remains TRUE, the device is addressed cyclically with a period specified by the time in TMPolling. The time should be set longer than 1 second. bError is used to indicate an error in communication with the sensor. The type of the error can be read with iErrorID.
If an external sensor is connected to the sensor, iSensorTyp should be used to specify the sensor type. If no sensor is connected, the value "0" should be entered, or the variable should be left blank. A digital sensor should be parameterized with "3". The state of the sensor is output through the variable iYSensor.
Inputs
VAR_INPUT
MP_Address : USINT := 1;
bStart : BOOL := TRUE;
iSensorTyp : INT;
strDataKL6771 : DataKL6771;
TMpolling : TIME := t#10s;
END_VAR
Name | Type | Description |
---|---|---|
MP_Address | USINT | MP-Bus address of the slave. |
bStart | BOOL | A positive edge starts the function block. If this remains continuously TRUE, the function block will be activated cyclically with a period specified by the time in TMPolling. |
iSensorTyp | INT | "0" or blank: no sensor is connected; "1": an analog sensor is connected with voltage output in mV; "2": an output of a resistance in ohms - 1.0 ohm; "3": an output of a resistance in ohms - 0.1 ohm; "4": digital sensor. |
strDataKL6771 | The data structure with which the KL6771() function block must be linked. | |
TMpolling | TIME | The time for which the function block should address the actuator. Default 10 s, minimum time 1 s. |
Outputs
VAR_OUTPUT
bBusy : BOOL;
bError : BOOL;
iErrorId : MP_Error;
iDampness : INT;
iPressure : INT;
iTemperature : INT;
iYSensor : INT;
byPTH_Error : BYTE;;
END_VAR
Name | Type | Description |
---|---|---|
bBusy | BOOL | This bit is set for as long as the function block is active. |
bError | BOOL | This output goes TRUE as soon as an error occurs. This error is described via the iErrorId variable. |
iErrorId | This output outputs an error code in the event of an error. bError goes TRUE at the same time. | |
iDampness | INT | Relative humidity in 0.01 % |
iPressure | INT | Differential pressure, output in 0.1 Pa. |
iTemperature | INT | Temperature in 0.01 °C |
iYSensor | INT | Y-input, iSensorTyp = "1": voltage 0...10 V output in mV; iSensorTyp = "2": resistance output in 1.0 ohm; iSensorTyp = "3": resistance output in 0.1 ohm; iSensorTyp = "3": digital switch 0 or 1 |
byPTH_Error | BYTE | Sensor error - 0 - no error. |
byPTH_Error | Description |
---|---|
Bit 0 | Servicing error |
Bit 1 | Error message, sensor faulty |
Bit 2 | - |
Bit 3 | - |
Bit 4 | Sensor (temperature/humidity) faulty |
Bit 5 | A/D converter (pressure) faulty |
Bit 6 | A/D converter (Y-input) faulty |
Bit 7 | - |
Requirements
Development environment | required TC3 PLC library |
---|---|
TwinCAT from v3.1.4020.14 | Tc2_MPBus from 3.3.5.0 |