FB_MBUS_General_Send
This block serves to send data to any M-Bus devices. (for example, the primary address of the meter can be changed with this block)
The block can only be executed together with the block FB_MBUSKL6781().
VAR_INPUT
usiAddress : USINT;
stSecAdr : ST_MBUS_SecAdr;
eBaudrate : E_MBUS_Baudrate := eMBUS_Baud2400;
bStart : BOOL;
bSND_NKE : BOOL := TRUE;
bDisabled : BOOL := FALSE;
byC_Field : USINT := 16#53;
byCI_Field : USINT := 16#51;
arrData : ARRAY [0..240] OF BYTE;
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, 600, 1200, 2400, 4800, 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).
bDisabled: TRUE = deselection of the block.
byC_Field: C-field / function field.
byCI_Field: CI-field / ID field.
arrData: The data to be sent must be written to this variable (see long 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: this output goes TRUE as soon as an error occurs. This error is described via the variable eError.
eError: In the event of an error the output issues an error code (see E_MBUS_ERROR). bError goes TRUE at the same time.
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 |