Scalable PLC AC500 Communication AC500 Modbus TCP Version 3.1 (2012-07) Technical Guides
Coming up Modbus TCP with AC500 Configuration and parameterization Program in CoDeSys March 11, 2013 Slide 2
AC500 as Server and / or Client AC500 is server. It is exchanging data on client s request. CP600 is client. It is initiating the communication. Data exchange between CPUs. Modbus TCP communication also via CM577 possible. Each PLC can act as client and /or server. March 11, 2013 Slide 3
Coming up Modbus TCP with AC500 Configuration and parameterization Program in CoDeSys March 11, 2013 Slide 4
Configure Modbus TCP (1) Add Modbus TCP on Onboard_Ethernet or CM577_ETH Result: March 11, 2013 Slide 5
Configure Modbus TCP (2) If the Port is acting as a server configure number of connections to be created simmultaneously to different clients Byte order for AC500 communication is Big endian = Motorola byte order The other parameters could be changed due to optimize the communication. March 11, 2013 Slide 6
Configure Modbus TCP (3) In the server project the Modbus buffer area could be selected as %M or %R area (default: %M area) Optionally in the server project areas could be protected against write and / or read access by clients. Writing / reading is disabled beginning at the set address and is valid up to the set end address (inclusive). March 11, 2013 Slide 7
Coming up Modbus TCP with AC500 Configuration and parameterization Program in CoDeSys March 11, 2013 Slide 8
Client: Program in CoDeSys This FB is only for the Client (no FB for Server). Enabling parameter (0 -> 1 edge) Number of Communication Module IP-address of the Server Addr. of the slave connected serial to the server Function code. Here Read registers (words) Starting from Server address 0 (%MW0.0 or %RW0.0) 10 words Copy to own memory area starting with address of the operand (an array or an addresable area) Result of data exchange March 11, 2013 Slide 9
Function Codes AC500 supports following Modbus function codes: 01 or 02 read n coils (bits) 255 bits (up to firmware version V01.33) 1800 bits (from firmware version V01.41) 03 or 04 read n registers (words) 100 words / 50 double words 05 write one coil (bit) 1 bit 06 write one register (word) 1 word 07 read 8 coils (bits) 8 bits 15 write n coils (bits) 255 bits (up to firmware version V01.33) 1800 bits (from firmware version V01.41) 16 write n registers (words) 100 words / 50 double words 22 mask one register (word) only with CPUs with Onboard Ethernet 23 read and write n registers (word) only with CPUs with Onboard Ethernet March 11, 2013 Slide 10
Program in CoDeSys Enable FB by a puls signal FB is dedicated to the CPU internal ETH port IP-addres of the server is 10.33.71.175, no routing to another serial slave Write 5 words to the 11. word of the server s Modbus buffer (%MW0.10 or %RW0.10) from own area beginning with the address of the variable ARRAYofWORD March 11, 2013 Slide 11
Program in CoDeSys Enable FB by a puls signal FB is dedicated to the CPU internal ETH port IP-addres of the server is 10.33.71.174, no routing to another serial slave Read 5 words to the 11. word of the server s Modbus buffer (%MW0.10 or %RW0.10) from own area beginning with the address of the variable ARRAYofWORD March 11, 2013 Slide 12
Read / Write Addresses Input and Output cannot be directly accessed by using Modbus The address assignment for word and double word accesses is done according to the following table : Line 0 %MW0.0 to %MW0.32767 and line 1 %MW1.0 to %MW1.32767 Line 0 only for PM554_ETH, PM564_ETH and PM57x_ETH March 11, 2013 Slide 13
Cross-References to Documentation 1. CoDeSys Help\Target System\ AC500 / S500\ Function Block Libraries AC500 \ Ethernet Library 2. CoDeSys Help\Target System\ AC500 / S500\System Technology \System Technology of the AC500 Communication Modules\The Ethernet Communication Module\ Modbus on TCP/IP March 11, 2013 Slide 14
March 11, 2013 Slide 15