FB_MBUS_ChangeAdr

FB_MBUS_ChangeAdr 1:

This function block can be used to change the primary address.

The function block can only be executed together with the function block FB_MBUSKL6781().

VAR_INPUT

usiAdrOld      : USINT;
usiAdrNew      : USINT;
eBaudrate      : E_MBUS_Baudrate := eMBUS_Baud2400;
bStart         : BOOL;
bDisabled      : BOOL := FALSE;

usiAdrOld: Old primary address of the counter.

usiAdrNew: New primary address of the counter.

eBaudrate: 300, 600, 1200, 2400, 4800, 9600 baud.

bStart: Positive edge of this input, the primary address of the meter is changed.

bDisabled: TRUE = disable the function block.

VAR_OUTPUT

bBusy      : BOOL;
bReady     : BOOL;
bError     : BOOL;
eError     : E_MBUS_ERROR;

bBusy: The bBusy output is TRUE while the meter is being read.

bReady: The bReady output is TRUE for one cycle, once meter reading is completed.

bError: The bError output becomes TRUE as soon as an error occurs. The error is described via the variable eError.

eError: The eError output issues an error code when an error occurs (see E_MBUS_ERROR).

VAR_IN_OUT

stCom       : ST_MBUS_Communication;

stCom: About this structure, the block FB_MBUSKL6781() is connected to the meter function blocks (see ST_MBUS_Communication).

Download sample program for PC/CX systems: FB_MBUS_ChangeAdr 2:

Download sample program for BX systems: FB_MBUS_ChangeAdr 3:

Controller configuration setting: "BCxx50 or BX serial"

Download sample program for BC systems: FB_MBUS_ChangeAdr 4:

BCxx00 must be set to "Large Model" in the PLC under "Project/Options/Controller Settings".

Controller configuration setting: "BC serial"