PB B MM.V3x Manual
PB B MM.V3x Manual
PB-B-MODBUS/232/485/V3x
PRODUCTS MANUAl
(PB-B-MM/V3x:MODBUS MASTER)
V 3.x
About Manual……
This manual is divided to two parts, which can be read separately. The first part is about the
(PB-B-MODBUS/232/485/V2). That means users can use V3 take the place of V2 without any changes.
2. On PROFIBUS side, V3 products can only be used as PROFIBUS slave(Fig 0-1), while on the MODBUS
PROFIBUS Master
PROFIBUS-DP
PB-B-MODBUS/V3x
PB-B-MODBUS/V3x
RS232 RS485
PROFIBUS device PROFIBUS device
PROFIBUS Master
PROFIBUS-DP
PB-B-MODBUS/V3x PB-B-MODBUS/V3x
RS232 RS485
PROFIBUS device PROFIBUS device
3.New functions:
⑴ MODBUS protocol, 05H, 06H functions are added on the base of original MODBUS master functions.
4. The highest bit(SW1) of function dipswitches(on the back of V3 product) provides the user a selection
5. About GSD file:To configure V3 products as MODBUS master or slave, two completely different GSD
improvement of V3.2,and adds the monitor function of status bit and status byte to slave station。
2。So far, the highest version of PB-B-MODBUS as Slave products is PB-B-MS/V32, and PB-B-MM/V33 is
only used as master producets. Please notice the SW1 of function dipswitches(on the back of V3 product).
The chapter 5 introduces the configuration and communication taking PB-B-MM/V32 as example.
PB-B-MM/V33 is the same as PB-B-MS/V32 in the using process, referring to the first appendix.
Index
Chapter 1: Product Introduce...........................................................................................................................................................6
一.The Introduction of Product Series............................................................................................................ 6
1. Product Series ........................................................................................................................................ 6
⒉ Main use of bridge products ............................................................................................................. 6
二. The bridge form PROFIBUS to MODBUS-PB-B-MODBUS/232/485/V3x .............................................. 7
1. Features.................................................................................................................................................. 7
⒉ Technical Data ..................................................................................................................................... 7
Chapter 2:Product Structure, Installation, Start up ........................................................................................................................9
⒈ Shape of Product (In the picture)................................................................................................................. 9
⒉ Installation ................................................................................................................................................. 10
⒊ Shape ......................................................................................................................................................... 10
⒋ PROFIBUS interface components and installation.................................................................................... 11
⒌ RS-232 interface and cable ........................................................................................................................ 11
⒍ RS-485 interface and installation............................................................................................................... 12
(Ⅰ)、The basic feature of RS-485 interface transfer technology of PB-B-MODBUS/485 ................ 12
⑴ The features of RS-485 transfer technology .............................................................................. 12
⑵ The main point of RS-485 transfer devices installation............................................................. 12
(Ⅱ)、The polarity of PB-B-MODBUS/485 interface ......................................................................... 12
(Ⅲ)、the connection of RS-485 terminator......................................................................................... 13
⒎ Power supply ............................................................................................................................................. 14
⒏ PROFIBUS slave address setting .............................................................................................................. 14
⒐ Configure bridge as MODBUS master, or MODBUS slave...................................................................... 15
⒑ LED ........................................................................................................................................................... 15
⒒ The steps of Power on and the exclude of errors ....................................................................................... 16
Chapter 3:MODBUS Introduction ..................................................................................................................................................18
1. MODBUS Protocol...................................................................................................................................... 18
2. MODBUS Protocol points........................................................................................................................... 18
3. Exception Responses ................................................................................................................................... 19
4. MODBUS memory...................................................................................................................................... 20
5.MODBUS function.................................................................................................................................... 20
(1) Read output status .............................................................................................................................. 20
(3) Read holding Registers ...................................................................................................................... 22
(4) Read input Registers .......................................................................................................................... 22
(5) Force single coil ................................................................................................................................. 23
(6) preset single registers ......................................................................................................................... 24
(8) return checking................................................................................................................................... 24
Chapter 4: The Principle of Protocol Transform ..........................................................................................................................26
1.The Hardware Structure of PB-B-MODBUS/232/485 .............................................................................. 26
2.Connection with PROFIBUS..................................................................................................................... 27
3. The protocol transfer principle between PROFIBUS and MODBUS ......................................................... 27
Chapter 5:The method of communication and configuration .......................................................................................................30
1.Example ........................................................................................................................................................ 30
2. method of system configuration .................................................................................................................. 30
(Ⅰ) set up a “project” in PC1-STEP 7 .............................................................................................. 31
(Ⅱ)、Hardware.................................................................................................................................... 32
(Ⅲ) configure PB-B-MODBUS/232/485/V32 as PROFIBUS slave ................................................ 35
(1) configure PROFIBUS slave PB-B-MM/V32 ............................................................................. 35
PB-B-MODBUS/232/485/V3x interface is one product of PROFIBUS bridge products series; This product
PB -B -MODBUS/232/485 / V3x
B: bridge products
Via the bridge, the interface devices, which backup special communication protocols, such as RS232/485,
ASCII Printer
RS-232 RS-485
PROFIBUS-DP
PB-B-RS232 PB-B-RS485
YH ADAM module
▼wide application:All the MODBUS products, which have RS232/485 interface, can be connected to the
The V3x product(PB-B-MODBUS/232/485/V3x), can only be used as slave on PROFIBUS side. While on
the MODBUS side, the product can be used as master (see this manual P1, about V3…Fig 0-1), or as slave (see
▼simple use: Users do not have to know the details of PROFIBUS and MODBUS technology, only this
manual and the application examples are needed. The communication can be realized by configuration
▼transparent communication: According to the mirror relationship between PROFIBUS communication data
area and MODBUS communication data area, user can implement the transparent communication between
⒉ Technical Data
⑴On the PROFIBUS side, PB-B-MM/232/485/V3x interface is used as a PROFIBUS-DP slave, and on the
MODBUS side, it is used as MODBUS master. The interface can realize the transparent communication via
the mirror relationship between the PROFIBUS and MODBUS communication data area. See Fig 1-2:
ASCII Printer
PROFIBUS-DP
PB-B-MODBUS/V3x PB-B-MODBUS/V3x
RS-232
PROFIBUS devicePROFIBUS device
MODBUS master
MODBUS master
Fig 1-2:On MODBUS side, it is used as master,On PROFIBUS side is used as slave. Product is
connected to MODBUS master devices via RS-232/485.
10H functions.
⑶ PROFIBUS-DP/V0 protocol: according to GB/T20540-2006: Digital data communication for
measurement and control – Fieldbus for use in industrial control systems – type 3: PROFIBUS
⑷ PROFIBUS-DP slave, can detect the boudrate automatically, the max boudrate is 12M/s.
⑸ The input/output data amount of PROFIBUS is not confined, the max PROFIBUS input/output is:
⑺ Power supply:24VDC(±5%),140mA
⑼ Shape:(long)70mm×(high)112mm×39.5mm(sick)
⑽ Installation:35mm race
⑾ Safety level:IP20
PROFIBUS commu.(Yellow)
,
Product tag :
Information for users
PROFIBUS communication
LED(red),
35mm race
Function switch
Race lock
⒉ Installation
During installation, 35mm race is used. See Fig 2-3:
⒊ Shape
70 36
39
112
38
39.5
standard PROFIBUS interface, and standard PROFIBUS cable. More details about PROFIBUS installation
Fig 2-5:9 pin sub-D connector, standard PROFIBUS connector and cable
RS-232 interface. According the figure below, RS-232 can be made by users themselves:
1 1
TXD 2 2 RXD
RXD 3 3 TXD
4 4 DTR
GND 5 5 GND
6 DSR
7 7 RTS
8 8 CTS
9 9
Note: The definition of 9 pin connector of the figure above refers to MODICON PLC 140 CPU
534 14.For other MODBUS devices, when making cable, please pay attention to its RS-232 pin
definition, so that Txd(2)→Rxd, Rxd(3)→Txd.
The feature of 485 interface of PB-B-MODBUS/485 is completely the same with PROFIBUS interface. It
① Net topo: line bus, with bus terminator resisters on both end points of the bus.
④ Station number: 32 stations per segment (without repeater), the max number is 127 (with repeater).
② To make sure that system can operate without error, bus terminator resistors, which have power supply, are
Data line
RxD/TxD-P (+)
0V
A type cable bus terminator
(4) The max length of cable depends on the boudrate. If A type cable is used, the max length is 1200M when
acreage of cable:>0.34mm/Ω
A-
B+
PE to copper
The feature of 485 interface of PB-B-MODBUS/485 is completely the same with PROFIBUS interface. On the
end of RS-485 bus, bus terminator resistors should be added. See Fig 2-9:
Last station
First station
5V 5V
390Ω Data line B+
B+ B+
390Ω
0V 0V
A B A B
station 2 station 3
External stub
RTS
A-
Txd
B+
0V
Rxd
External stub
PE to copper
5V
So, when PB-B-MODBUS/485 is placed on the end of RS-485 bus, external stub should be connected, so
that the internal terminator resistor can be connected into the bus. See Fig 2-10 2-11:
TA
A-
B+
TB
PE to copper
When PB-B-MODBUS/485 is not placed on the end of RS-485 bus, See Fig 2-12:
A-
B+
PE to copper
⒎ Power supply
Power supply: 24VDC(±5%),140mA
24V G PE
on the frontboard of product do the address setting. See Fig 2-13, the address is 19.
ON
OFF
SW1 2 3
Fig 2-13:PROFIBUS address set switch SA. The address is 19 Fig 2-14: with the switches on the back, address more than 99
If PROFIBUS address more than 99 is needed, the function select switch SW on the backboard should be
If SA ≧ 27, even SW3=ON(upward),the address of this PROFIBUS slave is still 27, since PROFIBUS
ON
OFF
SW1 2 3
Fig 2-15:The highest bit (SW1) of bridge function dipswitches SW (on the back board of product)
⒑ LED
⑴ power LED POWER, green. Light: power on; Out: power off
⑵ PROFIBUS status LED PBOK, yellow. Light: PROFIBUS master has connected to this bridge, the
product is in data exchange status. Out: PROFIBUS master has not exchange data with this bridge.
⑶ PROFIBUS failure LED PBFAL, red. Light: PROFIBUS communication fails. Out: PROFIBUS master
⑷ MODBUS-232/485 TxD LED, green. Light: PB-B-MODBUS/232/485/V3x is send data to the field device.
⑸ MODBUS-232/485 RxD LED, green. Light: PB-B-MODBUS/232/485/V3x is receiving data send by the
② Check the PROFIBUS slave address dipswitches. Note: Since the PB-B-MODBUS/232/485/V3x interface
only read the address set by the switch during power on, so the power supply should be shut down and regives
③头 If PRFIBUS master has already configured the interface slave, PROFIBUS connector should be used. Note:
if this interface is placed at the end of PROFIBUS station, the connector with terminator resister should be
used. And the terminator resister select switch should be placed on ON state.
⑤If the PROFIBUS failure LED PBFAL (red) is light, it means the communication between PROFIBUS master
and the interface fails. Please check the connector, PROFIBUS cable, especially the way PROFIBUS master
configure the interface (See Chapter 5). If PROFIBUS failure LED PBFAL (red) is out, and the PROFIBUS
status LED PBOK (yellow) is light, that means the master has already exchanging data with slave interface, the
⑥ General questions:PROFIBUS failure LED PBFAL (red) is light. The PROFIBUS is not connected:
① If the field device is ready, user can connect to MODBUS device via RS-232 cable or RS-485 double-line
cable. Note: try to avoid insert and pull the RS-232 with power on.
② By checking the MODBUS /232/485/V3x TxD LED and RxD LED, user can handle the communication on
(B) Whether PB-B-MODBUS’s interface configuration of PROFIBUS master is right?(e.g. use the STEP 7
finish the configuration of HARDWARE, especilly the setting of serial port baud rate),and download the
(C) Whether PROFIBUS master has setted start_M=1 to startup MODBUS communication.
(D) Other questions: please reference to “chapter 5”—4.MODBUS work state and transition—(3) several errors
if reader just want to use the product,you can read block letter only(overlook Italic)。
1. MODBUS Protocol
(1) Modbus Protocol mainly used for communication between the controller。Through this protocol, can
communication between two controller or between a controller that via network (e.g. Ethernet) and other
devices. Nowadays, there are many devices using MODBUS protocol standard.
(2) If refer to international ISO/OSI seven layers network model, standard MODBUS protocol defines physical
layer, data link layer and application layer:
Physical Layer:define the asynchronous serial communication standard that based on RS232 and RS485;
Data link Layer:define the MAC that based on station identification and master/slave mode;
Application Layer:define information criterion (or message format) and communication service functions;
Application Layer
Presentation Layer
Session Layer
Transport Layer
Network Layer
(3) Many devices are based on MODBUS rs232/485,also have changed MODBUS network communication,
using MODBUS’s Application Layer only, and use other communication protocol in bottom, e.g. use
Ethernet+TCP/IP network, or spread spectrum wireless communication MODBUS network etc. in the bottom.
2. MODBUS Protocol points
(1) MODBUS is master/slave communication protocol. Master initiate transactions ,only the slave that have the
same address with the message that master initiate can sent response to master
(2)It is broadcast mode if message with address 0 ,no slave need to response,can be sent as a broadcasting
message ,including:
•Modify coil status;
•Modify contents of register;
•Force multiple coils;
•Force multiple registers;
•Inquiry diagnosis;
(3) MODBUS defined two transmission modes:ASCII mode、RTU(binary)mode;Two transmission mode can’t
be mixed;
※ This product PB-B-MODBUS/V3x only use RTU mode。
Less than 3.5 Address Function Data CRC Check Less than 3.5
characters characters
interval time 1*byte 1*byte N*bytes 2*bytes interval time
3. Exception Responses
(1)Slave receive master’s message,no transmission error,but slave can’t execute master’s order or can’t give a
response correctly, slave will give a “exceptionl response” message to answer.
(2) Message format of exception response
For example:master initiate a request message,Function code 01:read 1 coil value of 04A1
Slave Addre Function Starting Address Hi Starting Address Lo No. of Coils Hi No. of Coils Lo CRC
0A 01 04 A1 00 01 xxxx
As the slave’s highest coil address is 0400, 04A1 over addresses ceiling,slave will give a exception response
asfollow:(Notice:Function code highest bit set to 1):
0A 81 02 xxxx
05 ACKNOWLEDGE The slave has accepted the request and is processing it, but a long
durationof tiome will be required to do so. This response is returned to
prevent a timeout error from occurring in the master. The master can next
issue a Poll Program Complete message to determine if processing is
completed.(See Annotate 2)。
06 BUSY 、 REFUSE The slave is engaged in processing a long-duration program command. The
EXECUTE master should retransmit the message later when the slave is free.
07 NEGATIVE The slave can’t perform the program function received in the query. This
ACKNOWLEDGE code is returned for an unsuccessful programming request using function
code 13 or 14 decimal. The master should request diagnostic or error
information from the slave.(See Annotate 2)。
08 MEMORY PARITY The slave attempted to read extended memory, but detected a parity error in
ERROR the memory. The master can retry the request, but service may be required
on the slave device.
4. MODBUS memory
MODBUS ranges over controller or MODBUS device, the memory marks with 0XXXX、1XXXX、
3XXXX、4XXXX.
Memory Name Type Read/Write Memory address
mark
0XXXX coil bit Read/Write 00001~0XXXX,
XXXX:be related to device
1XXXX Input coil bit Only read 10001~1XXXX,
XXXX:be related to device
3XXXX Input register word Only read 30001~3XXXX,
XXXX:be related to device
4XXXX keeping/output word Read/Write 40001~4XXXX,
register XXXX:be related to device
5.MODBUS function
MODBUS application layer prescribes the MODBUS telegrame framing and service function.
function code:01H
Notice:The start address 00000 of of message corresponds to device address 00001,and the others like it。
In this example:Read output coil status of 11H slave,start address=0013H=19,corresponding address 00020;
So,this query message is reading output coil status of 11H slave,from 00020 to 00056,adding to 37 coils.
Response framing of the slave
Address Function Byte Coils Coils status Coils Coils Coils status CRC
code count status 28-35 status status 52-56
20-27 36-43 44-51
11 01 5 CD 6B B2 0E 1B xxxx
00052
00056
Fill 0
11 02 00 C4 00 16 XXXX
So,the function of this query message is: read 17(11H)of input coils in the slave 10197—10218,totally 22
11 02 3 AC DB 35 xxxx
Function code:03H
11 03 00 6B(107) 00 03 xxxx
Note:register starting address 00000 in the massage counterparting address 40001 in the device , others
deffered。
So,the function of the query massage is:read 17(11H)3 holding regisres value40108—40110 in the slave;
(40110)=2A64H
Function code:04H
11 04 00 08 00 01 XXXX
Note:register starting address 00000 in the massage counterparting address 30001 in the device , others
deffered。
Example : read 11H input registers value in the slave , starting address=0008H=0008 ,
counterparting address30009;registers count=0001;ending address=30009;so,read 17(11H)
1 holding regisres value 30009 in the slave;
Response framing in the slave:
11 04 2 01 01 XXXX
Function code:05H
Query framing:
Addres Functio Coil address Coil address Force data Force CRC
s n code Hi Lo Hi Data Lo
11 05 00 AC(172) FF 00 XXXX
Function :Force setting 17 slave coil value 0XXXX。coil starting address 00000 in the massage counterparting
Address Functio Coil address Coil address Force data Force Data CRC
n code Hi Lo Hi Lo
11 05 00 AC(172) FF 00 XXXX
Function code:06H
Query framing:
address Functio Register Register Data Hi Data Lo CRC
n code address Hi address Lo
11 06 00 87(135) 03 9E XXXX
Function:preset single register value 4XXXX。Coil starting address 00000 in the device counterparting address
11 06 00 87 03 9E XXXX
Function :preset 17 slave single holding registers value 40136 =0x039E,then return just as receive。
(7) Read Exception Status
Function code:07H
This production PB-B-MODBUS/V32 do not support this function。
(8) return checking
Function code:08H
This production PB-B-MODBUS/V32 do not support this function。
(9) Fetch Comm Event Counter
Function code:0BH
This production PB-B-MODBUS/V32 do not support this function。
(10) Fetch Comm Event Log
Function code:0CH
This production PB-B-MODBUS/V32 do not support this function。
(11) Force Multiple Coils
Function code:0FH
Addres Functio Coil starting Coil starting Coil count Coil count Byte count Coil status Coil status CRC
s n code address Hi address Lo Hi Lo 20-27 28-29
11 0F 00 13 00 0A 02 CD 00 XXXX
Note:coil starting address 00000 in the massage counterparting address 30001 in the device , others deffered。
Example :force setting 11H slave multiple coils,coil starting address=0013H=19,counterparting address
So,the function of this qury massage:force setting 17(11H)slave 10coils value 00020—00029
;0CDH→00020-00027; 00H→00028-00029;
address Function Coil starting Coil staring Coil count Coil Count CRC
code address Hi address Lo Hi Lo
11 0F 00 13 00 0A XXXX
Add Fun Register Register Register Hi Register Byte Data Data Data Data CRC
ress ctio starting starting Lo count Hi Lo Hi Lo
n address Hi address Lo
cod
e
11 10 00 87 00 02 04 01 05 0A 10 XXXX
Note:holding register starting address 40000 in the massage counterparting address 40001 in the device , others
deffered。
Example : preset 11H slave multiple holding register value , register starting addres=0087H=135 ,
So,the function of this qury massage:preset 17(11H)slave 2 holding register value 0105H→40136; 0A10H
→40137.
Response framing:
11 10 00 87 00 02 XXXX
the RAM of interface, there is a data area for the mirror relationship between PROFIBUS and MODBUS. The
protocol transfer between PROFIBUS and MODBUS and data exchange is complied by software. See Fig 4-1:
the hardware structure of PB-B-MODBUS/232, and Fig 4-2:the hardware structure of PB-B-MODBUS/485.
SIEMENS SIEMENS
CPU RAM CPU RAM
SPC 3 SPC 3
Fig 4-1 and Fig 4-2 show the PROFIBUS protocol chip of SIMENSE Company – SPC3. PROFIBUS
Interface is standard PROFIBUS drive circuit, which is composed of optocouplers and RS-485 drive. RS-232
Interface is standard RS-232 drive circuit, which is composed of optocouplers and RS-232 drive chip. CPU can
control the PROFIBUS communication via the control of SPC3; it also can set up a data buffer in the RA M. On
the other side, the communication with MODBUS field devices can be implemented via RS-232 interface, and a
MODBUS data buffer in the RAM. Via the data exchange between the two data buffer area operated by CPU,
side, PB-B-MS/V3, which is used as slave, connected to MODBUS devices via RS-232/485. See Fig 4-3. The
ASCII Printer
PROFIBUS-DP
PB-B-MODBUS PB-B-MODBUS
RS-232
PROFIBUS devicePROFIBUS device
MODBUS master
MODBUS master
Fig 4-3:Using PB-B-MS/V3 connect MODBUS master or a MODBUS local net to PROFIBUS
system which use a PLC as master
4-4,instruction later:
PROFIBUS
PROF SPC3 CPU TXD/RXD RS232
IBUS RS485
Fig 4-4 The protocol transfer principle between PROFIBUS and MODBUS
(1)when the product establish “MODBUS message queue” in the RAM,that is MODBUS message serial 。
this request is what user apply according to,when PROFIBUS master configure this interface of this product,
it can be generated automatically once selecting menue,and translate to the RAM in this product if master
connect to this interface。About how to use this request,selecting MODBUS communication function in the
(2)establishing PROBIBUS data area in the RAM of this product,the data that PROFIBUS master and
slave communicate with is stored in this area。PROFIBUS communicating data is divided into input data and
(3)establishing MODBUS data area in the RAM of this product,he data that MODBUS master and slave
MODBUS communicating data is divided into input data and output data,write(set,such as function 05H、
06H、0FH、10H)MODBUS slave are output data, PROFIBUS output data Correspondingly;the data that
read from modbus slave(read,such as function 01H、02H、03H、04H)is MODBUS input data,PROFIBUS
output data Correspondingly。See Fig 4-5:PROFBUS data area and MODBUS data area。
PROFIBUS MODBUS
master slave
MODBUS
PROFIBUS MODBUS Read
input data Input data command
MODBUS
PROFIBUS slave
PROFIBUS MODBUS MODBUS
Write
output data Output data
command
MODBUS
slave
(6)when CPU accomplish MODBUS communication one time、or scanning MODBUS message one time,
then exchange MODBUS data and PROFIBUS data in the buffer one time。
(7)PROFIBUS master communicate by PROFIBUS,accomplishing data exchange with the data area of
PROFIBUS-DP
K0
PB-B-MODBUS232/V32 L0
K1
L1
RS232 K2
L2
MODBUS 设备
MODICON PLC … …
140 CPU 534 14
L7 K7
using PC1:
Fig 5-2
(3) File→New, T_MODBUS,→OK. Fig 5-3
Fig 5-3
Fig 5-4
(Ⅱ)、Hardware
Fig 5-5
Fig 5-6
(2) Option→Update Catalog. Put the GSD file of the device into device catalog.
Fig 5-7
Fig 5-8
Select address
Fig 5-9
Update Catalog。Put facility GSD documents to facility Catalog”make a update,so now we can find our
product configuration in Hardwear Catalog。Other third party product configurations are the same)
Select slave address,in this case select address is :19→enter。See figure5-10、figure 5-11。
Fig 5-10
Figure 5-11
(2) configure RS232 interface of PB-B-MM/V32
figure 5-12:
Fig 5-12
tel: 010-62054940 36 web: www.c-profibus.com.cn
Beijing D&S Fieldbus Technologe Co. td
Selectbaudrat
Fig 5-13
② select“parity verify”:as①select“parity”。
③“master/slave”
:configrure the product as master,use GSDdocuments DS_MMV32.GSD,select MODBUS
5-12;”
PROFIBUS and MODBUS data update mode:user specify when to exchange PROFIBUS data area and
① At Every MD End
After MODBUS scan machine complete every MODBUS communicate command , execute once
PROFIBUS and MODBUS data area data exchange。This is default mode。It makes sure that transfer data
② At MD_scan End
After MODBUS scan machinecomplete a whole MODBUS message queue scan,execute once PROFIBUS
and MODBUS data area data exchange。This mode makes sure the integrality of MODBUS communicate
data。
Fig 5-14
Fig 5-15
Time of Replay M_Tsdr:after bus bridge sends MODBUS message, waits for MODBUS facilities’ time of
reply。In case MODBUS facilities do not reply exceed M_Tsdr time,bus bridge stop waiting,continue to send
next MODBUS message。M_Tsdr usually has relate to MODBUS facilities。M_Tsdr type value of MODCON
PB-B-MM/V32 has 0#~38# total 39 slots(logical,not phisical), 0#、1# slots are in use,other 37
slots are supplied for users。Every slot can be inserted a MODBUS communicate module(message),total
corresponding to one single function MODBUS message,can insert to a slot by double-click。Figure 5-16。
Fig 5-16
Fig 5-17
▼step2: set MODBUS parameters:double-click “24 DI read 24 bits(0xxxx) 1..3” in the 2# slot;select
Fig 5-18
Slave address:specify the slave address sent from MODBUS module to MODBUS facility,corresponding to
Start address:this case specifies the 0XXXX start address to be read,attention:loop start address in the
▼double-click“start address:0” ⇒ input output loop 0xxxx’s start address to be read,set address is 20 in this
example, figure5-19:
Fig 5-19
See figure 5-17,I1..I3 are PROFIBUS input address I1-I3 distributed to this MODBUS module by
4xxxx
Fig 5-20
This MODBUSmodule corresponds to MODBUS 04h function, read slave input register value 3xxxx。
Fig 5-21
▼Step2: Setting MODBUS parameter:double click 3# slot “read 4 Words (3xxxx)”,and select“Parameter
Assigement”, finishing slave and start address parameter setting ,as show in Fig 5-22:
Fig 5-22
Slave address: specifies the address sent from MODBUS message to MODBUS slave,corresponds to the
Start address:this example specifies the 3XXXX start address to be read,attention:register start address 0000
▼“MODBUS slave address: 0”⇒“10”, input MODBUS slave address, figure 5-23。
▼“start address start address: 0” ⇒ “2”, input input register 3xxxx start address to be read,figure5-24。
Fig 5-23
Fig 5-24
tel: 010-62054940 44 web: www.c-profibus.com.cn
Beijing D&S Fieldbus Technologe Co. td
Figure 5-23, I256..I263 are PROFIBUS address total 8 bytes distributed to this module by PROFIBUS
Fig 5-25
⑷ example for inserting “Write 16 bits (0xxxx)”into 4# slot
This MODBUS module corresponds to MODBUS 0Fh function, foce 16 continue loops 0XXXX to
ON/OFF state。
▼step1 : select 4# slot,double-click“Write 16 bits (0xxxx)”。Insert “16DO Write 16 bits (0xxxx) 1..2”
to 4# slot figure5-26:
▼step2: more set MODBUS parameters:double-click “Write 16 bits (0xxxx)” in the 4# slot,select
Fig 5-27
slave address: specifies the address of MODBUS slave received form the MODBUS telegram, corresponds to
Fig 5-28
▼“start address: 0” ⇒ “20”, input output-coil 0xxxx start address to be written. See Fig 5-29。
Fig 5-29
▼“numbers 16” ⇒ “16”, input the numbers of output-coil to be written ⇒“OK” .See Fig 5-30:
Fig 5-30
Fig 5-31
This MODBUS module corresponds to MODBUS 10h function, preset 4 retain registers of slave 4xxxx..
▼ Step 1: select #5 slot,then double click “write 4 Words (4xxxx)”. “4AO write 4 Words (4xxxx)
Fig 5-32
▼Step 2:Set parameters of MODBUS: double click “write 4 Words (4xxxx)”in #5 slot, select “Parameter
Assigement”, complete the setting of parameters of “slave address” and “start address”. See Fig 5-33.
slave address: specifies the address of MODBUS slave received form the MODBUS telegram, corresponds to
▼“start address: 0” ⇒ “20”, input retain register 4xxxx start address to be written⇒“OK”. See Fig 5-35。
Fig 5-33
Fig 5-34
Fig 5-35
Relationship of PROFIBUS address and MODBUS address:
See Fig 5-32. Q256..Q263 are PROFIBUS output addresses of the MODBUS module which are
distributed by PRFIBUS master, there are 8 Bytes, corresponding to 4 Words (4xxxx) of MODBUS device
which is written by the MODBUS telegram. See Fig 5-36
Fig 5-36
This MODBUS module corresponds to MODBUS 05h function, force salve single coil 0xxx.
▼ Step 1: select #6 slot, then double click “Force single bit (05H Command)”, “8DO Force single bit
Fig 5-37
▼Step 2:Set parameters of MODBUS: double click “Force single bit (05H Command)”in #6 slot, select
“Parameter Assigement ”, complete the setting of parameters of “slave address” and “start address”. See Fig
5-38:
Fig 5-38
slave address: specifies the address of MODBUS slave received form the MODBUS telegram, corresponds to
▼“start address: 0” ⇒ “23”, input single coil 0xxxx start address to be forced ,. See Fig 5-39。
Fig 5-39
See Fig 5-37, Q3 is PROFIBUS output address of this MODBUS module which are distributed by
PROFIBUS master, there is 1 Byte, corresponding to the single coil 0xxxx of MODBUS device which is
written by this MODBUS module. This MODBUS module send MODBUS/05H command according to
the value of Q3, then set single coil 0xxxx of MODBUS device 1 or 0. In this example, single coil start
address is 00023 (See Fig 5-39). If Q3=0, the module would send command of setting single coil 0; If Q3≠0,
Fig 5-40
This MODBUS module corresponds to MODBUS 06h function, preset single retain register of slave
4xxxx..
▼ Step 1: select #7 slot ,then double click “set single word (06H command)”. “1AO set single word
Fig 5-41
▼Step 2:Set parameters of MODBUS: double click “Force single bit (05H Command)”in #7 slot, select
“Parameter Assigement ”, complete the setting of parameters of “slave address” and “start address”. See Fig
5-42:
Fig 5-42
slave address: specifies the address of MODBUS slave received form the MODBUS telegram, corresponds to
▼“start address: 0” ⇒ “20”, input retain register 4xxxx start address to be written. See Fig 5-43。:
键入 MODBUS 从站地址
Fig 5-43
See Fig 5-41, Q264..Q265 are PROFIBUS output address of this MODBUS module which are
distributed by PROFIBUS master, there are 2 Bytes, corresponding to 1 Word (4xxxx) of MODBUS
Fig 5-44
Now, the configuration of system is completed, then “Save and Compile” →quit. See Fig 5-45:
one byte input used as communication status byte. In this example, it occupies the PROFIBUS input address I0.
The 1# slot is one byte output used as communication control byte. In this example, it occupies the PROFIBUS
Status byte
Control byte
Fig 5-46
⑴ format of communication status byte
1 1
Power on
value :1
0 0
re_tr=1: the interface is receiving or processing telegram or getting ready for send. This manual descript the
product PB-B-MM/V32, Since it is used as MODBUS slave, the interface is in the state of “receive/send
re_tr=0: the interface is in the state of sending telegram, waiting for receive.
② M_ER_CODE
After the interface sends a MODBUS telegram, the slave can receive the telegram from without error.
However, if the slave cannot process the command or cannot reply it correctly, it will reply with M_ER_CODE.
Attention: The max number of 37 MODBUS telegram in a MODBUS telegram sequence is 37,but there is
only one communication status byte .Therefore, when the slave cannot reply several telegram correctly, the
③ Tmdr_O
Bus-bridge would wait for the reply of MODBUS device according to the configuration of “Time of
Replay” after sending MODBUS telegram. If “Time of Replay” is time out, Tmdr_O=1.MODBUS scan would
④ CRC_er
CRC_er=1:When the interface receive a MODBUS telegram, there is some parity errors in CRC
checking, the product considers the MODBUS telegram is not credibility, no reply is provided.
⑤ oe_er
there is some parity errors in the receiving characters from serial port,the product considers the
Force MODBUS Stop waiting Clear the Not MODBUS MODBUS Start MODBUS
scan to reset Write permit Read permit scan
error mark used
Start up MODBUS scanning. MODBUS scanner begins scanning at the current pointer of the scanner,and 从当
If the three control bit(start_M、M_r_en、M_w_en)are used correctly,the master can complete “read
clear_er=1:Bus-bridge clear the error bit D7~D1 of the communication control byte,
escape_M=1:MODBUS scan wait for reply from MODBUS device after sending a MODBUS telegram。In this
state, if escape_M=1,scan stops waiting, goes on scanning next MODBUS telegram .The function always used
Attention 1:If escape_M retain 1,after sending a telegram, there is no time to wait, the MODBUS scan would
send next telegram. Therefore , escape_M should be used with start_M.. See several commands:
↓
↓
MODBUS scan is in the state of waiting for reply
start_M=0;
escape_M=1;
escape_M=0;
start_M=1;
MODBUS scan stops to waiting,sends next MODBUS telegram .
↓
↓
⑥ Force MODBUS scan to reset D7:reset_M
reset_M=1:Force MODBUS scan index to return to the first MODBUS telegram, MODBUS scan is in the state
To use our product correctly, user should comprehend the flow chart of PB-B-MS/V3. See Fig 5-48:
Power on
PROFIBUS Initiation
NO
Wait, Connect to PROFIBUS?
YES
YES
reset_M=1? MODBUS scan pointer returns back to original position.
NO
YES
escape_M=1? MODBUS scan pointer points to next position.
Clear communicational
YES NO
error flag.
clear_er=1?
Interrupt service
NO
Request to dispose MODBUS? Serial port switches to receive
MODBUS reply telegrams.
YES
At MD_scan End
NO
Finish scanning MODBUS telegram queue?
YES
MODBUS scan pointer
points to next position. MODBUS exchanges data with PROFIBUS data area.
If users want to start MODBUS scan after power on,at first ”Connect to PROFIBUS”, then start as ”Start
Power on
NO
Don’t Initialize Connect to PROFIBUS?
MODBUS,Can’t start.
YES
NO
Start method:
(Start_M=1) and (reset_M=0) and(escape_M=0)?
YES
PROFIBUS,when MODBUS scan sends a MODBUS telegram, if the telegram corresponding MODBUS
equipments(because of telegram errors、equipments failures and other factors)does not reply,MODBUS scan
(ⅰ) Use “Stop waiting D6:escape_M” to cause MODBUS scan to stop waiting,switch to send next
MODBUS telegram。
↓
↓
MODBUS scan stays in endless Waiting for reply…………..
start_M=0;
escape_M=1;
escape_M=0;
start_M=1;
MODBUS scan stops waiting,switches to send next MODBUS telegram………
↓
↓
(ⅱ) Use“Set by force MODBUS scan reset D7:reset_M”,make MODBUS scan stop waiting,scan pointer
↓
↓
MODBUS scan stays in endless Waiting for reply…………..
start_M=0;
reset_M=1;
reset_M=0;
start_M=1;
MODBUS scan stops waiting、resets、sends the first MODBUS telegram………
↓
↓
② Because D7:reset_M remains efficiency, it causes MODBUS scan pointer to return back to original
reset_M=1;
start_M=1;
reset_M=1:MODBUS scan resets
↓
↓
start_M=1:Start MODBUS scan,send Start serial port
the first MODBUS telegram。 to send data。
Others
Fig 5-50
Ⅱ、Phenomenon:Serial port may not send data completely,MODBUS scan resets again,restarts sending the
Ⅲ、Solution:Use right start method,when start, use commands of (reset_M=0) and (escape_M=0)。
③ Because D6:escape_M remains efficiency, it causes MODBUS scan does not wait but jump to next
position.
escape_M=1;
start_M=1;
↓
escape_M=1: MODBUS scan pointer move rearwards
↓
Others
Fig 5-51
Ⅱ、Phenomenon:Serial port may not send data completely,MODBUS scan makes the pointer move
Ⅲ、Solution:Use right start method,when start, use commands of (reset_M=0) and (escape_M=0)。
Ⅰ、reasons:The telegrams received from MODBUS slave are not wrong,but the slave can’t run master’s
Ⅱ、Phenomenon:The slave will answer “abnormal reply”。See “Chapter 3 MODBUS technology introduction
Notice: The whole MODBUS telegram queue at most has 37 MODBUS telegrams,but has only one
Communication state word,therefore,when much MODBUS appears abnormal reply, abnormal reply
Ⅰ、reasons:MODBUS reply telegrams received from FROFIBUS bridge contain character check error or CRC
check error。
Ⅱ、Phenomenon:If MODBUS reply telegrams received from FROFIBUS bridge contain character check error
or CRC check error,PROFIBUS Bridge will think the reply telegram data is uncertainty,refuses to write
reply data to MODBUS Read Data Area,refuses to update PROFIBUS input data,regards the
communication invalid , continues to scan next MODBUS telegram 。 At the same time make
communication state word parity check error D7:oe_er set 1 or make CRC check error D6: CRC_er set 1。
Ⅲ、Solution:character check error or CRC check error does not influence MODBUS scan running,but error
flag will retain。We can use control word“Clear Error Flag”clear_er=1 to clear error flag。clear_er=1 does
not influence MODBUS scan。clear_er retains 1. Make the function of retain clear error flag in effect。
5.How to start to read/write MODBUS communication data in PROFIBUS Master
Programs in the master must base on I/O addresses of hardware configuration。For the sake of
convenience,We take the hardware configuration of chapter “Product configuration and instances of
examples of addresses corresponding collection table、fig 5-52:MODBUS modules’ PROFIBUS I/O addresses
PROFIBUS
K0
PB-B-MODBUS/232/V32 L0
K1
L1
RS232 K2
L2
MODBUS Equipments
MODICON PLC ….. …..
140 CPU 534 14
L7 K7
Fig 5-3 The corresponding relation table between Equipments and Addresses
⑵ The corresponding relation of Communication state word, communication control word and
PROFIBUS Addresses
Fig 5-4 The corresponding relation table of Communication state word, communication control word and
PROFIBUS Addresses
PB-B-MM/V32 PROFIBUS Address PB-B-MM/V32 communication control I/O
Communication state word word Address
Receive/Send re_tr I0.0 Start MODBUS scan start_M Q0.0
Abnormal reply code I0.1~I0.4 Clear error flag clear_er Q0.5
M_ER_CODE
CRC efficacy error CRC_er I0.6 Stop waiting escape_M Q0.6
Odd/even error oe_er I0.7 Set by force MODBUS scan reset Q0.7
reset_M
“ ⒋ PB-B-MODBUS/V32 work state and converse ⑶ several errors and failure state and the
solutions。”
② By K1 make Q3 set 00/FF, 6# Slot MODBUS command 05H,according to Q3=00/FF,make coil 00024 set
0/1。
② Use K2 to set MW10~MW16 value, Use SFC15 to make MW10~MW16 transmit to QW256~QW262;5#
Slot MODBUS writes QB256~QB263 to MODBUS Hold register 40001~40004 by command 10H。
④ Use K3 to set QW264 value;7# Slot MODBUS writes QW264 to MODBUS Hold register 40040 by
command 06H。
⑹ How to get the data 0XXXX、1XXXX、3XXXX、4XXXX in MODBUS data area in PROFIBUS Master
① With PC1 online monitor we can see the data of IB1~IB3,as below chart 5-54:
Fig 5-54
The data AA55 is the value Network 6 sets QB1~QB2,by 4# Slot MODBUS command 0FH write
QB1~QB2 to MODBUS coil 00001~00016。2# Slot MODBUS reads MODBUS coil 00001~00024 by the
command 01H,transmit to IB1~IB3 correspondingly,So from PC1 online monitor, we can see the data AA、
55 of IB1~IB2。
In addition,6# Slot MODBUS command 05H function is:if QB3=0,set 0 on coil 00024(Original address
in configuration=00023)0;if QB3=FF,set 1 on coil 00024 1。In network 7 we use button K1 choose to set
QB3=00/FF。Therefore,once press K1 we can see I3.7=coil 00024 change,as below fig 5-55:
Fig 5-55
② Use SFC14 make IW256~IW262 transmit to MW20~MW26;The data of IW256~IW262 is that 3# Slot
MODBUS reads from MODBUS Input Register 30001~30004 by the command 04H。From PC1 online monitor,
From PC1 online monitor, we can see the data of MW20~MW26:1234、5678、9ABC、DEF1;the group of
③ 8# Slot MODBUS reads MODBUS Hold register 40001~40040 storing in IW264~IW342(40 WOEDS) by
Look back Network 8~9,Using K2、 SFC15 and 5# Slot MODBUS command 10H makes 99AA、BBCC、
DDEE、FF11 or 1122、3344、5566、7788 written to MODBUS Hold register 40001~40004。So from PC1 online
40001~40004←MW10~MW16),fig 5-57:
Fig 5-57
Fig 5-58
to MW94~MW108;
1111/4040 on QW264;7# Slot MODBUS command 06H writes QW264 to MODBUS Hold register 40040。So
can monitor the communication status of Modbus slave device, via PB-B-MM/V33(Fig 1).The slave devices
PC
PROFIBUS Master
In PROFIBUS master
We can monitor MODBUS
PROFIBUS-DP slaves(02H#~10H#)
communication status。
PB-B-MM/V33
MODBUS-485
Fig 1 the PROFIBUS master can monitor the communication status of Modbus
slave device, via PB-B-MM/V33
2、Example 1:The communication status bit monitor of MODBUS slave
In this example, the interface PB-B-MM/V33 connects to five MODBUS slave device(02H#、0CH#、
04H#、0FH#、10H#),and the PROFIBUSmaster can monitor the communication status bit of Modbus slave.
The first step:Select status monitor of slave device(8 bits),as show Fig 2. Default:no status monitor.
图3 每个从站配置两条报文
The second step:Configurate the telegram of MODBUS.Each of slave station need configure two telegram:
read 2 Words(4xxxx) and force single bit(05h Command).Notice: All of telegram need set the of MODBUS
The third step:Insert the status table of MODBUS slave (8 bits),and input the address table of MODBUS slave:
Fig 4 Insert the status table of MODBUS slave(8 bits),and input the address table of
MODBUS slave: 02、0C、04、0F、10
Notice:The status table of MODBUS slave(8 bits) must insert after all of MODBUS telegram.
The fourth step:After running, the PROFIBUS address IB1 can show the communication status of the
IB1:
D7 D6 D5 D4 D3 D2 D1 D0
reserve reserve reserve the the the the the
communication communication communication communication communication
status of 10H status of 0FH status of 04H status of 0CH status of 02H
station station station station station
D0=0:When MODBUS master sends telegram to 02H slave station ,the MODBUS master(PB-B-MM/V33)
doesn’t receive the answer telegram of 02H slave station until the timeout of Tsdr, or 02H slave station can’t
answer the MODBUS master telegram. Tsdr refers to Chapter 5---2、system configuration----(三) configure
D0=1:The 02H slave station responses the MODBUS master(PB-B-MM/V33)telegram within the time of
04H#、0FH#、10H#), and the PROFIBUSmaster can monitor the communication status byte of Modbus slave.
The first step:Select “status monitor of slave station”, as show in Fig 5. Default: no status monitor of slave.
The second step:Configure MODBUS telegram. Each of slave station configure two telegram: read 2
Notice:Every telegram need set the of MODBUS slave address, as show in Fig 6.
The third step:Insert the status table of MODBUS slave (8 bits),and input the address table of MODBUS slave:
Fig 7 Insert the status table of MODBUS slave (8 bits),and input the address table of
tel: 010-62054940 76
MODBUS slave: 02、0C、04、0F、10 web: www.c-profibus.com.cn
Beijing D&S Fieldbus Technologe Co. td
Notice:The status table of MODBUS slave(8 bits) must insert after all of MODBUS telegram.
The fourth step:After running, the PROFIBUS master IB4~IB8 can show the communication status byte of
D0=0:When MODBUS master sends telegram to 02H slave station ,the MODBUS master(PB-B-MM/V33)
doesn’t receive the answer telegram of 02H slave station until the timeout of Tsdr, or 02H slave station can’t
answer the MODBUS master telegram.Tsdr refers to Chapter 5---2、system configuration----(三) configure
D0=1:The 02H slave station responses the MODBUS master(PB-B-MM/V33)telegram within the time of
After MODBUS master(PB-B-MM/V33)sends a telegram, the MODBUS slave 02H receive the telegram
correctly, but 02H can’t response correctly, and will response “M_ER_CODE”,referring to Chapter 3 The
4、Particular case
(1)If configure the telegram of MODBUS slave 02H(Fig 3 or Fig 6), but not insert the 02H address in the
MODBUS slave address table(Fig 4 or Fig 7),the MODBUS master(PB-B-MM/V33)will set D4~D1 to F in
IB0 and not change the slave status monitor(bit or byte) ,when MODBUS master(PB-B-MM/V33) sends
telegram to 02H,not finding the 02H in the MODBUS slave address table.
总状态字 IB0
D7:oe_er D6:CRC_er D5: Tmdr_O D4~D1:MODBUS error code D0:re_tr
Parity error CRC check error Waiting for time of 1111 Receive/send
replay out
(2)If receiving a answer telegram with MODBUS error code, the MODBUS master(PB-B-MM/V33)
will search the telegram MODBUS address in the MODBUS slave address table,and write the MODBUS error
code in the communication status byte of MODBUS slave.When not finding the telegram addres, the MODBUS
master will set D4~D1 to F in IB0, and not change the communication status byte of MODBUS slave.
(3)If receiving a answer telegram with parity error or CRC check error, the MODBUS master
(PB-B-MM/V33)will search the telegram MODBUS address in the MODBUS slave address table,and set the
communication status byte of MODBUS slave. When not finding the telegram addres, the MODBUS master
will set D4~D1 to F in IB0, and not change the communication status byte of MODBUS slave.
5、matters need attention—configure the max number of MODBUS slave telegram
PB-B-MM/V33 products add to new function of MODBUS slave status monitor in comparison with V32,
configuring MODBUS slave status monitor table in the last of slot. The monitor table costs definite bytes of
PROFIBUS user parameter, that decreases the number of telegram of slave station. So in addition to require
the max number of slot is to be 39, and the max amount bytes of input/output is less than 233,the telegram in
PB-B-MM/V33 configuration is also related to the number of user parameter bytes. When users select
different types of slave status monitor, the max number of MODBUS slave telegram is different, as show
below:
The table of the type of slave status monitor and the max number of MODBUS slave telegram
The type of slave status The max number of The type of slave status The max number of
CPCC
Beijing D&S Fieldbus Technologe Co. td
Tel:010-82078264、010-62054940 Fax:010-82078264
Address:No.1 Jiaochangkou Deshengmenwai Being China Post code:100011
Web:www.c-profibus.com.cn Email: tangjy@c-profibus.com.cn