Functionality of the function block
Three methods for reading M-Bus meters are offered:
- The variable tMinSendTime> t#0s of the meter block is used to read the meter automatically once the time has elapsed. The variable is internally preset to t#2s.
- A positive edge of the variable bStart of the meter block triggers one reading of the meter.
- A positive edge of the variables bStart of the block FB_MBUS_KL6781() triggers one reading of all meters.
If several meter blocks receive a start command at the same time, they are started in the order in which they are called in the PLC.
The variable bReady becomes TRUE for one cycle once the block has received the data.
bError becomes TRUE if an error has occurred. This error is described with eError.
To read the meter after a start/ restart of the PLC, set the variable bReadInit to TRUE; otherwise to FALSE. Internally this variable is preset to TRUE.
eBaudrate: This variable is internally preset to 2400 baud. To read the meter with this baud rate (2400 baud), this variable does not have to be set explicitly. If the baud rate is changed, the KL6781 is adjusted automatically. This makes it possible to read meters with different baud rates in an M-Bus network. The baud rate of the meters is not changed. They must be able to operate with the baud rate specified here. Some meters operate with automatic baud rate detection. For further information please refer to the user guide of the meter.
bSND_NKE: Internally this variable is preset to TRUE. SND_NKE is a special telegram to the slave. This telegram triggers an initialization of the receiver. This telegram is important for meters, which send several telegrams. These meters respond to a SND_NKE with the first telegram. If TRUE, the SND_NK telegram is sent before the actual query. If FALSE, the SND_NKE telegram is not sent.
bDisabled =TRUE can be used to interrupt processing of the block. If a meter query is in progress, it is completed.