FB_MBUS_General_Send

The function block FB_MBUS_General_Send is used to send data to any M-Bus devices (the primary address of the meter can be changed with this function block, for example).
The function block can only be executed together with the function block FB_MBUSKL6781().
![]()  | Further information  | 
 Inputs
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;
END_VARName  | Type  | Description  | 
|---|---|---|
usiAddress  | USINT  | Primary address of the meter to be read with this function block.  | 
stSecAdr  | Secondary address of the meter to be read with this function block.  | |
eBaudrate  | 300, 600, 1200, 2400, 4800, 9600 baud  | |
bStart  | BOOL  | All meters are read once on the positive edge of this input.  | 
bSND_NKE  | BOOL  | TRUE initializes the meter for each read operation and sets the meter to the first telegram (SND_NKE).  | 
bDisabled  | BOOL  | TRUE = deselection of the function block  | 
byC_Field  | USINT  | C-field / function field  | 
byCI_Field  | USINT  | CI-field / ID field  | 
arrData  | ARRAY OF BYTE  | The data to be sent must be written to this variable (see long block).  | 
 Inputs/outputs
VAR_IN_OUT
  stCom : ST_MBUS_Communication;
END_VARName  | Type  | Description  | 
|---|---|---|
stCom  | This structure is used to link the function block FB_MBUSKL6781() with the meter blocks.  | 
 Outputs
VAR_OUTPUT
  bBusy   : BOOL;
  bReady  : BOOL;
  bError  : BOOL;
  eError  : E_MBUS_ERROR;
END_VARName  | Type  | Description  | 
|---|---|---|
bBusy  | BOOL  | The bBusy output is TRUE as long as the meter is being read.  | 
bReady  | BOOL  | The bReady output is TRUE for one cycle, once meter reading is completed.  | 
bError  | BOOL  | This output goes TRUE as soon as an error occurs. This error is described via the eError variable.  | 
eError  | In the event of an error, the output issues an error code and bError becomes TRUE at the same time.  | 
Requirements
Development Environment  | PLC library to include  | 
|---|---|
TwinCAT from v3.1.4020.14  | Tc2_MBus from 3.3.5.0  | 
