MP_PTH

MP_PTH 1:

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 s. 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, its type is to be indicated in iSensorTyp. If no sensor is connected, the value "0" should be entered, or the variable left open. A digital sensor should be parameterized with "3". The state of the sensor is output through the variable iYSensor.

VAR_INPUT

MP_Address     : USINT := 1;
bStart         : BOOL;
iSensorTyp     : INT;
strDataKL6771  : DataKL6771;
TMpolling      : TIME := t#10s;

MP_Address: MP-Bus address of the slave.

bStart: 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: "0" or blank - no sensor is connected; "1" an analog sensor is connected with voltage output in mV; "2" output of a resistance in ohms - 1.0 ohm; "3" 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 (see DataKL6771).

TMpolling: the time for which the function block should address the sensor. Default 10 s, minimum time 1 s.

VAR_OUTPUT

bBusy          : BOOL;
bError         : BOOL;
iErrorId       : MP_Error;
iDampness      : INT;
iPressure      : INT;
iTemperature   : INT;
iYSensor       : INT;
byPTH_Error    : BYTE;

bBusy: this bit is set for as long as the function block is active.

bError: the output becomes 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 (see MP_Error). bError goes TRUE at the same time.

iDampness: relative humidity in 0.01 %.

iPressure: differential pressure, output in 0.1 Pa.

iTemperature: temperature in 0.01 °C.

iYSensor: 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 = "4" digital switch 0 or 1.

byPTH_Error: 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

-