Industrial Networks & Databases - Device Bus - - Field Bus - - Data Bus -
Recall MODBUS protocol is a messaging structure used to set up master/client type communications with slaves/servers between intelligent devices It is a protocol with one master and no direct communication from slave to slave MODBUS PLUS is an industrial networking system that uses tokenpassing peer-to-peer communications at data transfer rates of one megabits per second; It uses the MODBUS messaging structure to establish multi-master communication. 2
Modbus TCP/IP MODBUS TCP/IP uses TCP/IP and Ethernet up to 1 Gbits/s to carry the MODBUS messaging structure. 7 APPLICATION Modbus 6 PRESENTATION EMPTY 5 SESSION EMPTY 4 TRANSPORT TCP 3 NETWORK IP 2 LINK = LLC + MAC CSMA/CD 1 PHYSICAL Ethernet V2 or 802.3 3
OSI Correspondence to the TCP/IP Layer Model OSI Model Few working networks are implemented on the OSI Model TCP/IP Layer Model Developed before the OSI It s simpler and has fewer layers Application Presentation Session Transport Network Data-Link Physical TCP/IP Model Application Service Layer Service Provider Layer (Host-to-Host) Internetwork Layer Subnetwork Layer (Network Access Layer) The TCP/IP Layer model: Application Service Layer Provides the functionality of the Application, Presentation and Session layers Service Provider Matches the Transport Layer. Called Transport Layer. Internetwork Layer Matches the OSI Network Layer. Called the Network Layer. Subnetwork Layer Includes the OSI Data Link and Physical Layers 4
Data Movement TCP IP Application Modbus Service Provider Layer (Host-to-Host) Internetwork Layer PLC Modbus Service Provider Layer (Host-to-Host) Internetwork Layer User application requests information from a PLC A Modbus message is formed in the Modbus layer Starting register, block length. Message is encoded, sent received and passed to the PLC Information is sent back to application following the same procedure Subnetwork Layer (Network Access Layer) Subnetwork Layer (Network Access Layer) Modbus TCP/IP 5
Modbus TCP/IP Network Media - Coaxial Cable Coaxial Cable - Two types used Thin 10Base2 networks Thick 10Base5 networks Point to Point - If a single connection fails, the entire network fails Thin Coax Thick Coax Thin coaxial cable is known as RG58 It is used in thin ethernet (10Base2) installations 50 centimetres minimum distance 185 metres maximum segment length between connection points Maximum 30 connections per segment 5 centimetres minimum bend radius Uses BNC (Bayonet-Neil Concelman) connectors External diameter of +/- 4.9 millimetres Thick coaxial cable is known as RG8 500 metres maximum segment length Maximum 100 connections per segment Uses a viper tap to connect backbone to network interface card It is used in thick ethernet (10Base5) installations 2.5 metres minimum distance between connection points 25 centimetres minimum bend radius External diameter of +/- 10.29 millimetres 6
Modbus TCP/IP Network Media - Twisted Pair Used increasingly, even at 100 Mbps UTP - Insulated pairs of copper wires twisted together Multiple colour-coded pairs enclosed in a plastic sleeve Faster than coaxial cable STP - Indivisible pairs enclosed in a shielding with aluminium foil Category 5 (Cat 5) The most common for IT networks Cat 5 = 100 Mbps (specification pending) Cat 3 = 10 Mbps Uses RJ45 connector Unshielded twisted pair is known as UTP It is currently available in 5 different categories (Cat 1 to 5) Cat 5 UTP is used in 10BaseT, 100BaseT, gigabit and token ring Cat5 is the most popular installation choice presently Cat6 is being developed for the next generation of installations 100 meteres maximum segment length Overbending the cable increases cross-talk between Uses RJ45 plugs and sockets the 8 wires 7
Modbus TCP/IP Network Media - Optical Fibres Three component parts: Core Carries the light beam (glass or plastic) Cladding Glass tube which reflects any interference light in the core Coating Protects the core and the optical cladding Multimode fibre is the most popular type as it is the least expensive and easier to use. 8
Optical Fibres Single-mode fiber is a higher performance, longer distance and more expensive technology than multimode fiber. Multi-mode fiber is generally limited to one or two kilometers in length, depending on the application. 9
Fibre Optic Connectors ST Connector SC Connector Industrial equipment uses both ST an SC type connectors ST connectors have a bayonet type lock 10
Transmission media Ethernet is available on three types of medium: Name Description Speed Max. Max. no. of length stations/segment Coaxial cable 10 base 5 Thick Ethernet 10 Mbps 500 m 100 10 base 2 Thin Ethernet 10 Mbps 185 m 30 Shielded 10 base T Twisted pair 10 Mbps 100 m 1024 twisted pair 100 base TX Twisted pair cat. 5 100 Mbps 100 m??? Optical fibre Radio 10 base F 2 fibres 10 Mbps 2000 m 1024 100 base FX 2 fibres 100 Mbps 2000 m??? wireless 11
Modbus TCP/IP Physical Layer Topology: Free Bus, star, tree or ring Maximum distance: Depends on medium and speed Minimum: 200 m on 100 base TX Maximum: 40,000 m on 10 base F Speed: 10 Mbps - 100 Mbps - 10 Gbps 10 Gbps in office automation Max. no. of devices: Depends on medium Minimum: 30 per segment on 10 base 2 Maximum: 1024 on 10 base T or 10 base F 12
Transport network link layers Medium access method: CSMA/CD (Carrier Sense Multiple Access with Collision Detection) The stations listen to the transmission medium and wait until it is free to send. If a collision is detected, each station continues to send in order that the collision is seen by the entire network. The stations resend their message after a random period of time has elapsed. 13
Modbus TCP Application Layer - Frame Modbus frame ADU (Application Data Unit) Address Function Data Checksum PDU (Protocol Data Unit) Modbus TCP frame ADU (Application Data Unit) MBAP Function Data MODBUS Application Protocol Header PDU (Protocol Data Unit) Frame Identifier Protocol Identifier Size Unit Identifier 2 bytes 2 bytes 2 bytes 1 byte Modbus = 0 Modbus Address 14
Modbus TCP Application Layer - Conformance Class Class 0 read multiple registers (#03) write multiple registers (#16) Class 1 read coils (#01) read input discretes (#02) read input registers (#04) write coil (#05) write single register (#06) read exception status (#07) Class 2 force multiple coils (#15) read general reference (#020) write general reference (#021) mask write register (#022) read/write registers (#023) Machine/vendor/network specific functions diagnostics (#08) program (484) (#09) poll (484) (#10) get comm event counters (Modbus) (#11) get comm event log (Modbus) (#12) program (584/984) (#13) poll (584/984) (#14) report slave ID (f#17) program (884/u84) (#18) reset comm link (884/u84) (#19) program (ConCept) (#40) firmware replacement (#125) program (584/984) (#126) report local address (Modbus) (#127) 15
Modbus TCP/IP-ETHERNET DATA PACKET 16
Modbus TCP Application Layer Frame (example) Protocol PPP (Point-to-Point Protocol, RFC 1661) can be used to transfer data other protocol frames - inside the PPP pocket Frame PPP Frame IP Frame TCP Frame Modbus 17
Modbus TCP Application Layer Frame (example) 0 21 IP Protocol ID 45 0 0 34 0 7d 40 0 80 6 40 1d a 74 11 bb d9 62 c4 98 Port 502 Ver IHL TOS Size ID Flags o TTL ffset TCP Checksum Source Addres Dest. Addres Protocol ID 16 2e 1 f6 c d a c 30 80 4b be 50 18 ff ff 49 45 0 0 Source Port Frame ID Protocol ID Dest. Port Size Sequence no Ack. no 0 1 0 0 0 6 1 3 0 c7 0 5 Start Size Address Function Header size Flags Window size Check sum Data index Modbus pocket TCP pocket IP pocket PPP pocket cb 9b Unit ID FCS 7 bytes 1 byte 2 bytes 2 bytes Function First word Number of MBAP code = 3 address = 199 words to read = 5 18
Ports & Sockets HTTP Modbus TCP SMTP Network Device TCP multiplexes multiple connections to a single host using sockets and ports (IP address: a.b.c.d) Each computer interface is divided into 65536 ports. Ports Incoming packets know the address (IP) and the port 80 Destination port is part of the TCP protocol field 502 Ports are numbered and are like a pigeon hole mail Mail for a specific person is only delivered to a single hole SMTP (Simple Mail Transfer Protocol) 25 goes to port 25 HTTP goes to port 80 Modbus TCP -> port 502 Sockets The combination of an IP address and a port number 19
Ports & Sockets 21TCP File Transfer - FTP control 22TCP SSH Remote Login Protocol 22UDP pcanywhere 23TCP Telnet 25TCP Simple Mail Transfer Protocol (SMTP) RFC 821. 37TCP UDP Time Protocol RFC 868. 53TCP UDP Domain Name Server (DNS) 67TCP UDP Bootstrap Protocol Server 68TCP UDP Bootstrap Protocol Client (BOOTP) RFC 951. 80TCP Hypertext Transfer Protocol (HTTP) RFC 2616. 110TCP UDP Post Office Protocol (POP) Version 3 RFC 1939. 137TCP UDP NetBIOS Name Service 138TCP UDP NetBIOS Datagram Service 139TCP UDP NETBIOS (Session Service) Windows file and printer sharing. 143TCP UDP Internet Message Access Protocol (IMAP) Mail Server IMAP 161TCP UDP Simple Network Management Protocol (SNMP) 162TCP UDP SNMPTRAP 20
Modbus TCP/IP - summary Medium access method: Determinism: Transmission method: Max. size of useful data: Transmission security: CSMA/CD Resolved using segmentation Load factor < 10% In packets or IP datagrams, 64 to 1500 bytes 1442 bytes per packet (APDU) CRC32 at link layer level Acknowledgement at TCP link level Response at application level (Modbus) 21
Example of Architecture Redundant optical ring 200 Mbps full duplex Switch Switch Switch Premium Transceiver Optical fibre Hub Transceiver Quantum Optical loop Hub Quantum Momentum Magelis Momentum Altivar 58 Altistart 48 Altivar 38 Momentum Altivar 58 22
Example of Architecture I/O scanning on Momentum CPU 16 distributed I/O modules 23
Example of Architecture Modbus TCP/ Modbus RTU Brigde (Gateway) About 250 power meters and controllers on modbus RTU 24