STATUS NDR DR ERROR Description
8201h 0 0 1 HARDWARE not valid.
8202h 0 0 1 MB_UNIT_ID not valid.
8203 h 0 0 1
*) Error free Modbus job with Function code 05h, 06h, 0Fh or 10h returns NDR=1 and DR=0.
Error free Modbus job with Function code 01h, 02h, 03h, 04h return DR=1 and NDR=0.
9.2.2.2 Example
The CPU provides 100 byte data in the flag area starting from MB200 for a Modbus
master via the Modbus register 0 ... 49. Data can be read by the Modbus master via
Function code 03h and written with Function code 06h, 10h. The CPU output Q1.0 is to
be controlled by a Modbus master via Function code 05h and the start address 5008.
Errors are to be stored. The Modbus RTU slave with the address 99 is realized via the
internal serial RS485 interface of a VIPA CPU.
OB100
CALL SFC 216
Protocol :=B#16#1
Parameter :=DB10
Baudrate:=B#16#9
CharLen:=B#16#3
Parity:=B#16#2
StopBits:=B#16#1
FlowControl:=B#16#1
RetVal:=MW100
1. Calling of the SFC 216 (SER_CFG) to configure the internal serial interface of the
CPU from VIPA.
2. Protocol: "ASCII", 9600 baud, 8 data bit, 1 stop bit, even parity, no flow control.
3. DB10 has a variable of type WORD and must be passed as "Dummy".
OB1
L 5000
T DB73.DBW 58
CALL FB 73 , DB73
ENABLE :=M101.0
HARDWARE :=B#16#2
LADDR :=
MB_UNIT_ID :=B#16#63
MB_DATA_PTR:=P#M 200.0 BYTE 100
NDR :=M101.1
DR :=M101.2
ERROR :=M101.3
STATUS :=MW102
UN M 101.3
SPB ERR1
L MW 102
T MW 104
ERR1: NOP 0
Task
OB100 - Description
VIPA SPEED7
Modbus Communication
RTU > FB 73 - RTU_MB_SLAVE - Modbus RTU slave
HB00 | OPL_SP7 | Operation list | en | 18-30 196