Modbus Introduction
StruxureWare Building Operation 1.9
History of Modbus...
Modbus is a messaging protocol
1978
Created in 1978 by Modicon
Open and easy to implement
Widely used in industry
www.modbus.org
Modbus in Network Architectures
Modbus can be used in numerous network architectures
Modbus uses the Client/Server TCP , Master/Slave Concept
Request
Client/Master How fast is the Server/Slave
motor running?
1,000 rpm
Response
The Client/Master is The Server/Slave is
the entity that
the entity
provides the service
requesting a service
Modbus RTU/ASCII and Modbus TCP
RTU/ASCII
• Serial level
‒ RS232
‒ RS485
TCP
• Physical layer (Ethernet)
‒ Modbus IP
‒ Modbus Ethernet
‒ Modbus TCP/IP
Many good reasons to use Modbus
Easy to implement
Schneider Electric Standard
Requries significant less memory
• Use Small 8-bit processors
• 2-10% of a BACnet message
RTU & ASCII Framing mode Modbus/ASCII Modbus/RTU
ASCII 0...9 and
Characters A..F Binary 0...255
2 Framing Modes LRC Longitudinal CRC Cyclic
Redundancy Redundancy
• RTU Error check Check Check
‒ Each byte (8-bit) in a message is sent as two 4-bit Frame start character ':' 3.5 chars silence
hexadecimal characters.
characters
Frame end CR/LF 3.5 chars silence
Gaps in 1.5 times char
• ASCII message 1 sec length
‒ Each byte (8-bit) in a message is sent as Start bit 1 1
2 ASCII characters
Data bits 7 8
even/od even/od
Parity d None d None
Stop bits 1 2 1 2
Function codes supported in SBO
“The function code tells the slave device which type of register to access and whether to read from that
register or write to it”.
Read function codes:
• None
• 01, 02, 03, and 04
Write function codes:
• 05, 06, 15, and 16
Register Types
Digital coil
16-bit unsigned (a whole number between 0 and 65535)
16-bit signed (a whole number between -32768 and 32767)
32-bit unsigned (a number between 0 and 4,294,967,295)
32-bit unsigned (swapped)
32-bit signed (a number between -2,147,483,648 and 2,147,483,647)
32-bit signed (swapped)
32-bit real (a real number can be a whole number, fraction, or irrational numbers; these numbers can be positive, zero, or negative)
32-bit real (swapped)
64-bit real
64-bit real (swapped)
32-bit unsigned Mod10K (2 registers, A + (B*10,000))
32-bit unsigned Mod10K (swapped)
32-bit signed Mod10K
48-bit unsigned Mod10K (3 registers, A + (B*10,000) + (C * 100,000,000))
48-bit unsigned Mod10K (swapped)
64-bit unsigned Mod10K (4 registers, A + (B * 10,000) + (C * 100,000,000) + (D * 1,000,000,000,000))
64-bit unsigned Mod10K (swapped)Surface
64-bit unsigned (Analog: 0 to 4,503,599,627,370,495. Multistate: 0 to 9,223,372,036,854,775,807 )
64-bit unsigned (swapped)
64-bit signed (Analog: -4,503,599,627,370,495 to 4,503,599,627,370,495. Multistate: −9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
64-bit signed (swapped)
Modbus in AS-P (and in ES)
Native Modbus objects
No Cost Interface – not an add on driver
Support for Modbus RTU/ASCII, Modbus TCP and Modbus TCP gateways
Engineering efficiencies via Modbus device libraries
• Smart widgets ( former “Power Objects”)
Modbus limitation with SBO
Function Enterprise Server Automation Server, AS-B Comment
AS-P
Maximum number of 124 124 50 a Maximum 62 devices per COM port x
RTU slave devices 2 ports = 124
More than 31 devices per COM port
requires a repeater
Enterprise Server: Requires 2 serial
ports to be available
Maximum number of 247 247 50 a –
TCP server devices
Maximum number of 32 8 2a –
TCP gateways
Maximum number of 2 2 2a –
concurrent TCP client
connections when
acting as TCP server
Maximum number of 2 2 2a Maximum 1 RTU master per COM
RTU masters when port x 2 ports = 2
acting as a serial slave
Enterprise Server: Requires 2 serial
ports to be available
Maximum number of 10,000 b 10,000 b 2,000 ab Total number of objects for TCP
Modbus objects per (including gateways) and serial
server
Modbus Interfaces inside SBO
• Modbus Interface
‒ enables one or more external devices (master devices or clients) to
communicate with a SmartStruxure server. The Modbus Interface
defines whether the internal device of the SmartStruxure is a slave
or a server (or both), depending on the network you want to set up.
• Modbus Master Network
‒ enable a network of serial (RS232/RS485) slaves device to
communicate with a SmartStruxure server. ES or AS-P work as
serial Master
• Modbus Slave Network
‒ enable a serial (RS232/RS485) master device to communicate with
a SmartStruxure server. ES or AS-P work as serial slave.
Modbus Interfaces inside SBO - continue
• Modbus TCP Gateway
‒ enables the SmartStruxure server to communicate with remote
Modbus serial devices over the Ethernet, by way of an external
gateway device.
• Modbus TCP Network
‒ enable a network of external TCP Server devices to communicate
with a SmartStruxure server. ES or AS-P work as TCP client
• Modbus TCP Server
‒ enable a external TCP Client device to communicate with a
SmartStruxure server. ES or AS-P work as TCP Server.
Smart Widgets
• Importable Library, automatically create the below:
‒ Folders, alarm, graphics , signals and trends
• TGML Graphics
• Bindings between TGML and signals
• Standard Smart Widgets has below menus:
‒ Configure - to write and setup the writable registers
‒ Diagnostics - to show the current status with solutions
‒ Monitor - to present all readable data
‒ Info - show Version , Documentation , Benefits and certification