Communication_Protocols
Communication_Protocols
2. Profinet
• Profinet communication
• Profinet Configuration
• Profinet Applications (App1 , App2)
3. Profibus
• Profibus communication
• Profibus Applications (App1)
• Comparison between Profinet and Profibus
Communication networks
• communication networks may be used in control systems to pass data between field devices and PLCs,
between different PLCs, or between PLCs and personal computers used for operator interface, data
processing and storage, or management information.
• although a communications circuit can involve only two pieces of equipment with a circuit between them,
the term network typically refers to connecting many devices together to permit the sharing of data
between devices over a single circuits.
The data transmission modes can be characterized in the following three types based on the direction of exchange of
information:
Simplex Half-Duplex
Simplex is the data transmission mode in which the data can Half-Duplex is the data transmission mode in which the data
flow only in one direction, the communication is can flow in both directions but in one direction at a time. It is
unidirectional. In this mode, a sender can only send data but also referred to as Semi-Duplex. In other words, each station
can not receive it. Similarly, a receiver can only receive data can both transmit and receive the data but not at the same
but can not send it. time. When one device is sending the other can only receive
and vice-versa.
RS232
Modbus Protocol
Modbus is a communication protocol developed in 1979 by Modicon (Schneider). In simple terms, it is a method used for
transmitting information over serial lines between electronic devices. The device requesting the information is called the
Modbus Master and the devices supplying information are Modbus Slaves. In a standard Modbus network, there is one
Master and up to 247 Slaves, each with a unique Slave Address from 1 to 247. The Master can also write
information to the Slaves
Several versions of Modbus have been developed to suit the transmission medium being used. Most common are:
▪ RTU
▪ ASCII
▪ TCP/IP
The data transmitted from the master device to the slave device by a message; This message contains
all the data you need
Application Data Unit (ADU)
Address
write
Function
Check Error
Function : Indicates the type of operation to be performed (e.g., read, write , diagnose)
Data: Contains the data associated with the function code, such as the address of the data to be read or written and the actual
data values.
Master/Slave
• Only one master and slaves up to 247, you can use more than one master, but mast separate them to not work at the same
time “interlock”
• Every slave has a unique address start from 1
What about address 0??
address 0 has a special purpose for broadcast:
Broadcast Communication:
Purpose: Used for broadcast messages.
Function: Allows the master to send a message to all slave devices on the network simultaneously.
Responses: Slave devices do not respond to broadcast messages. This prevents collision and ensures efficient communication
3. Communication Parameters:
• Slave address (0-247) Address 0 is reserved for broadcast messages
• Baud Rate: Common values are 9600, 19200, or 38400 bps ( choose the minimum required baud rate)
• Data length: 7 or 8 (Usually 8 bits).
• Parity: is an error-checking method used in serial communication to ensure data integrity during transmission.
Standard RTU
RTU , E , 8 , 1 , 9600
Baud Rate
Stop Bits
Data length
even
Modbus RTU
Applications
Master Configuration
Create data block to send and receive data in it
Read/Write Register
Network 1
Network 3
Network 2
Application 3 : communication between Lumel P18D and S7 1200 PLC
This image illustrates how to set up a Modbus RTU RS485 communication system using a Lumel P18D sensor
along with its wiring and communication settings
Registers addresses
Eng. Ragab Abd Elwanees
Common Steps of communication
The S7 1200 does not support Modbus but support Profinet, so an external module must be added to the PLC to use
Modbus.
The communication board is added in the indicated place. It has its own processor for sending and receiving. It is used if
• It depends on the CPU's ability to send and receive. the network to which the PLC is connected is large.
Network 4
Network 2
Network 7
Network 5
Network 6
Network 8
Network 12
Network 10
Network 13
Frequency Converter Control Word (FC Profile) Frequency Converter Status Word (FC Profile) Modbus Holding Register Numbers for Input and Output Data
• 047C hex (1148 dec) = Start • 043C hex (1084) = Ramp stop • reverse start 847C HEX (33916 DEC)
Master Code
Network 1 Network 3
Network 4
Network 2
Network 5
Network 7
Network 8
Modbus ASCII
• The MBAP header is used to provide information required for communications at the application layer of the Modbus TCP
protocol.
• It contains metadata, such as transaction ID, protocol ID, and message length, which are crucial for managing the
communication process.
• The interface is an Ethernet network, the data transfer protocol is TCP / IP.
• The TCP port used is: 502
03 0068 0003
• At the beginning of the received PDU message, a new 7-byte header is added, which is called MBAP Header (Modbus
Application Header). This header has the following data
• Modbus sends data to Ethernet, which is responsible for connecting the data.
Modbus TCP/IP Characteristics
• Unlike RS485 in TCP/IP, the clients can send data through the ethernet at the same time, which can cause network failure.
To avoid this, Ethernet operates with CSMA/CD.
• CSMA/CD is effective in reducing collisions and ensuring fair access to the network. However, its efficiency decreases as
the network load increases, leading to more collisions and retransmissions.
• Example: Device 1 wants to send data on the network and finds it idle. At the same time, device 2 wants to send data on
the network and finds it idle. So, each device starts sending data. A collision occurs between the data and the transmission
stops. Both devices wait a random period before trying to resend.
• Transaction Identifier: It is used to match requests and responses. It allows the client to link the response to the request so
that the requests arrive in the order in which they were sent,
• Protocol Identifier: Identifies the protocol being used. For Modbus, this value is always set to 0.
• Length: Specifies the number of bytes remaining in the message, following the length field.
• Unit ID: Used to define a remote server on a non-TCP/IP network
Note: The value of transaction Identifier expresses the number of the request sent from the server. The first request might
have a Transaction Identifier of 1, the second request 2, and so on.
Modbus TCP-IP
Simulation
Used Tools:
• CAS Modbus Scanner
• MODSIM32
• MODSCAN3
Register Address
• Operates as a MODBUS slave, simulating data that can be accessed by a MODBUS master
• Send data to slave device
NOTE: to connect to the program you need to know the address of your computer, to connect them as TCP/IP
1. Open CMD
2. Write ipconfig
3. Get your address “IPv4 Address”
Connecting Modbus Simulators via TCP/IP
1. Modsim32
Profinet
Profinet (Process Field Network) is an industry technical standard for data communication over Industrial Ethernet. It's designed
for collecting data from, and controlling equipment in industrial systems, with a particular strength in delivering data under tight
time constraints.
Profinet Layer
Profinet leverages the ISO/OSI model to structure its communication protocols, ensuring efficient and reliable data transfer
within industrial automation systems.
Cyclic Communication
Acyclic Communication
• Purpose: Used for regular, consistent data exchange.
• How It Works: Data is transmitted at regular intervals,
• Purpose: Used for sporadic, on-demand data exchange.
regardless of whether the data has changed. This ensures a • How It Works: Data is transmitted only when needed, such as
predictable and reliable communication pattern, which is for diagnostics, parameter changes, or configuration tasks.
crucial for real-time control processes. This type of communication is less predictable but more
• Example: An IO-Controller regularly polls data from IO- efficient for tasks that do not require constant updates.
Devices to monitor sensor values and control actuators in a • Example: A maintenance engineer sends a request to an IO-
production line. Device to retrieve diagnostic information or change parameter
setting.
Real Time (RT) and Isochronous Real Rime (IRT)
The time varies depending on the application used, as shown in the following image.
Real Time
• Purpose: RT is designed for standard automation tasks that require timely and
deterministic data exchange.
• Performance: It provides predictable communication with typical cycle times ranging
from a few milliseconds to tens of milliseconds.
• Usage: RT is suitable for tasks such as monitoring and controlling sensors and
actuators, where consistent updates are important but not extremely time sensitive.
• Example: In a manufacturing plant, RT is used to monitor the status of conveyor
belts, sensors, and other equipment to ensure smooth operation.
Preamble (7 Bytes):
• Purpose: Synchronizes the receiving device's clock with the sender's clock, ensuring proper timing for the data
transmission.
Start Frame Delimiter (SFD) (1 Byte):
• Purpose: Indicates the start of the frame.
• Destination MAC Address (6 Bytes):
• Purpose: Specifies the MAC address of the receiving device.
• Details: Unique identifier for the network interface of the destination device.
Source MAC Address (6 Bytes):
• Purpose: Specifies the MAC address of the sending device.
• Details: Unique identifier for the network interface of the source device.
Ether Type (2 Bytes):
• Purpose: Indicates the protocol type being carried in the payload.
• Details: Examples include 0x0800 for IPv4, 0x0806 for ARP, and 0x86DD for IPv6.
Frame Check Sequence (FCS) (4 Bytes):
• Purpose: Ensures data integrity by verifying that the frame has not been corrupted during transmission.
• Details: A cyclic redundancy check (CRC) value calculated from the frame's contents.
Eng. Ragab Abd Elwanees
Profinet applications
• ADDR_1: Pointers to the areas on the partner CPU to which the data will be written.
• SD_1: Pointers to the areas on the local CPU which contain the data to be sent.
• ADDR_1: Pointers to the areas on the partner CPU that are to be read.
• RD_1: Pointers to the areas on the local CPU in which the read data is entered.
Note:
• Address 127 is used for broadcast. No Profibus DP Slave device should have this address.
• Address 126 is the hardware address for slaves whose address is set using software.
• Address 0 is reserved for the programming device (PC).
• It helps with connecting devices and disconnecting the device in case of a problem.
• Connector must be plugged into a powered device to enable bus termination.
Profibus with plc
With long distances, we do not use wire to connection device with plc because of cost for that using communication like Profibus
ET200SP
• It is an interface model that is considered a complement to the PLC and connects to the I/O cards.
• After connecting the I/O cards, a model server module must be used so that the device knows that the cards
have been connected.
Note
You may have more than one power card, the location of which is determined by the hardware engineer. In most cases, the
difference between each card and the next is 4 cards.
3. Hybrid method
• Some devices are connected to the PLC at the factory, and some are connected to
the I/O located at a long distance, and the I/O is connected to the PLC via the RS
cable
• The same problem if cable disconnected loses some device
• In Slave Properties
Slave OB1