Post on 14-Apr-2018
transcript
7/27/2019 EIT IDC Modbus Data Comms Systems
http://slidepdf.com/reader/full/eit-idc-modbus-data-comms-systems 1/19
23/08/2013
1
www.eit.edu.au
Modbus Datacommunications
systems
bySteve Mackay
www.eit.edu.au
EIT Micro-Course Series
• Every two weeks we present a 35to 45 minute interactive course
• Practical, useful with Q & Athroughout
• PID loop Tuning / Arc FlashProtection, Functional Safety,Troubleshooting conveyors
presented so far• Upcoming:
– Electrical Troubleshooting andmuch much more…..
• Go to http://www.eit.edu.au/free-courses
• You get the recording and slides
Modbus Data Communication Systems
IDC Technologies and EIT
7/27/2019 EIT IDC Modbus Data Comms Systems
http://slidepdf.com/reader/full/eit-idc-modbus-data-comms-systems 2/19
23/08/2013
2
www.eit.edu.au
Overall PresentationA review of the Modbus Protocol andrelated some troubleshooting issues.
www.eit.edu.au
Objectives
• Give an introduction to Modbus
• Review simple troubleshooting steps
Modbus Data Communication Systems
IDC Technologies and EIT
7/27/2019 EIT IDC Modbus Data Comms Systems
http://slidepdf.com/reader/full/eit-idc-modbus-data-comms-systems 3/19
23/08/2013
3
www.eit.edu.au
Topics
• Introduction to Modbusprotocol
• TroubleshootingModbus
• Conclusion
www.eit.edu.au
1.0 Introduction
to Modbus
Modbus Data Communication Systems
IDC Technologies and EIT
7/27/2019 EIT IDC Modbus Data Comms Systems
http://slidepdf.com/reader/full/eit-idc-modbus-data-comms-systems 4/19
23/08/2013
4
www.eit.edu.au
Objective• The Modbus Messaging protocol
• The transportation of Modbus requests and responses on serialnetworks
• Modbus memory allocation
• Modbus Function Codes and their application
• The difference between Modbus RTU and ASCII
• Troubleshooting Modbus systems in terms of:
No response to requests
Exception responses
www.eit.edu.au
Modbus messaging
• Application layer (OSI layer 7) protocolthat provides client/server communicationbetween devices connected to different
types of buses or networks
• ‘Request/Response’ type protocol and nota ‘master/slave’ type protocol
Modbus Data Communication Systems
IDC Technologies and EIT
7/27/2019 EIT IDC Modbus Data Comms Systems
http://slidepdf.com/reader/full/eit-idc-modbus-data-comms-systems 5/19
7/27/2019 EIT IDC Modbus Data Comms Systems
http://slidepdf.com/reader/full/eit-idc-modbus-data-comms-systems 6/19
23/08/2013
6
www.eit.edu.au
Modbus Serial communicationstack
www.eit.edu.au
Protocol stack
Modbus Data Communication Systems
IDC Technologies and EIT
7/27/2019 EIT IDC Modbus Data Comms Systems
http://slidepdf.com/reader/full/eit-idc-modbus-data-comms-systems 7/19
23/08/2013
7
www.eit.edu.au
Modbus Serial ADU
www.eit.edu.au
Modbus....
• The Function field
• The Data field
Allocation of Modicon memory address blocks
• The Address field
• The Error Check field
Modbus Data Communication Systems
IDC Technologies and EIT
7/27/2019 EIT IDC Modbus Data Comms Systems
http://slidepdf.com/reader/full/eit-idc-modbus-data-comms-systems 8/19
23/08/2013
8
www.eit.edu.au
RTU mode• 8 data bits, even, odd or no parity, 1 or 2 stop bits• Gap of 3 ½ character lengths used for header
(3 ½ mS)• Same for trailer• Gap in transmission >1,5ms causes frame to be discarded• CRC error checking• 999810 transmitted as <0x27><0x0E> (2 bytes)
RTU message frame
www.eit.edu.au
ASCII Mode
• 7 data bits, even, odd or no parity, 1 or 2 stop bits• Header = : (colon)• Trailer = <CR> <LF>• Gaps of 1 second in frame acceptable• LRC error checking (not CRC)• 999810 (0x270E) transmitted as the ASCII string 270E i.e.
<0x32><0x37><0x30><0x45> (4 bytes)
ASCII message frame
Modbus Data Communication Systems
IDC Technologies and EIT
7/27/2019 EIT IDC Modbus Data Comms Systems
http://slidepdf.com/reader/full/eit-idc-modbus-data-comms-systems 9/19
23/08/2013
9
www.eit.edu.au
Function Code
• Read input discrete :
• FC01- reading coils-RTU mode :
www.eit.edu.au
Function Codes....
• Read multiple registers :
• FC04-reading input register
Modbus Data Communication Systems
IDC Technologies and EIT
7/27/2019 EIT IDC Modbus Data Comms Systems
http://slidepdf.com/reader/full/eit-idc-modbus-data-comms-systems 10/19
23/08/2013
10
www.eit.edu.au
Function Codes....
• Write single register :
• Write coil :
www.eit.edu.au
Force multiple coils
• Write multiple registers :
Modbus Data Communication Systems
IDC Technologies and EIT
7/27/2019 EIT IDC Modbus Data Comms Systems
http://slidepdf.com/reader/full/eit-idc-modbus-data-comms-systems 11/19
23/08/2013
11
www.eit.edu.au
2.0 Modbus - Troubleshooting
www.eit.edu.au
Typical problems
• Hardware or software problems :
Mis-wired communication cabling and faultycommunication interfaces
Controller application tries to accessnon-existent target devices nodes oruse invalid Function Codes, addressnon-existent memory locations in thetarget devices, or specify illegal dataformat types
• Hardware problems
• Software (protocol)related problems
Modbus Data Communication Systems
IDC Technologies and EIT
7/27/2019 EIT IDC Modbus Data Comms Systems
http://slidepdf.com/reader/full/eit-idc-modbus-data-comms-systems 12/19
23/08/2013
12
www.eit.edu.au
Tools usedRS-232 breakout boxes, RS-232 to RS-485converters, continuity testers, voltmeters,screwdrivers, pliers, crimping tools andcabling tools.
• Hardware tools :
• Software tools Protocol analyzer
• Software troubleshooting
• Hardware troubleshooting
www.eit.edu.au
Overall Concept
Modbus Data Communication Systems
IDC Technologies and EIT
7/27/2019 EIT IDC Modbus Data Comms Systems
http://slidepdf.com/reader/full/eit-idc-modbus-data-comms-systems 13/19
23/08/2013
13
www.eit.edu.au
Tools of the trade• Cable tester
• TCP/IP (and other third party) Utilities
• Protocol Analyzer (e.g. Wireshark)
www.eit.edu.au
Hardware and Physical Cabling
• Check cable on both sides of connection
• Switch lights
• Incorrect wire type and components
• Straight versus cross over cable
• Excessive untwists
• Damaged RJ-45 connector
• Electrical noise and shielding
Modbus Data Communication Systems
IDC Technologies and EIT
7/27/2019 EIT IDC Modbus Data Comms Systems
http://slidepdf.com/reader/full/eit-idc-modbus-data-comms-systems 14/19
23/08/2013
14
www.eit.edu.au
TCP/IP Utilities• Ping
• Arp
• Netstat
• Nbtstat
• Ipconfig
• Tracert
www.eit.edu.au
Ping -t• Easiest ways to test connectivity across the network and
confirm that an IP address is reachable
Modbus Data Communication Systems
IDC Technologies and EIT
7/27/2019 EIT IDC Modbus Data Comms Systems
http://slidepdf.com/reader/full/eit-idc-modbus-data-comms-systems 15/19
23/08/2013
15
www.eit.edu.au
Arp -a• Displays hardware and IP address
mapping
www.eit.edu.au
Netstat -e
• Displays activitiessince last reboot
• Useful data on any
problems
Modbus Data Communication Systems
IDC Technologies and EIT
7/27/2019 EIT IDC Modbus Data Comms Systems
http://slidepdf.com/reader/full/eit-idc-modbus-data-comms-systems 16/19
23/08/2013
16
www.eit.edu.au
Nbtstat• Protocol Stats & TCP/IP connections
www.eit.edu.au
Ipconfig /all
Modbus Data Communication Systems
IDC Technologies and EIT
7/27/2019 EIT IDC Modbus Data Comms Systems
http://slidepdf.com/reader/full/eit-idc-modbus-data-comms-systems 17/19
23/08/2013
17
www.eit.edu.au
Tracert
www.eit.edu.au
Packet Analysis
Modbus Data Communication Systems
IDC Technologies and EIT
7/27/2019 EIT IDC Modbus Data Comms Systems
http://slidepdf.com/reader/full/eit-idc-modbus-data-comms-systems 18/19
23/08/2013
18
www.eit.edu.au
OSI Model
www.eit.edu.au
Packet Structure
Modbus Data Communication Systems
IDC Technologies and EIT
7/27/2019 EIT IDC Modbus Data Comms Systems
http://slidepdf.com/reader/full/eit-idc-modbus-data-comms-systems 19/19
23/08/2013
www.eit.edu.au
Section 3Conclusion
www.eit.edu.au
Thank You For Your Interest
If you are interested in further training, please visit:
IDC Technologies Short Courses:
Two-day practical courses available to the public:
http://idc-online.com/workshops
IDC Technologies Conferences:
http://idc-online.com/conferences-main
The Engineering Institute of TechnologiesOnline Certificate and
Advanced Diploma programs:www.eit.edu.au
Modbus Data Communication Systems