Industrial Communication: Chapter 4: Ethernet Modbus TCP/IP
Industrial Communication: Chapter 4: Ethernet Modbus TCP/IP
Industrial Communication: Chapter 4: Ethernet Modbus TCP/IP
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
Ethernet Is a Network
History
Developed by Xerox PARC (1973 - 1975) First standard to be published in 1980 (IEEE 802.3)
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
Industrial Ethernet
Used in Different Levels
PLCs remote control the I/O devices, the speed drive, robots,
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
Ports
80 50
Client
Source Port number x Destination Port 502 Destination Port 80 Source Port number y
Server
172.16.4.2 172.16.4.1
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
TCP (Cont.)
Socket management multiple connections
A Client can have multiple connections to the same Server service A Server can have multiple Clients connected to the same service
Server Server has 2 clients connected to the same service (502). 172.16.4.3
172.16.4.2
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
TCP Connections
Point to point messaging protocol
Uses a handshake process to establish a connection Accounts for each byte of sent and received to guarantee delivery Connection is managed by setting bits in the TCP message to request (SYN), acknowledge (ACK), terminate or abort the connection (FIN)
Request conne ction SYN
Client
O P E N
Server
Acknowledged
C L O S E
9
IP (Internet Protocol)
IP: Messaging Protocol Operating at OSI Layer 3 (Network layer) IP Characteristics
Responsible to transmit the message to the destination IP address to the local network or to the remote network. Fragment a packet that is larger than the maximum transmission size unit (MTU) to send as multiple packets and de-fragment the packet at the destination level. It makes no guarantee that the message will reach its destination. The reliability is done by the Transport layer
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
10
IP Address Assignment
Default IP Address
Derived from the factory and unique MAC address
Premium & M340 PLCs
MAC @ IP @
Quantum/Momentum/Advantys
MAC @ IP @
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
11
Classful IP Address
There are 4 main address classes
Class A - Used for larger networks IP Address Range : 1.0.0.0 to 127.255.255.254 Default subnet mask : 255.0.0.0 - 16 777 216 hosts number Class B - Used for Medium networks (ex. Schneider Electric) IP Address range : 128.0.0.0 to 191.255.255.254 Default subnet mask : 255.255.0.0 65 534 hosts number Class C - Used for smaller network and individual users IP Address range : 192.0.0.0 to 223.255.255.254 Default subnet mask : 255.255.255.0 - 254 hosts number Class D - Used for Multicast groups IP Address range : 224.0.0.0 to 239.255.255.255 Devices cannot be assigned IP addresses in the multicast range The Class E is reserved for the future : 240.0.0.0 to 255.255.255.255
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010 12
Special IP Addresses
Loopback
IP address = 127.0.0.1 Reserved for loopback (host connecting to itself) Ex. A web browser connecting to a web server running on the same PC
Broadcast
IP address = 255.255.255.255 Used by the network management or diagnostics is addressed to all devices on the network.
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
13
Subnet Mask
Used to determine if the remote device is on a local or remote network
The mask separates the network portion of the IP address from the host portion of the IP address The sending device uses its configured subnet mask to perform a Boolean AND operation with both its local IP address and the IP address of the remote device to connect to
IP Address 172.16.5.20 Local device Subnet Mask 255.255.255.0 Result IP Address 172.16.4.20 Remote device Subnet Mask 255.255.255.0 Result
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
14
Troubleshoot TCP/IP
In Windows Monitoring Free Tool: WireShark
http://www.wireshark.org/
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
15
Troubleshoot TCP/IP
Ping Command
Used to check a connection
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
16
Exercises
IP Address (p4-19) Find your IP address (record it for future use) Change the IP address into 192.168.0.X1 or 192.168.0.1X1 (X=Group Number) Troubleshoot TCP/IP (p4-23) Use PING command to ping your partner
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
17
Dynamic Assignment
IP Assignment Given By Servers
Switch
Switch
Client
Your IP @ Your IP @
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
18
BootP Server
Server Has a Populated List of Devices
Devices identified with their MAC address Device #1
My MAC address is 00.80.F4.FF.00.D5, Can I get an IP Address?
Master (Server)
00.80.F4.FF.00.D5 192.168.0.23 192.168.0.81 192.168.0.40 00.80.F4.FF.44.21 00.80.F4.FF.F2.15
Sure! You are listed in my address table. Take this address: 192.168.0.23
Device #2
Sorry, you are not listed into my address table. Use your default IP address
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
19
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
20
DHCP Server
Same As BootP but Based on Role Name
User configurable names used instead of MAC Addresses Device #1
My name is STBNIP2212_023, Can I get an IP Address?
Master (Server)
STBNIP2212_023 192.168.0.23 192.168.0.87 192.168.0.21 TesysT_046 ATV71_555
Sure! You are listed in my address table. Take this address: 192.168.0.23
Device #2
Sorry, you are not listed into my address table. Use your default IP address
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
21
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
22
DHCP Server
Example with Unity Pro
23
FDR Server
Additional Feature of DHCP Server.
Send the stored configuration inside a replaced device Device #1
My name is TesysT_072, Save my settings now!
Master (Server)
TesysT_072 192.168.0.87
Device #1
Master (Server)
TesysT_072 192.168.0.87
New Device
Sure! You are listed in my table. Take this address: 192.168.0.87 Moreover, I found a configuration corresponding to your role name. Here is your new configuration.
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
24
ARP
Address Resolution Protocol
Request to obtain IP address Duplicate Address Check Device issues ARP for the IP address it intends to take If no response, the device assumes the IP address If there is a response, the device should not assume the IP (duplicate address)
25
Allows the Broadcast message, unlike TCP that requires a dedicated socket between the end device. Applications example using UDP :
Simple Network Management Protocol (SNMP) Network Time Protocol (NTP) BootP and DHCP Global Data (Real Time Publish Subscribe)
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
26
Software Tools
Windows PING Command Unity Pro Online View
Ping and bandwidth
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
27
Fiber optic
Adapt different types of media Using over long distances or harsh industrial environment
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
28
The maximum length of one segment is 100 meters at 10, 100, 1000 Mbit/s.
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
29
ST connector
LC connector MTRJ connector Newer keyed Fiber connector Smaller form factor : higher density
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
30
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
31
Transceivers
Adapt different types of media Ex. 499NTR10100 : converter electrical signal to optic signal
499NTR10100
Routers
Used to route information between networks
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
32
Transmitter 1
Receiver
Transmitter 2
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
33
Transmitter 1
Receiver
Transmitter 2
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
34
Router
172.16.4.254 172.16.4.1
172.16.5.254
172.16.5.1
Local Subnet
172.16.4.2
Remote Subnet
Nota : If there is not a router on the local network, the default gateway can be left blank or 0.0.0.0
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
35
No switches needed
36
Switch or Hub
End Device
Crossed Cables
Connect hubs or switches together
Switch or Hub
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
Switch or Hub
37
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
38
2 Ways of Configuration
Normal Ethernet Ports
CPU Embedded Ports (BMXp442030, TSXP572634) Ethernet Modules (BMXNOE0100, TSXETY5103)
Standard Configuration
From Project Browser, Select the Network Component
Right click and create a new network
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
40
Network Configuration
Options Depends on the Model
Modules Utilities
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010 41
Modules Utilities
IP Configuration Messaging
Access rights from other devices.
Bandwith
estimation of the Bandwith taken by the different services.
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010 42
IP Configuration
Static (Configured) Dynamic (From a server)
Assign a role name (optional)
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
43
Exercise
Ethernet Configuration (p4-38) Create a new project Create a new network Test the connection Configure the role name of the slave Configure the DHCP Test the configuration
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
44
ADDM FB
IN:
String variable: NameOfTheNetwork{TargetIPAddress}
Out
Converted table of words, to be used in the others FB
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
46
READ_VAR FB
IN:
ADR: to be linked to the output of the ADDM block. OBJ: defining object to read (in the case of Modbus register: %MW) NUM: starting register to read NB: number of consecutive register to read
OUT
RECP: reception zone of the block, delivering the value read (table of words)
IN/OUT
GEST: table of 4 words to manage the communication block (errors, timeout, length, etc..)
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
47
WRITE_VAR FB
IN:
ADR: to be linked to the output of the ADDM block. OBJ: defining object to read (in the case of Modbus register: %MW) NUM: starting register to read EMIS: source table to write from the PLC
IN/OUT
GEST: table of 4 words to manage the communication block (errors, timeout, length, etc..)
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
48
Exercise
Sending Requests (p4-42) Enable Allow Dynamic Arrays in Project Settings Insert the ADDM FB Insert READ_VAR and WRITE_VAR FB Test the configuration
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
49
Master / Client
Slave / Server
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
50
IO Scanning
Filling the Different Fields
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
51
IO Scanning (Cont.)
Debug View Online Mode (M340 and Premium Only)
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
52
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
53
Exercise
IO Scanning Configuration (p4-48) Configure IO Scanning Testing IO Scanning Monitoring IO Scanning Status Retrieving Process Data Values Advantys STB Integration Tool (p4-52) Create the device Test the configuration
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
54
Frame Application
HART
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
55
Communication DTM
Communication Driver
Gateway DTM
Gateway Driver
Device DTM
Device Driver
BTM
BTM
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
56
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
57
Hardware Catalog
DTM Database
Tools Menu Hardware Catalog
Update Tool
Used to add New devices inside the catalog DTM must be installed in Windows before
- DTM Config saved into STU or STA (not XEF) - DTM must be installed on the computer (otherwise project cannot be saved)
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010 58
DTM Transfer
With Project Transfer
Integrated DTM
PLC
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
59
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
60
NOC0401 Configuration
Added in Unity Pro
PLC_Bus Viewer
DTM Browser
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010 61
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
62
Address Setting
Enter static or dynamic IP configuration
Request Setting
IO Scanning configuration inside the module
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
63
Monitoring Connection
Connection Bit
Monitoring if device is present
Control Bit
Enable / Disable IO Process Data update
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
64
Exercises
Change the Device Role Name (p4-64) Assign new name to distinguish from previous exercise Installing the DTM (p4-65) Installing DTM & Update the hardware catalog Configuring NOC0401 and Modbus TCP/IP (p4-67) Insert BMXNOC0401 and configure it Add a Generic Modbus device and configure it Create custom variable names Test the application Do the same by configuring device from DTM
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
65
Industrial Communication Course with Unity Pro Ethernet Modbus TCP/IP Schneider Electric | Industry Business | Training | E. Pauchet V5.0 May 2010
66