FB_MBUS_JAN_UMG96S

FB_MBUS_JAN_UMG96S 1:

This block is used to read electricity meters from Janitza:

-UMG96S

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

Functionality of the block

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;
usiUnit      : USINT;
bDisabled    : BOOL := FALSE;

usiAddress: Primary address of the meter to be read with this block.

stSecAdr: Secondary address of the meter to be read with this block (see ST_MBUS_SecAdr).

eBaudrate: 300, 2400, 9600 baud (see E_MBUS_Baudrate).

bStart: A positive edge of this input triggers one reading of the meter.

bSND_NKE: TRUE initializes the meter for each read operation and sets the meter to the first telegram (SND_NKE).

bReadInit: If the PLC is restarted, the meter is read once.

tMinSendTime: Standard t#2s. The meter is read again, once the time set here has elapsed. If t#0s the meter is not read and can be read manually with bStart.

usiUnit: Unit of the energy values to be output by the block. 0=W(h) / 1=KW(h) / 2 =MW(h) / 3=GW(h).

bDisabled: TRUE = deselection of the 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);
stActiveEnergy          : ST_MBus_Info;
stActiveEnergyTariff1   : ST_MBus_Info;
stActiveEnergyTariff2   : ST_MBus_Info;
stReactiveEnergy        : ST_MBus_Info;
stReactiveEnergyTariff1 : ST_MBus_Info;
stReactiveEnergyTariff2 : ST_MBus_Info;
stApparentEnergy        : ST_MBus_Info;
stActivePower           : ST_MBus_Info;
stActivePowerL1         : ST_MBus_Info;
stActivePowerL2         : ST_MBus_Info;
stActivePowerL3         : ST_MBus_Info;
stReactivePower         : ST_MBus_Info;
stApparentPower         : ST_MBus_Info;
stCurrent               : ST_MBus_Info;
stCurrentL1             : ST_MBus_Info;
stCurrentL2             : ST_MBus_Info;
stCurrentL3             : ST_MBus_Info;
stVoltageL1             : ST_MBus_Info;
stVoltageL2             : ST_MBus_Info;
stVoltageL3             : ST_MBus_Info;

stActiveEnergy: Active energy without backstop (telegram 2, data point 14) (see ST_MBus_Info).

stActiveEnergyTariff1: Active energy, relative (telegram 2, data point 15) (see ST_MBus_Info).

stActiveEnergyTariff2: Active energy, supplied (telegram 2, data point 16) (see ST_MBus_Info).

stReactiveEnergy: Reactive energy, inductive (telegram 2, data point 17) (see ST_MBus_Info).

stReactiveEnergyTariff1: Reactive energy, capacitive (telegram 2, data point 18) (see ST_MBus_Info).

stReactiveEnergyTariff2: Reactive energy, without backstop (telegram 2, data point 19) (see ST_MBus_Info).

stApparentEnergy: Apparent energy (telegram 2, data point 20) (see ST_MBus_Info).

stActivePower: Instantaneous consumption, power, total (telegram 2, data point 29) (see ST_MBus_Info).

stActivePowerL1: Instantaneous consumption, power, phase L1 (telegram 2, data point 38) (see ST_MBus_Info).

stActivePowerL2: Instantaneous consumption, power, phase L2 (telegram 2, data point 39) (see ST_MBus_Info).

stActivePowerL3: Instantaneous consumption, power, phase L3 (telegram 2, data point 40) (see ST_MBus_Info).

stReactivePower: Reactive power (telegram 2, data point 30) (see ST_MBus_Info).

stApparentPower: Apparent power (telegram 2, data point 31) (see ST_MBus_Info).

stCurrent: Current (telegram 2, data point 28) (see ST_MBus_Info).

stCurrentL1: Current L1 (telegram 2, data point 35) (see ST_MBus_Info).

stCurrentL2: Current L2 (telegram 2, data point 36) (see ST_MBus_Info).

stCurrentL3: Current L3 (telegram 2, data point 37) (see ST_MBus_Info).

stVoltageL1: Voltage L1 (telegram 2, data point 32) (see ST_MBus_Info).

stVoltageL2: Voltage L2 (telegram 2, data point 33) (see ST_MBus_Info).

stVoltageL3: Voltage L3 (telegram 2, data point 34) (see ST_MBus_Info).

VAR_IN_OUT

stCom : ST_MBUS_Communication; 

stCom: This structure is used to link the block FB_MBUSKL6781() with the meter blocks (see ST_MBUS_Communication).

Requirements

Development environment

required TC3 PLC library

TwinCAT from v3.1.4020.14

Tc2_MBus from 3.3.4.0