Functionality of the function block
Three ways to read out M-Bus counters are offered:
- Via the variable tMinSendTime > t#0s the counter block is read out automatically after the time has elapsed. Internally this variable is set to t#2s.
- At rising edge of the counter block's variable bStart, the counter is read out once.
- At rising edge of the block FB_MBUS_KL6781()'s variable bStart, all counters are read out once.
If several counter blocks get a start command simultaneously, they are started in order of their calling within the PLC.
The bReady variable will be True for one cycle, if the block has received data.
If an error has occurred, bError will be True. This Error is described with eError.
If the counter should be read out after a start/restart of the PLC, the variable bReadInit is set to True; otherwise to False. This variable is internally set to True per default.
eBaudrate: This variable is internally set to 2400 per default. If the counter should be read out with this baud rate (2400 baud), the variable has not to be set explicitly. At baud rate change the KL6781 is reparameterized automatically. This allows to read out counter with different baud rate in one M-Bus network. The baud rate of the counters are not changed. They have to be able to operate with the given baud rate. Some counters operate with automatic baud rate detection. Please take information about this from the manual of the counter
bSND_NKE: This variable is internally set to True per default. SND_NKE is a special telegram to the slave. This telegram causes an initializing of the receiver. This telegram is important for counters sending several telegrams. After a SND_NKE these counters respond with the first telegram. If True the telegram is sent before the real request, if False the SND_NKE telegram is not sent.
With bDisabled = True the execution of the block can be interrupted. A started query of the counter will be finished.