FB_MBUS_EMU_3_5_Allrounder

FB_MBUS_EMU_3_5_Allrounder 1:

This module is used to readout electricity meters of the manufacturer EMU.

It can only be used together with the module  FB_MBUSKL6781()

Functionality of the module

VAR_INPUT

usiAddress      : USINT;
stSecAdr        : ST_MBUS_SecAdr;
eBaudrate       : E_MBUS_Baudrate := eMBUS_Baud2400;
bStart          : BOOL;
bSND_NKE        : BOOL := TRUE;
bReadInit       : BOOL := TRUE;
tMinSendTime    : TIME := t#2s;
bDisabled       : BOOL := FALSE;

usiAddress: Primary address of the counter, that shall be readout with this module.

stSecAdr: Secondary address of the counter, that shall be readout with this module.

eBaudrate: 300..9600 baud.

bStart: Positive edge on this input, the meter is read out once.

bSND_NKE: TRUE to initialize the meter at each reading, and sets the meter on the first telegram (SND_NKE).

bReadInit: After restarting the PLC, the meter is read out once.

tMinSendTime: Standard t#2s. When this time exceeds, the counter is rereadout. At t#0s the counter is not readout and can be readout with bStart manually.

bDisabled: TRUE = disable the function block.

VAR_OUTPUT

bBusy                  : BOOL;
bReady                 : BOOL;
bError                 : BOOL;
eError                 : E_MBUS_ERROR;
dwIdNumber             : DWORD;
byStatus               : BYTE;
byGEN                  : BYTE;
byCounter              : BYTE;
usiRecivedAdr          : USINT;
eMedium                : E_MBUS_Medium;
sMan                   : STRING(3);
stActiveEnergyTariff1  : ST_MBus_Info;
stActiveEnergyTariff2  : ST_MBus_Info;
stActivePowerL1        : ST_MBus_Info;
stActivePowerL2        : ST_MBus_Info;
stActivePowerL3        : ST_MBus_Info;
stActivePowerTotal     : ST_MBus_Info;
stVoltageL1            : ST_MBus_Info;
stVoltageL2            : ST_MBus_Info;
stVoltageL3            : ST_MBus_Info;
stCurrentL1            : ST_MBus_Info;
stCurrentL2            : ST_MBus_Info;
stCurrentL3            : ST_MBus_Info;
stCurrentTotal         : ST_MBus_Info;
stDeviceError          : ST_MBus_Info;

bBusy: The bBusy output is TRUE as long as the meter readout is running.

bReady: The bReady output is TRUE for one cycle when the meter readout has been completed.

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

eError: The output issues an error code in the event of an error (see E_MBUS_ERROR). At the same time bError becomes TRUE.

dwIdNumber: Serial number of counter (secondary address).

byStatus: Status of device.

byGEN: Software version dof device.

byCounter: Number of accesses of the master to data of the respective slave.

usiRecivedAdr: Recieved primary address (0-250).

eMedium: Medium (siehe E_MBUS_Medium).

sMan: Manufacturer's abbreviation.

stActiveEnergyTariff1: Active energy tariff 1 (see ST_MBus_Info).

stActiveEnergyTariff2: Active energy tariff 2 (see ST_MBus_Info).

stActivePowerL1: Actual active power L1 (see ST_MBus_Info).

stActivePowerL2: Actual active power L2 (see ST_MBus_Info).

stActivePowerL3: Actual active power L3 (see ST_MBus_Info).

stActivePowerTotal: Total active power (see ST_MBus_Info).

stVoltageL1: Voltage L1 (see ST_MBus_Info).

stVoltageL2: Voltage L2 (see ST_MBus_Info).

stVoltageL3: Voltage L3 (see ST_MBus_Info).

stCurrentL1: Current L1 (see ST_MBus_Info).

stCurrentL2: Current L2 (see ST_MBus_Info).

stCurrentL3: Current L3 (see ST_MBus_Info).

stCurrentTotal: Total current (see ST_MBus_Info).

stDeviceError: Error message from the device (see ST_MBus_Info).

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).

Requirements

Development environment

Target system type

PLC libraries to include

TwinCAT 2.11 R3/x64 higher than Build 2234

PC/CX, BX or BC

TcMBus-Library higher than V2.3.0