


In an S7 PLC, the holding registers are located at the addresses 40,001 to 49,999. The MB_DATA_ADDR pin is a reference to the holding register that will be used in the communication between the client and server.

Here I use a constant with the value of 1 to indicate that we want to use the Modbus client to make a write request to the server. You can use the value 0 to select read mode and the value 1 to select write mode. The MB_MODE pin defines the mode of the Modbus request from the client. In this example, I have set the DISCONNECT pin to False. The DISCONNECT pin forces the client to disconnect from the server. In this example, I have set the REQ pin to True so that the client is continuously polling the server. If the REQ pin is permanently high, then the client will poll the server at a rate that is pre-defined by the instruction. The REQ pin tells the Modbus client to poll the data exchanged with the Modbus server. When security is not a concern (e.g in an air gapped automation system)Īfter creating an instance data block for the call to MB_CLIENT, I can start parameterizing the block.We are communicating between devices made by different manufacturers (e.g an S7 PLC and a Universal Robot controller),.In TIA Portal, that means that the sending PLC must be programmed with an instance of the MB_CLIENT instruction and the receiving PLC must be programmed with an instance of the MB_SERVER instruction.īased on these advantages and disadvantages, we can see that it makes sense to use the Modbus/TCP communication protocol when Unlike S7 Communication, which is a single sided communication mechanism, for two devices to communicate via Modbus/TCP, both devices must be programmed. Modbus/TCP Requires Client and Server Side Programming This creates a potential security vulnerability in an automation system. Modbus/TCP does not provide the option to use security or encryption when communicating between devices. Disadvantages of Modbus/TCP Modbus/TCP is not a Secure Communication Protocol For this reason, Modbus/TCP is an ideal communication protocol for communicating between devices made by different manufacturers. This means that the communication protocol is not tied to the hardware of a specific vendor (like S7 Communication). Modbus/TCP is a communication protocol that is supported by most industrial devices. This makes it ideal for new projects that are taking advantage of the technological innovations in the S7-1200 and S7-1500 controllers.įor legacy systems, Modbus/TCP can also be used with Unoptimized Data Blocks. Since Modbus/TCP is a relatively modern protocol, it can work with Optimized Data Blocks in TIA Portal. Modbus/TCP Works with Optimized Data Blocks This means that if the communication between two devices breaks down, we get an error to alert us that something has gone wrong. The Modbus/TCP communication protocol has a defined communication timeout that occurs between a client and server. This is a huge advantage over protocols like S7 Communication, where packets can be routed between subnets. Modbus/TCP communication can be routed over Ethernet which means that its possible for two devices on different subnets to communicate.
Modbus server client how to#
Demonstrate how to set up Modbus/TCP communication between two PLCs using the MB_SERVER and MB_CLIENT instructions in TIA PortalĪdvantages of Modbus/TCP Modbus/TCP can be Routed Over Ethernet.Explain the disadvantages of using Modbus/TCP.Explain the advantages of using Modbus/TCP.It will demonstrate how to configure an S7 PLC as a Modbus Server or Client in TIA Portal. In this article, I’ll provide a quick start guide for configuring Modbus/TCP between two S7 PLCs. Each communication option has advantages and disadvantages, as well as a unique way of working. In modern PLCs, there are so many options for communication available that it can be hard to decide which one to use. Communication between PLCs is a common requirement in automation projects.
