Profibus-dp module for vfd series drives (36 pages)
Summary of Contents for Delta AH Series
Page 1
Doc. Name:AH/AS Series Socket Communication Instructions Rev.01 Doc. Code:134A-P-D1902-APN001-TC Topic: AH/AS Series Socket Communication Instructions Supported AH / AS Series Models Keywords Socket, TCP, UDP, SSOPEN, SSEND, SREVD, SCLOSE Page 1/47...
Page 2
AH Series- Explanation of Ethernet Instructions (Socket) ........4 Examples of AH Series ..................14 AH Series Example 1: TCP Sample Program (S3: 1 as Client/PC as Server) ... 16 AH Series Example 2: TCP Sample Program (S3: 0 as Server/PC as Client) ... 20 AH Series Example 3: UDP Sample Program ............
Page 3
Doc. Name:AH/AS Series Socket Communication Instructions Rev.01 Doc. Code:134A-P-D1902-APN001-TC 1. Introduction and Purpose Introduction: The examples in this document contains information to help familiarize the use of socket instruction settings and corresponding operation regarding AH500 and AS300 Series. Purpose: Allows first-time users to familiarize with socket instructions and be able to use it. Page 3/47...
Page 4
Doc. Name:AH/AS Series Socket Communication Instructions Rev.01 Doc. Code:134A-P-D1902-APN001-TC 2. AH Series- List of Ethernet Instructions (Socket) Instruction Code (bit) Pulse Function STEPS Instruction – 2200 SOPEN Opening a socket – 2201 SSEND Sending data via a socket –...
Page 5
Doc. Name:AH/AS Series Socket Communication Instructions Rev.01 Doc. Code:134A-P-D1902-APN001-TC Socket Number Item Local SR1118 SR1131 SR1144 SR1157 SR1170 SR1183 SR1196 SR1209 communication port Remote IP SR1119 SR1132 SR1145 SR1158 SR1171 SR1184 SR1197 SR1210 address (high word) Remote IP address SR1120 SR1133 SR1146 SR1159 SR1172 SR1185...
Page 6
Doc. Name:AH/AS Series Socket Communication Instructions Rev.01 Doc. Code:134A-P-D1902-APN001-TC Socket Number Item Received data SR1229 SR1241 SR1253 SR1265 SR1277 SR1289 SR1301 SR1313 length Received data SR1230 SR1242 SR1254 SR1266 SR1278 SR1290 SR1302 SR1314 address (high word) Received data SR1231 SR1243 SR1255 SR1267 SR1279 SR1291 SR1303 SR1315 address (low word) Received data SR1232 SR1244 SR1256 SR1268 SR1280 SR1292 SR1304 SR1316...
Page 7
SR0 is 16#2003 When the AH series PLC is the client that opens TCP connection, an error occurs if the number of servers which can be connected reaches the upper limit, the corresponding error flag is ON, the error code is 16#600A and the instruction is not executed.
Page 8
ON, the error code is 16#6212 and the instruction is not executed. 12. When the AH series PLC is used as client and server and share the same timeout values; if a timeout occurs for the server first, the connection will be automatically cut off, so the client will not receive an error flag.
Page 9
Doc. Name:AH/AS Series Socket Communication Instructions Rev.01 Doc. Code:134A-P-D1902-APN001-TC Instruction Code Operand Function 2201 SSEND Sending data via a socket “$” Device ...
Page 10
Doc. Name:AH/AS Series Socket Communication Instructions Rev.01 Doc. Code:134A-P-D1902-APN001-TC When the flag for sending an odd number of characters is not enabled, the actual send data length is 8 bytes. If the flag for sending an odd number of characters is enabled, the actual send data length is 7 bytes.
Page 11
Doc. Name:AH/AS Series Socket Communication Instructions Rev.01 Doc. Code:134A-P-D1902-APN001-TC When transmitting, an error occurs if the computer as the client abandons the connection, the corresponding error flag is ON, the error code is 16#6214; if there is a response timeout during transmission, the corresponding error flag is ON, the error code is 16#6212 and the instruction is not executed.
Page 12
Doc. Name:AH/AS Series Socket Communication Instructions Rev.01 Doc. Code:134A-P-D1902-APN001-TC Instruction code Operand Function 2202 SRCVD Receiving data via enabled socket “$” Device ...
Page 13
Doc. Name:AH/AS Series Socket Communication Instructions Rev.01 Doc. Code:134A-P-D1902-APN001-TC Instruction code Operand Function ,S 2203 SCLOSE Closing the socket “$” Device X ...
Page 14
Doc. Name:AH/AS Series Socket Communication Instructions Rev.01 Doc. Code:134A-P-D1902-APN001-TC 3. Examples of AH Series 【System Structure】 Role: Client (Master) Server (Slave) 【Software Settings】 PLC Setup Ethernet Basic Setting: IP ISPSoft → HWCONFIG →Ethernet-Basic Ethernet Advance Setting: Socket ISPSoft →...
Page 15
Doc. Name:AH/AS Series Socket Communication Instructions Rev.01 Doc. Code:134A-P-D1902-APN001-TC TCP/UDP Socket Configuration Page 15/47...
Page 16
2. The socket number from Software Setting and PLC programs control the corresponding flags to execute connection and data transmission. The following example corresponds to socket number 1. 3.1 AH Series Example 1: TCP Sample Program (S3: 1 as Client/PC as Server) 【Steps】...
Page 17
Doc. Name:AH/AS Series Socket Communication Instructions Rev.01 Doc. Code:134A-P-D1902-APN001-TC Page 17/47...
Page 18
Doc. Name:AH/AS Series Socket Communication Instructions Rev.01 Doc. Code:134A-P-D1902-APN001-TC 【Timing Diagram】 OpenSocket (M0) SendData (M1) Sending Data ReceiveData (M2) Receiving Data CloseSocket (M3) Successful Connection (SM1270) Data Received (SM1271) Data Sent (SM1272) Starting Connection (SM1273) Closing Connection (SM1274) Sending Data (SM1275) Receiving Data (SM1276)
Page 19
Doc. Name:AH/AS Series Socket Communication Instructions Rev.01 Doc. Code:134A-P-D1902-APN001-TC If M0 is ON, the SOPEN instruction executes the starting connection flag SM1273 to ON. Once the connection is successful, SM1270 is ON then clear SM1273 or SM1273 is OFF, which means successful socket connection and clear M0 or M0 is OFF.
Page 20
When SM1274 changes from OFF to ON, clear close socket M3 (or M3 is OFF) so that socket connection will not be closed again once M3 is ON. 3.2 AH Series Example 2: TCP Sample Program (S3: 0 as Server/PC as Client) 【Steps】...
Page 21
Doc. Name:AH/AS Series Socket Communication Instructions Rev.01 Doc. Code:134A-P-D1902-APN001-TC 【Timing Diagram】 OpenSocket (M0) SendData (M1) Sending Data ReceiveData (M2) Receiving Data CloseSocket (M3) Successful Connection (SM1270) Data Received (SM1271) Data Sent (SM1272) Starting Connection (SM1273) Closing Connection (SM1274) Sending Data (SM1275) Receiving Data (SM1276)
Page 22
Doc. Name:AH/AS Series Socket Communication Instructions Rev.01 Doc. Code:134A-P-D1902-APN001-TC 【Additional Remarks】 PLC:TCP server, wait for client connection. PC:TCP client Network1: Before opening the socket (M0) to execute connection, check that successful connection SM1270 is OFF, starting connection SM1273 is OFF and closing connection SM1274 is ON. ...
Page 23
When SM1274 changes from OFF to ON, clear close socket M3 (or M3 is OFF) so that socket connection will not be closed again once M3 is ON. 3.3 AH Series Example 3: UDP Sample Program 【Steps】 1. Set M4 to ON to open socket connection. (See Network 1 below) 2.
Page 24
Doc. Name:AH/AS Series Socket Communication Instructions Rev.01 Doc. Code:134A-P-D1902-APN001-TC 【Socket Programming】 Page 24/47...
Page 25
Doc. Name:AH/AS Series Socket Communication Instructions Rev.01 Doc. Code:134A-P-D1902-APN001-TC 【Timing Diagram】 OpenSocket (M4) SendData (M5) Sending Data ReceiveData (M6) Receiving Data CloseSocket (M7) Starting Connection (SM1334) Data Received (SM1335) Sending Data (SM1336) Receiving Data (SM11337) 【Additional Remarks】 PLC in UDP mode: UDP mode does not have Server/Client problem.
Page 26
Doc. Name:AH/AS Series Socket Communication Instructions Rev.01 Doc. Code:134A-P-D1902-APN001-TC Network3: Before sending data, please check the data is written in the sending device in HWCONFIG setting. When M5 is ON, the data is sending. When data is successfully sent, SM1336 is ON. To send a new data, we suggest to clear M5 or M5 is OFF.
Page 27
Doc. Name:AH/AS Series Socket Communication Instructions Rev.01 Doc. Code:134A-P-D1902-APN001-TC When the connection is closed, the started connection flag SM1334 is OFF, then set other flags to OFF. Note: When error flag SM1338 is ON, users need to clear the flag. ...
Page 28
Doc. Name:AH/AS Series Socket Communication Instructions Rev.01 Doc. Code:134A-P-D1902-APN001-TC 4.1 AS Series- Explanation of Ethernet Instructions (Socket) Instruction Code Operand Function 2200 SOPEN Opening a socket “$” Device ...
Page 29
Doc. Name:AH/AS Series Socket Communication Instructions Rev.01 Doc. Code:134A-P-D1902-APN001-TC When TCP and UDP socket parameters modifying in the program, please refer to SCONF instructions (API2209). (Example 4) When TCP socket is opened, use the following settings for the Socket IP and communication ports. Local Remote Start...
Page 30
Doc. Name:AH/AS Series Socket Communication Instructions Rev.01 Doc. Code:134A-P-D1902-APN001-TC Starting Closing Data received Sending data UDP socket connection connection Error Flag flag flag number flag flag SM1349 SM1350 SM1351 SM1352 SM1353 10. If data is transmitted through a TCP Socket in Server mode or through a UDP Socket, it is not allowed to use the following communication port for AS series PLC.
Page 31
Doc. Name:AH/AS Series Socket Communication Instructions Rev.01 Doc. Code:134A-P-D1902-APN001-TC Error Code Error Flag Description (SR180) 16#620E UDP Socket Error Flag Source data device exceeds the range 16#620F UDP Socket Error Flag Illegal address for receiving data 16#6210 UDP Socket Error Flag Length of data received exceeds the range 16#6211 UDP Socket Error Flag...
Page 32
Doc. Name:AH/AS Series Socket Communication Instructions Rev.01 Doc. Code:134A-P-D1902-APN001-TC Instruction Code Operand Function 2201 SSEND Sending data via a socket “$” Device Data Type ...
Page 33
Doc. Name:AH/AS Series Socket Communication Instructions Rev.01 Doc. Code:134A-P-D1902-APN001-TC Error Code Error Flag Description 16#6212 TCP Socket Error Flag TCP Socket connection timeout 16#6214 TCP Socket Error Flag TCP Socket connection rejected by remote equipment 16#6215 TCP SocketError Flag TCP Socket not connected 16#6218 TCP SocketError Flag Sending data triggered...
Page 34
Doc. Name:AH/AS Series Socket Communication Instructions Rev.01 Doc. Code:134A-P-D1902-APN001-TC Instruction Code Operand Function 2203 SCLOSE socket Closing a “$” Device Data Type ...
Page 35
Doc. Name:AH/AS Series Socket Communication Instructions Rev.01 Doc. Code:134A-P-D1902-APN001-TC Error Code Error Flag Description 16#621A TCP Socket Error Flag Disabling TCP socket connection triggered The following table explains UDP connection errors: Error Code Error Flag Description or S exceeds the range 16#2003 16#600D SM1100...
Page 36
Doc. Name:AH/AS Series Socket Communication Instructions Rev.01 Doc. Code:134A-P-D1902-APN001-TC 5. Examples of AS Series 【System Structure】 Role: Client (Master) Server (Slave) 【Software Settings】 PLC Setup Ethernet Basic Setting: IP ISPSoft → HWCONFIG →Ethernet-Basic Ethernet Advance Setting: Socket ISPSoft →...
Page 37
Doc. Name:AH/AS Series Socket Communication Instructions Rev.01 Doc. Code:134A-P-D1902-APN001-TC TCP Socket Number Successful Data Starting Closing Sending TCP Socket Data sent Error connection received connection connection data Number flag Flag flag flag flag flag flag SM1270 SM1271 SM1272 SM1273 SM1274 SM1275 SM1277 UDP Socket Number...
Page 38
Doc. Name:AH/AS Series Socket Communication Instructions Rev.01 Doc. Code:134A-P-D1902-APN001-TC 【Timing Diagram】 OpenSocket (M0) SendData (M1) Sending Data CloseSocket (M3) Successful Connection (SM1270) Data Received (SM1271) Receiving Data Data Sent (SM1272) Starting Connection (SM1273) Closing Connection (SM1274) Sending Data (SM1275) 【Additional Remarks】 ...
Page 39
Doc. Name:AH/AS Series Socket Communication Instructions Rev.01 Doc. Code:134A-P-D1902-APN001-TC Network 1: Before opening the socket (M0) to execute connection, check that successful connection SM1270 is OFF, starting connection SM1273 is OFF and closing connection SM1274 is ON. When starting PC’s socket connection, wait for the PLC to connect. ...
Page 40
Doc. Name:AH/AS Series Socket Communication Instructions Rev.01 Doc. Code:134A-P-D1902-APN001-TC 5.2 AS Series Example 2: TCP Sample Program (S3: 0 as Server/PC as Client) 【Steps】 1. Set M0 to ON to open socket connection. (See Network 1 below) 2. When connection is successful, M0 is OFF. ( See Network 2 below) 3.
Page 41
Doc. Name:AH/AS Series Socket Communication Instructions Rev.01 Doc. Code:134A-P-D1902-APN001-TC 【Timing Diagram】 OpenSocket (M0) SendData (M1) Sending Data CloseSocket (M3) Successful Connection (SM1270) Data Received (SM1271) Receiving Data Data Sent (SM1272) Starting Connection (SM1273) Closing Connection (SM1274) Sending Data (SM1275) 【Additional Remark】 ...
Page 42
Doc. Name:AH/AS Series Socket Communication Instructions Rev.01 Doc. Code:134A-P-D1902-APN001-TC Network3: Before sending the data, please check the data is written in the sending device of HWCONFIG setting. When send data M1 is ON, the sending data flag SM1275 is ON. ...
Page 43
Doc. Name:AH/AS Series Socket Communication Instructions Rev.01 Doc. Code:134A-P-D1902-APN001-TC 【Socket Programming】 Page 43/47...
Page 44
Doc. Name:AH/AS Series Socket Communication Instructions Rev.01 Doc. Code:134A-P-D1902-APN001-TC 【Timing Diagram】 OpenSocket (M4) SendData (M5) Sending Data CloseSocket (M7) Starting Connection (SM1334) Data Received (SM1335) Receiving Data Sending Data (SM1336) Closing Connection (SM11337) 【Additional Remark】 Timing Diagram: UDP mode does not have Server/Client problem. Both sides need to open UDP socket for data transmission.
Page 45
Doc. Name:AH/AS Series Socket Communication Instructions Rev.01 Doc. Code:134A-P-D1902-APN001-TC Network3: Before sending data, please check the data is written in the sending device under HWCONFIG setting. When M5 is ON, the data is sending. When data is successfully sent, SM1336 is ON. To send a new data, we suggest to clear M5 or M5 is OFF.
Page 46
Doc. Name:AH/AS Series Socket Communication Instructions Rev.01 Doc. Code:134A-P-D1902-APN001-TC 【 Socket Programming】 【 SCONF Instructions】 Device Name Description Data Type Remarks Select TCP/UDP 0: TCP, 1: UDP WORD Socket number Range: 1 to 4 WORD The first two sections of the IP address occupy Occupies the first word and the remaining two sections of Remote IP...
Page 47
Doc. Name:AH/AS Series Socket Communication Instructions Rev.01 Doc. Code:134A-P-D1902-APN001-TC Device Name Description Data Type Remarks bytes of data are received and stored in the stored registers starting at D200 (from the low byte to the high byte). Size of received 200 bytes WORD Maximum:...
Need help?
Do you have a question about the AH Series and is the answer not in the manual?
Questions and answers