Modbus for Field Technicians Page 1 Modbus for Field Technicians Revision 1.0 Any reproduction or re-transmission in whole or in par
Modbus for Field Technicians Page 10 BUT HERE IS THE IMPORTANT PART Let's say you want to read, for example, the value of holding registe
Modbus for Field Technicians Page 11 The same discussion applies to the other data types. Publicly we number them from 1. Privately (inside th
Modbus for Field Technicians Page 12 4. WHAT ABOUT SCALING IN MODBUS Modbus does not provide a method for transporting large or Floa
Modbus for Field Technicians Page 13 message there is no way of telling whether you are looking at two consecutive 16 bit words,
Modbus for Field Technicians Page 14 6. BYTE/WORD ORDER – AN AMBIGUOUS NIGHTMARE It takes two bytes to make a 16 bit word. These bytes can be
Modbus for Field Technicians Page 15 This is ambiguous. Here is how you resolve this – Apply common sense - Which value is correct. Read
Modbus for Field Technicians Page 16 7. BIT ORDER – SOMETIMES IT’S A PROBLEM TOO In older Modicon PLC’s bits were numbered 1-16. All modern s
Modbus for Field Technicians Page 17 8. MODBUS AND GATEWAYS A gateway is a device that makes data read using one protocol available using ano
Modbus for Field Technicians Page 18 9. WHAT ABOUT ERRORS / EXCEPTIONS Modbus has a limited way of reporting errors. A server / sl
Modbus for Field Technicians Page 19 Code Name / Meaning 1 ILLEGAL FUNCTION The function code received in the query i
Modbus for Field Technicians Page 2
Modbus for Field Technicians Page 20 10. THERE CAN ONLY BE ONE MASTER ON A MODBUS SERIAL TRUNK Modbus is a poll-response type of protocol. A
Modbus for Field Technicians Page 21 11. MULTIPLE CLIENTS OF A MODBUS SLAVE We are frequently asked how you deal with a situation where you ha
Modbus for Field Technicians Page 22 Figure 2: Using a FieldServer with an appropriate configuration solves this problem whether you
Modbus for Field Technicians Page 23 Figure 3: Each client is on its own port. Thus each client does not see poll messages fro
Modbus for Field Technicians Page 24 Figure 4: The slave responds. The FieldServer relays the response to client#1. The FieldServe
Modbus for Field Technicians Page 25 Figure 5: If any client requests the same data (client#1 or #2) and the data has not expired then the
Modbus for Field Technicians Page 26 Figure 7: The slave responds, the response is relayed to the client doing the polling (Client#2 in thi
Modbus for Field Technicians Page 27 12. OLD DEVICE – SLOW PROCESSORS – LIMITED CAPABILITY Many older devices have old microprocessors that c
Modbus for Field Technicians Page 28
Modbus for Field Technicians Page 29 MODBUS RS232, RS485 AND TCP/IP
Modbus for Field Technicians Page 3 TABLE OF CONTENTS MODBUS - Introduction ...
Modbus for Field Technicians Page 30 14. HOW MODBUS IS TRANSPORTED There are 3 main physical layers for Modbus. RS232 : One master and one
Modbus for Field Technicians Page 31 15. MODBUS ON RS232 RS232 requires a minimum of 3 conductors to connect the two devices. Rx, Tx and Grou
Modbus for Field Technicians Page 32 16. MODBUS ON RS485 Search the Internet on RS485 you will find Bob Perrins’s article called
Modbus for Field Technicians Page 33 Tip #2 – Connection Order Always connect the ground reference conductor first if you are connecting a de
Modbus for Field Technicians Page 34 Tip Advice #5 – Cable Type Cable selection does make a difference. All cables offer impedance (resist
Modbus for Field Technicians Page 35 Wrong in the sense – to determine the value of terminating resistors now requires measurements
Modbus for Field Technicians Page 36 Tip #6 – Number of Devices per Trunk How do you put more than 32 devices on a single RS485 trunk? The
Modbus for Field Technicians Page 37 Source: Ten Ways to Bulletproof RS-485 Interfaces National Semiconductor Application Note 1057 John Gold
Modbus for Field Technicians Page 38 A single Modbus message can only read consecutive data points. If you need to read 40001 and 40003 you
Modbus for Field Technicians Page 39 Thus at 19200 baud it takes approx to read 125 registers. Poll = 10 bytes at 1920 per sec Server laten
Modbus for Field Technicians Page 4 20. Converting Modbus 16 bit numbers to 32 bit numbers ... 66 21. How Re
Modbus for Field Technicians Page 40 Biasing, Idle State Biasing, Fail Safe Biasing, Anti Aliasing There are a whole string of terms
Modbus for Field Technicians Page 41 Line Drive On / Off To use two wires for RS485 each device’s transmitter and receiver must b
Modbus for Field Technicians Page 42 Getting worse. Making the connections to the RS485 terminals, drops instead of connections starts to
Modbus for Field Technicians Page 43 Worst. Avoid Star configurations. They are so much harder to debug when it gets tricky. (Showing TX condu
Modbus for Field Technicians Page 44
Modbus for Field Technicians Page 45 MODBUS RESOURCES, TESTING AND TROUBLE SHOOTING
Modbus for Field Technicians Page 46 17. WHAT TO TAKE TO SITE WITH YOU Here is a list of tools and resources you should carry
Modbus for Field Technicians Page 47 5. CAS Modbus Scanner – free download CAS Modbus Scanner is a utility to retrieve coils, inputs, holdi
Modbus for Field Technicians Page 48 8. Lcom DB9-Terminal blocks (or similar) http://www.l-com.com/item.aspx?id=8141 Male and Female
Modbus for Field Technicians Page 49 11. Terminating Resistors Take 52.3, 75, 100, 120 and 150 Ohm resistors with you
Modbus for Field Technicians Page 5 MODBUS - INTRODUCTION
Modbus for Field Technicians Page 50 12. Gender Benders 13. Ethernet Patch cables 14. Hub A hub is not a switch. A hub can be used
Modbus for Field Technicians Page 51 Appendix 18. TROUBLE SHOOTING MODBUS TCP/IP REQUIRED TOOLS Hub or Supervised Switch Wireshark – Free Dow
Modbus for Field Technicians Page 52 HOW TO CAPTURE WITH WIRESHARK 1. Capture – Main Menu 2. Interfaces – On Capture Menu a) You get a li
Modbus for Field Technicians Page 53 3. A list of packets accumulates on the screen. 4. Apply a Display Filter. More on display filters la
Modbus for Field Technicians Page 54 5. Find the packet you are interested in. Click on it to select it. A breakout of the selected packet’s d
Modbus for Field Technicians Page 55 6. You can break out the level of detail by expanding the sections of the packet. Think of a Modbus
Modbus for Field Technicians Page 56 7. Drill down to see the Modbus info Before you start a capture you can specify a capture filter. The e
Modbus for Field Technicians Page 57 CAPTURE FILTERS Here are some sample filters Examples: Capture only traffic to or from IP address 172.18
Modbus for Field Technicians Page 58 Capture traffic to a range of IP addresses: dst net 192.168.0.0/24 or dst net 192.168.0.0 ma
Modbus for Field Technicians Page 59 DISPLAY FILTERING Useful Hint : Any capture filter can be used as a display filter. You can use the exp
Modbus for Field Technicians Page 6 Because it is so commonly used, because it is so limited, because some vendors went to a l
Modbus for Field Technicians Page 60 From the drop down list of protocols there is one specifically related to Modbus. They are sh
Modbus for Field Technicians Page 61 19. USING THE CAS MODBUS SCANNER Add a connection Choose from Serial or Ethernet
Modbus for Field Technicians Page 62 Add devices. The device number is the Modbus Device Number. Add requests – polls for data. You can m
Modbus for Field Technicians Page 63 You can add multiple connections. More than one of each type. Each connection can have one or
Modbus for Field Technicians Page 64 Once connections, devices and requests have been defined you can scan for data, exit or edit the settings
Modbus for Field Technicians Page 65 Data is displayed here in various formats. When displayed as floats or 32 bit integers
Modbus for Field Technicians Page 66 20. CONVERTING MODBUS 16 BIT NUMBERS TO 32 BIT NUMBERS Often the Vendor documentation does not re
Modbus for Field Technicians Page 67 Example: In the move below if DA_B01_REG[21] == 1 and DA_B01_REG[22] == 2 Then DA_B01_INT32[21] == 13107
Modbus for Field Technicians Page 68 Example: DA_B01_REG[21] == 1 and DA_B01_REG[22] == 2 Function In Use Value found in DA_B01_INT32[21]
Modbus for Field Technicians Page 69 21. HOW REAL (FLOATING POINT) AND 32-BIT DATA IS ENCODED IN MODBUS RTU MESSAGES The article discusses
Modbus for Field Technicians Page 7 Inputs Think Binary inputs. Also known as Inputs. Also known as 1xxxx inputs (xxxx is the place h
Modbus for Field Technicians Page 70 For example, the number 123456.00 as defined in the IEEE 754 standard for single-precision 32-bit floatin
Modbus for Field Technicians Page 71 Furthermore, both a “byte swap” and a “word swap” would essentially reverse the sequence of the
Modbus for Field Technicians Page 72 As a rule of thumb, the family of a device’s microprocessor determines its endianness. Typica
Modbus for Field Technicians Page 73 PRACTICAL HELP The FieldServer Modbus RTU drivers offer several function moves that handle 32-bit integer
Modbus for Field Technicians Page 74 The following table shows the FieldServer function moves that copy a single 32-bit floating point value to
Modbus for Field Technicians Page 75 Notice that different byte and word orderings require the use of the appropriate FieldServer
Modbus for Field Technicians Page 76 22. HUBS VS SWITCHES – USING WIRESHARK TO SNIFF NETWORK PACKETS Gotcha #1 : Use a hub not a switch Why:
Modbus for Field Technicians Page 77 Gotcha #2 : Mixing 10 and 100 mbits/sec can cause problems. Not all hubs copy 10mbit messages to
Modbus for Field Technicians Page 8 2. THERE ARE (WERE) A MAX OF 9999 POINTS OF EACH DATA TYPE When Modbus was invented they thought 9,999 i
Modbus for Field Technicians Page 9 3. 5 DIGIT VS 6 DIGIT ADDRESSING If 40001 is the 1st, 40002 the 2nd …. We get to 49,999
Comments to this Manuals