14 Ethernet communication

Last modified by Jim on 2023/09/22 15:36

Ethernet overview

IP address

IP address consists of network address and host address, and distinguished by subnet mask. If programming device (such as PC) use network card to connect to LAN, the programming device and PLC must be in the same subnet. You can specify the subnet of a device by combining an IP address with a subnet mask.

The network address could be calculated by performing logic and operation between IP address and subnet mask. If the addresses are in the same network, it means that communication is possible.

NumberNetwork device 1Network device 2Network connection
IPSubnet maskNetwork addressIPSubnet maskNetwork address
1192.168.0.1255.255.255.0192.168.0.0192.168.0.10255.255.255.0192.168.0.0Yes
2192.168.0.1255.255.255.0192.168.0.0192.168.1.10255.255.255.0192.168.1.0No
3192.168.0.1255.255.255.1192.168.0.1192.168.0.10255.255.255.1192.168.0.0No

Set PC network address

(1) Click “Control panel”→”Network and Internet”→”Network and sharing center”.

14_html_c2a8809528586e62.png

(2) Click “Ethernet”→”Properties”→”Internet protocol version 4”.

(3) Set the IP address and subnet mask on the same network address as the PLC. The IP address that has been used in LAN could not be set. If the IP of PLC is 192.168.8.8, and the subnet mask is 255.255.255.0. The IP address as shown below could be set to connect PC to PLC.

14_html_a9fe3141424b96c7.png

Test the network connection status

Test the connection status between PC and PLC by ping command.

(1) Press “WIN” and “R” keys, and input “cmd”.

14_html_dabf04cdadd8a3d8.png

(2) If the IP address of PLC is 192.168.8.8.

1) Input “ping 192.168.8.8 ”, and enter. If it display ”100% loss”, it means that PLC could be connected.

14_html_7aa7f1c9b25ffe38.png

2) Input “ping 192.168.8.8 ”, and enter. If it display ”0% loss”, it means that it could be connected to PLC.

14_html_62b05ca96148a3f1.png

3) The command “ping network device IP” could only be use four times. To ping network devices continuously, run “ping network device ip-t” command, it is shown as below.

14_html_d69739e24edf0b2d.png

PLC Editor2 connect to PLC with Ethernet

(1) Transfer settings →Ethernet configuration → Input IP address.(✎Note: The address of NIC must be on the same network segment as that of the PLC.)

14_html_144b2bfcd0791114.png

(2) Click “Communication test” to comfirm the communication.

14_html_d0e31208a663b835.png

(3) After successful connection, PLC is able to operate.

PLC Editor2 Ethernet search funtion

(1) Transfer settings → NIC comfiguration → Device search. (✎Note: The address of NIC must be on the same network segment as that of the PLC.)

14_html_4d043668ca526831.png

(2) The search interface is as below. Click search to display the PLC devices in the LAN, and select the corresponding device and click OK to communicate.

14_html_15c7655b852e111.png

(3) The IP address of one is filled in automatically.

14_html_2d7b6e1b3d27381a.png

Ethernet configuration

Hardware interface

The LX5V is equipped with standard Ethernet ports (1 channel RJ45 port) and supports Modbus TCP communication protocol.

RJ45 specification

ContentsEthernet interfece
Transmission speed

10Mbps: 10BASE-T

100Mbps: 100BASE-TX

10Mbps/100Mbps self-adaptive

ModulationBasband
TopologyStarlike
Transmission mediumClass 5 or above twisted pairs or shielded twisted pairs with aluminum foil and woven mesh
Transmission distanceThe distance between nodes: 100m or less
Linking number8

Total numbers of links supported

When LX5V-N series PLC is powered on, ModbusTCP server monitor is automatically enabled by default. 2 to 8 ModbusTCP clients are supported, and the port number is 502. (PLC host computer upload and download, monitor and HMI communication protocol are supported by the ModbusTCP server.)

The number of configurable links is 6. The free configurations of TCP server free protocol, TCP client free protocol, ModbusTCP server and ModbusTCP client are supported.

Communicaition protocolMaximum links supported
ModbusTCP server8
ModbusTCP client6
Free TCP server6
Free TCP client6

IP address settings

Set by programming software

Project manager →Parameter→PLC parameters→Ethernet configuration. Download selected parameters through PLC after modification. The download takes effect after STOP->RUN is complete.

✎Note: The maximum link supported of ModbusTCP servers is used to set the maximum number of external ModbusTCP clients that could connect to PLC simultaneously. The range is from 2 to 8.

14_html_5d3039a657266507.png

Set by special device

Write IP address, subnet mask, and default gateway in SD2680 to SD2691.

SM2680 is set to ON, static IP function is enable. (✎Note: DHCP function is not supported by LX5V currently.)

SM2683 is set to ON, IP identification could be modified.

New IP address takes effect when STOP->RUN or after power-on again.

SM numberNameContentsR/WSD numberName
SM2680Static set IP switch

ON: Static set

OFF: Automatically configurate IP address by router DHCP, and could not be modify IP. When STOP->RUN takes effect.

R/WSD2680The 1st byte of IP address
SM2681Display current network information

Refresh current IP gateway subnet mask after ON.

Turn OFF after the fresh is complete.

R/WSD2681The 2nd byte of IP address
SM2682Display current MAC information

Refresh current MAC after ON.

Turn OFF after the fresh is complete.

R/WSD2682The 3rd byte of IP address
SM2683The modification flag of IP, subnet mask and gateway

ON: Modifiable

OFF: Unmodifiable

(After setting to ON, modify when stop->run, and automatically turn OFF after the modification)

R/WSD2683The 4th byte of IP address
SM2684   SD2684The 1st byte of subnet mask
SM2685   SD2685The 2nd byte of subnet mask
SM2686   SD2686The 3rd byte of subnet mask
SM2687   SD2687The 4th byte of subnet mask
SM2688   SD2688The 1st byte of default gateway
SM2689   SD2689The 2nd byte of default gateway
SM2690   SD2690The 3rd byte of default gateway
SM2691   SD2691The 4th byte of default gateway

TCP protocol

TCP protocol, short for Transport Control Protocol, is Is a connection-oriented and reliable transport layer protocol. Connection-oriented means that a normal TCP transmission need to be completed by establishing a specific virtual circuit connection between TCP client and TCP server. To transfer data over TCP, a connection must be established between hosts at both ends.

UDP protocol

UDP protocol, short for User Datagram Protocol, is a connectionless transport layer protocol. There is no guarantee of data order, a risk of data loss. It provides a simple and unreliable information transfer service for transactions and is Mainly used in data broadcasting.

Socket

When the application layer communicates data over the transport layer, TCP encounters the problem of providing concurrent services to multiple application processes at the same time. Multiple TCP connections or multiple application processes may require data to be transmitted over the same TCP protocol port. To distinguish between different application processes and connections, many computer operating systems provide interfaces called sockets for applications to interact with the TCP/IP protocol.

To generate a socket, there are three main parameters: the IP address of the destination of the communication, the transport layer protocol used (TCP or UDP) used, and the port number used. By combining these three parameters and binding to a socket, the application layer and the transport layer can distinguish communication from different application processes or network connections through the socket interface, realizing concurrent services for data transmission.

Establish an Ethernet link by socket

At least one pair of sockets is required to establish a socket link.

For TCP, the two sockets, one running on the TCP client and the other running on the TCP server. The connection process between sockets is divided into three steps: server monitor, client request, connection confirmation, also known as the three-way handshake.

Server monitor: After the server socket is enabled, it does not locate the specific client socket, but is in a state of waiting for the connection, monitoring the network status in real time, and waiting for the client's connection request.

Client request: Refers to a connection request made by a client-side socket, and the target of the connection is the server-side socket. To do this, the client-side socket must first describe the socket of the server to which it is connecting, indicate the address and port number of the server-side socket, and then make a connection request to the server-side socket

Connection confirmation: Refers to when the server-side socket listens to or receives a connection request from the client socket, it responds to the client socket request, establishes a new thread, sends the description of the server-side socket to the client. Once the client confirms this description, the connection is established. The server-side socket continues to listen and continues to receive connection requests from other client-side sockets.

14_html_c4fd785c7111eade.gif

In order to simplify the complexity of ladder programming, sockets have been partially simplified:

For TCP clients, merge socket() and connect() into SOCOOPEN instructions. After this function is enabled, automatically connect to the TCP server.

For TCP server, merge socket(), bind(), listen(), and accept() into SOCOOPEN instructions. After this function is enabled, automatically listen to server connection. If the server is successfully connected, the corresponding position is marked and the IP address and port information of the server are displayed.

For UDP, there is no concept of client and server. Creating a UDP socket only requires local address information and remote address information, without connection operations. Communication could be made when the address information of the local socket and the remote socket could be matched, that is, the remote address of the local socket is the same as the local address of the remote socket, and the local address of the local socket is the same as the remote address of the remote socket. For UDP connections, the connection could be established immediately by calling the SOCOPEN instruction.

LX5V-N socket configuration instructions

LX5V socket could be configured in Project manager→Extended function→Ethernet, right click to create socket configuration, as shown below.

14_html_e73123ae26a00972.png

Socket ID: The number of the socket ranges from K0 to K5, and a total of six are supported. The socket is used to specify links, and each ID could be used for one link and could not be defined repeatedly.

Communication protocol: TCP protocol and UDP protocol are supported.

Operating mode: For TCP, client and server could be selected. For UDP, this is meaningless.

Local port:

For TCP client mode, the local port would be automatically allocated by PLC without setting.

For TCP server mode, the local port ranges from 1 to 65535. Port 502 is used for internal ModbusTCP and can not be set to port 502.

For UDP mode, the local port ranges from 1 to 65535. Port 1092 is used for scanning protocol of Wecon and can not be set to port 1092.

Destination IP: It is valid in TCP client mode or UDP mode, and specify the IP of opposite end device to be linked.

Destination port: It is valid in TCP client mode or UDP mode, and specify the port number of opposite end device to be linked.

Receive timeout period(10ms): After the PLC sends the data, If the response of the opposite end device exceeds the timeout period, it is considered that the network has an abnormality and sets the wrong flag.

TCP keep-alive mechanism: When using the TCP protocol for communication, if the communication line is idle in most cases, there is only a small amount of data to be sent and received, but it is necessary to keep the link open continuously, or disconnect in time in the case of a drop, crash or forced end of the process at the other end of the communication, the keep-alive mechanism can be used to communicate.

When the keep-alive function is turned on, after the two parties stop communicating for 5 seconds, the TCP connection that opens the keep-alive function will send a survival confirmation message to the other party. If the other party responds, it means that the other party is alive and online. The connection is normal, and the survival confirmation message is sent again after 5 seconds to continue to confirm. If the other party does not confirm the survival, it means that the other party has a problem, the end that opens the keep-alive will continue to send it a survival confirmation message after 5 seconds. When the opposite end does not respond for 9 consecutive times, it means that the opposite end communication is abnormal, and the end that opens the keep-alive will actively disconnect.

Ethernet instruction

Create socket link specified by (s), and update the data information of this socket link to (d1) and the status information to (d2).

-[SOCOPEN (s) (d1) (d2)]

Content, range and data type

ParameterContentRangeData typeData type (label)
(s)Socket ID0 to 5Signed BIN 16 bitANY16
(d1)The start device that stores the data information of socket links-Signed BIN 16 bitANY_ELEMENTARY
(d2)The start device that stores the status information of socket links-BitANY_BOOL

Device used

InstructionParameterDevicesOffset modification

Pulse

extension

YMSSMD.bTCDRSDKH[D]XXP
SOCOPENParameter 1            
Parameter 2         
Parameter 3         

Features

✎Create the socket link specified in (s) and update the link information in (d1) and (d2).

✎When the instruction is turned on, the devices specified in (d1) and (d2) will be used in other Ethernet instructions using the same socket ID. (SOCSEND, SOCRECV, SOCCLOSE, SOCMTCP)

✎(d1) Specifies the following information (a total of 14 word devices):

DeviceFunction
(d1)Local port number
(d1+1)The 1st segment of the destination IP
(d1+2)The 2nd segment of the destination IP
(d1+3)The 3rd segment of the destination IP
(d1+4)The 4th segment of the destination IP
(d1+5)Destination port number
(d1+6)Receive timeout period(10ms)
(d1+7)Actual receiving length (byte)
(d1+8)Current link error code
(d1+9)Numbers of communication errors high bit
(d1+10)Numbers of communication errors low bit
(d1+11)Reserved
(d1+12)Reserved
(d1+13)Reserved

✎(d2) Specifies the following information (a total of 14 bit devices):

DeviceON statusOFF status
(d2)ConnectingThe connection is not turned on
(d2+1)Connection completedConnecting or not connected
(d2+2)Sending data(used by SOCSEND instruction)Data is not sent or data sending is complete
(d2+3)Data sending completed(used by SOCSEND instruction)The instruction is not started or being sent.
(d2+4)Receiving data(used by SOCRECV instruction)No data or receiving is completed
(d2+5)Data receiving completed(used by SOCRECV instruction)The instruction is not started or received
(d2+6)Connection is closingThe instruction is not started or is receiving
(d2+7)Connection close completedThe instruction is not started or close is complete
(d2+8)Communication completed(used by SOCMTCP instruction)In communication
(d2+9)Connection errorNo error in connection
(d2+10)ReservedReserved
(d2+11)ReservedReserved
(d2+12)ReservedReserved
(d2+13)ReservedReserved

Features

Local port number:

Establish a TCP client: PLC automatically allocates the local communication port, ranging from 49152 to 65535. The port number is automatically incremented by 1 each time it is turned on.

Establish a TCP server: specified by Ethernet socket configuration of the host computer.

Establish a UDP connection: specified by Ethernet socket configuration of the host computer.

Destination IP:

Establish a TCP client: The destination address is specified by Ethernet socket configuration of the host computer.

Establish a TCP server: After the remote client connection is successful, display the IP address of the remote connection.

Establish a UDP connection: The destination address is specified by Ethernet socket configuration of the host computer.

Destination port number:

Establish a TCP client: The destination port number is specified by Ethernet socket configuration of the host computer.

Establish a TCP server: After the remote client connection is successful, display the port number of the remote connection.

Establish a UDP connection: The destination port number is specified by Ethernet socket configuration of the host computer.

Receive timeout period(10ms): specified by Ethernet socket configuration of the host computer.

Actual receiving length: This parameter is valid only when the SOCRECV instruction is used. It indicates the number of bytes received after the instruction is enabled.

Current link error code: Display the current error information. For details, Refer to Ethernet error code List.

Numbers of communication errors: total number of communication errors after successful connection (double word).

Error codes

Error codeContent
4085HThe device specified in application instruction (d1) and (d2) exceeds the corresponding device range.
5080HThe specified socket is already connected and cannot be opened again.
5082HThe socket used by parameter 1 exceeds the range of 0 to 5.
5083HFailed to establish TCP server.
5084HFailed to create links.
5086HThe specified (d) is not configured socket or the socket is not enabled.
5089H502 port could not be used on the TCP server because the 502 port is enabled by default.

Close socket link specified by (s).

-[SOCCLOSE (s)]

Content, range and data type

ParameterContentRangeData typeData type (label)
(s)Socket ID0 to 5Signed BIN 16 bitANY16

Device used

InstructionParameterDevicesOffset modification

Pulse extension

KH[D]XXP
SOCCLOSEParameter 1  

Features

✎Close the socket link specified in (s).

✎When the TCP server is closed, the reset request will be sent to the remote client. At the moment, in bit device specified by SOCOPEN, the status of connection closure will be set. The socket is not actually released until the connection closure state is set and the next connection is opened

✎If the socket specified by (s) is not connected to the remote end, it cannot be closed and the instruction error occurs.

Error codes

Error codeContent
5081HThe socket specified by is not connected, and could not be closed
5082HThe data specified in (s) exceeds the range of 0 to 5

SOCSEND/Ethernet free-form communication sending

Send the data in (s2) to the socket link specified by (s1) at the length specified by (S3).

-[SOCSEND (s1) (s2) (s3)]

Content, range and data type

ParameterContentRangeData typeData type (label)
(s1)Socket ID0 to 5Signed BIN 16 bitANY16
(s2)The start device that send the data-Signed BIN 16 bitANY_ELEMENTARY
(s3)Sent length1 to 256BitANY16

Device used

InstructionParameterDevicesOffset modification

Pulse extension

TCDRSDKH[D]XXP
SOCSENDParameter 1       
Parameter 2    
Parameter 3  

Features

✎Send the data specified in (s2) from the socket connected to (s1), and the length is (s3).

✎According to the devices specified by SOCOPEN, the information such as the sending status and the total sending length could be queried. For details, refer to the SOCOPEN instruction.

✎It must be used with the SOCOPEN instruction, and data can only be sent after a full link has been established.

Error codes

Error codeContent
4084HThe data in (s3) exceeds the specified range.
5081HThe socket specified by is not connected, and could not be sent.
5082HThe data specified in (s) exceeds the range of 0 to 5.

SOCRECV/Ethernet free-form communication reveiving

Receive the data from the socket link in (s1) and store in the start device of (s2) at the length of (S3).

-[SOCRECV (s1) (S2) (S3)]

Content, range and data type

ParameterContentRangeData typeData type (label)
(s1)Socket ID0 to 5Signed BIN 16 bitANY16
(s2)The start device that receive the data-Signed BIN 16 bitANY_ELEMENTARY
(s3)Receive length1 to 256BitANY16

Device used

InstructionParameterDevices

Offset modification

Pulse extension

TCDRSDKH[D]XXP
SOCRECVParameter 1       
Parameter 2    
Parameter 3  

Features

✎Receive the data from the socket link in (s1) and store in the start device of (s2) at the length of (S3).

✎According to the devices specified by SOCOPEN, the information such as the sending status and the total sending length could be queried. For details, refer to the SOCOPEN instruction.

✎It must be used with the SOCOPEN instrcution, and data can only be sent after a full link has been established.

When used with SOCSEND, it could not be opened at the same time.

Error codes

Error codeContent
4084HThe data in (s3) exceeds the specified range.
5081HThe socket specified by is not connected, and could not be sent.
5082HThe data specified in (s) exceeds the range of 0 to 5.
5087HReceiving data timeout

SOCMTCP/Ethernet ModbusTCP communication

Ethernet ModbusTCP client communication instruction

-[SOCMTCP (s1) (s2) (s3) (s4) (s5)]

Content, range and data type

ParameterContentRangeData typeData type (label)
(s1)Socket ID0 to 5Signed BIN 16 bitANY16
(s2)High byte is station number, low byte is function code-Signed BIN 16 bitANY_ELEMENTARY
(s3)The Modbus address that need communication1 to 65536Unsigned BIN 16 bitANY16
(s4)Sent length or received length Signed BIN 16 bitANY16
(s5)Sent or received start device Signed BIN 16 bitANY_ELEMENTARY

Device used

InstructionParameterDevicesOffset modification

Pulse extension

TCDRSDKH[D]XXP
SOCMTCPParameter 1       
Parameter 2  
Parameter 3  
Parameter 4  
Parameter 5    

Features

✎(s1) specify the socket link. The other parameters are compatible with RS instruction Modbus master protocol.

✎(s2) high byte is station number. For ModbusTCP, the station number can be set freely.

✎(s2) low byte is function code.For details, refer to Modbus protocol description.

✎(s3) Modbus communication address, ModbusTCP server address that needs to be read or written.

✎(s4): the length read or written by Modbus.

✎(s5): the start device that Modbus receive read data or or store written data.

✎It must be used with the SOCOPEN instruction, and data can only be sent after a full link has been established.

✎This instruction can only be used when a TCP client socket link is established.

✎The communication completion information and the number of received and transmitted could be viewed in the soft devices specified in the SOCOPEN instruction.

Error codes

Error codeContent
5081HThe socket specified by is not connected, and could not communicate.
5082HThe data specified in (s1) exceeds the range of 0 to 5.
5086HThe socket specified by (s1) is not configured in the host computer or enabled.
5088HThe SOCMTCP instruction only supports TCP client mode.

Ethernet applications

Data exchange between two PLCs through ModbusTCP

ParametersPLC No.1PLC No.2
Port numberFree internal distribution502
IP address192.168.8.10192.168.8.8
Protocol typeModbusTCP clientModbusTCP server

The socket configuration of PLC No.1

14_html_202f1d4e5f1733c8.png

Ladder diagram logic: Automatically connect socket 0 after power on 1s. Read the 0 address length 20 of PLC No.2 to D100 to D119 after the link is successful, and set the value of D100 to D119 to address 100 of PLC No.2 after the communication is successful. Close the link when communicate successfully again, and wait 1s to re-connect after closing successfully. Repeat the actions above.

The ladder diagram of PLC No.1

14_html_4206400d31f134fa.png

As a ModbusTCP server, PLC No. 2 does not need to write instructions. (Open two links by default, and could be modified in [PLC parameters]→[Ethernet settings]. A maximum of eight links are supported.)

Data exchange between two PLCs through Free TCP

ParametersPLC No.1PLC No.2
Port numberFree internal distribution520
IP address192.168.8.10192.168.8.8
Protocol typeFree TCP clientFree TCP server

The IP setting of PLC No.1

[Project manager]→[Parameter]→[PLC parameter]→[Ethernet settings]

14_html_c4654ab7a5c4ee36.png

The socket comfiguration of PLC No.1

[Project manager]→[Extended function]→[Ethernet],and right click to create.

14_html_ec9300bfd59ac79f.png

The ladder diagram of PLC No.1

Ladder diagram logic: Automatically connect socket one after power on. Send character string ”hello word” initiatively to PLC No.2 after connecting successfully.

After receiving "hello word" and verifying it correctly, PLC No.2 would reply “abcdefghijklmnopqrstuvwxyz”. If PLC No.1 receives the reply of PLC No.2, the link closed.

14_html_3e51e79948c709b.png

The socket configuration of PLC No.2

[Project manager]→[Parameter]→[PLC parameter]→[Ethernet settings]

14_html_4d60262e7d7e6978.png

The socket comfiguration of PLC No.2

[Project manager]→[Extended function]→[Ethernet],and right click to create.

14_html_1e0fa43741d0ea96.png

The ladder diagram of PLC No.2

14_html_309dfbea85ed7f7c.png

Ladder diagram logic: Automatically open the monitor server link of socket one after power on. The data sent by the client is continuously read after connecting successfully. After receiving "hello word", PLC No.2 would reply “abcdefghijklmnopqrstuvwxyz”.

Data exchange between two PLCs through Free UDP

ParametersPLC No.1PLC No.2
Port number666666
IP address192.168.8.10192.168.8.8
Protocol typeFree UDPFree UDP

The IP setting of PLC No.1

14_html_4d60262e7d7e6978.png

The socket configuration of PLC No.1

14_html_d26f36ecd7d82039.png

The ladder diagram of PLC No.1

Ladder diagram logic: After setting the NIC state bit, establish UDP socket. After the link is established successful, send a data of 20 bytes that start from D100 to 192.168.8.10: 666. After the data is sent successfully, wait for the reply data of the other party. After the reply succeeds, continues the process, and so on

14_html_dbd3907c288c9523.png

The IP address configuration of PLC No.2

14_html_4d60262e7d7e6978.png

The socket configuration of PLC No.2

14_html_5db18357d06716af.png

The ladder diagram of PLC No.2

Ladder diagram logic: After setting the NIC state bit, establish UDP socket. After the link is established successful, send a data of 20 bytes that start from D300 to 192.168.8.10: 666. After the data is sent successfully, wait for the reply data of the other party, and so on.

14_html_4a93f07f5fdbe522.png

Server address table

Word address
Address typeOccupyAddress rangeDecimal addressTotal reserved address size
T0 to T511512 WORD0x0000-0x01ff01536
C0 to C255256 WORD0x0600-0x06ff15361024
LC0 to LC255512 WORD0x0A00-0x0BFF25601024
HSC0 to HSC1532 WORD0x0E00-0x0E1F3584512
D0 to D79998000 WORD0x1000-0x2F3F409616384
SD0 to SD40954096 WORD0x5000-0x5FFF2048012288
R0 to R2999930000 WORD0x8000-0xF52F3276830000
Bit address
Address typeOccupyAddress rangeDecimal addressTotal reserved address size
T0 to T511512 bit0x0000-0x01ff 1536
C0 to C255256 bit0x0600-0x06ff15361024
LC0 to LC255256 bit0x0A00-0x0AFF25601024
HSC0 to HSC1516 bit0x0E00-0x0E0F3584512
M0 to M79998000 bit0x1000-0x2F3F409616384
SM0 to SM40954096 bit0x5000-0x5FFF2048012288
Reserved 0x8000-0xBFFF 16383
S0 to S40954096 bit0xC000-0xCFFF491528192
X0 to X17771024 bit0xE000-0xE3FF573444096
Y0 to Y17771024 bit0xF000-0xF3FF614404096

List of special device related to Ethernet

SM numberNameContentR/WPower down retentive
SM2681Display current network information

Refresh current IP gateway subnet mask after ON.

Turn OFF after the fresh is complete.

R/W×
SM2682Display current MAC information

Refresh current MAC after ON.

Turn OFF after the fresh is complete.

R/W×
SM2683The modification flag of IP, subnet mask and gateway

ON: Modifiable

OFF: Unmodifiable

(After setting to ON, modify when stop->run, and turn OFF automatically after the modification)

R/W
SM2684The connecting status of NIC

ON: The network is connected

OFF: The network is not connected. Please check whether the network cable is connected.

R
SM2692MAC address modification flag

ON: Modifiable

OFF: Unmodifiable

(After setting to ON, modify when stop->run, and automatically turn OFF after the modification)

R/W
SM2700ModbusTCP keep-alive mechanism

ON: open

OFF: close (default)

R/W
SM2701ModbusTCP server force close

ON: open

OFF: close (default)

(After enabling, automatically changes to OFF After it is successfully turned OFF)

R/W×
SM2710Ethernet error flag

ON: Ethernet error. Please check SD2710 and SD2711

OFF: No Ethernet error.

R×
SM2740ModbusTCP server connection status 1

ON: The client is connected

OFF: The client is not connected

R×
SM2760ModbusTCP server connection status 2

ON: The client is connected

OFF: The client is not connected

R×
SM2780ModbusTCP server connection status 3

ON: The client is connected

OFF: The client is not connected

R×
SM2800ModbusTCP server connection status 4

ON: The client is connected

OFF: The client is not connected

R×
SM2820ModbusTCP server connection status 5

ON: The client is connected

OFF: The client is not connected

R×
SM2840ModbusTCP server connection status 6

ON: The client is connected

OFF: The client is not connected

R×
SM2860ModbusTCP server connection status 7

ON: The client is connected

OFF: The client is not connected

R×
SM2880ModbusTCP server connection status 8

ON: The client is connected

OFF: The client is not connected

R×
SD numberNameContentR/WPower down retentive
SD2680The 1st byte of IP addressLocal IP addressR/W
SD2681The 2nd byte of IP addressR/W
SD2682The 3rd byte of IP addressR/W
SD2683The 4th byte of IP addressR/W
SD2684The 1st byte of subnet maskLocal subnet maskR/W
SD2685The 2nd byte of subnet maskR/W
SD2686The 3rd byte of subnet maskR/W
SD2687The 4th byte of subnet maskR/W
SD2688The 1st byte of default gatewayLocal default gatewayR/W
SD2689The 2nd byte of default gatewayR/W
SD2690The 3rd byte of default gatewayR/W
SD2691The 4th byte of default gatewayR/W
SD2692The 1st byte of MACLocal MAC addressR/W
SD2693The 2nd byte of MACR/W
SD2694The 3rd byte of MACR/W
SD2695The 4th byte of MACR/W
SD2696The 5th byte of MACR/W
SD2697The 6th byte of MACR/W
SD2700Communication speed display

0: 100Mbps/Half-duplex

1: 100Mbps/Full-duplex

2: 10Mbps/Half-duplex

3: 10Mbps/Full-duplex

R×
SD2702Maximum link number supported by ModbusTCP serverMaximum link number of simultaneous client links supported by local ModbusTCP serverR/W×
SD2703The number of links of ModbusTCPThe number of links of local ModbusTCPR×
SD2710Error codeEhternet error codeR×
SD2711The socket ID of current error

-1: default ModbusTCP server

0 to 5: Custom socket error

R×
SD2720Input low bit of number of ping requestThe number of external input ping commandR×
SD2721Input high bit of number of ping requestR×
SD2722Input low bit of number of ping responseThe number of replies after receiving external ping commandR×
SD2723Input high bit of number of ping responseR×
SD2724Input low bit of number of ping requestThe number of sending ping commandR×
SD2725Input high bit of number of ping requestR×
SD2726Input low bit of number of ping responseThe number of replies after receiving external ping command sentR×
SD2727Input high bit of number of ping responseR×
SD2728The number of arp pack sentCount of the number of arp packets sentR×
SD2729The number of arp pack receivedThe number of arp pack receivedR×
SD2730The number of IP pack sentThe number of IP pack sentR×
SD2731The number of IP pack receivedThe number of IP pack receivedR×
SD2732The number of TCP pack sentThe number of TCP pack sentR×
SD2733The number of TCP pack receivedThe number of TCP pack receivedR×
SD2734The number of UDP pack sentThe number of UDP pack sentR×
SD2735The number of UDP pack receivedThe number of UDP pack receivedR×
SD2740Connection one Local port numberThe first ModbusTCP client to connect the connection information and error information of this PLC.R×
SD2741Connection one The 1st byte of IP addressR×
SD2742Connection one The 2nd byte of IP addressR×
SD2743Connection one The 3rd byte of IP addressR×
SD2744Connection one The 4th byte of IP addressR×
SD2745Connection one Opposite end port numberR×
SD2746ReservedR×
SD2747Reserved  
SD2748Connection one Error codeR×
SD2749Connection one Error communication times low wordR×
SD2750Connection one Error communication times high wordR×
SD2760Connection two Local port numberThe second ModbusTCP client to connect the connection information and error information of this PLC.R×
SD2761Connection two The 1st byte of IP addressR×
SD2762Connection two The 2nd byte of IP addressR×
SD2763Connection two The 3rd byte of IP addressR×
SD2764Connection two The 4th byte of IP addressR×
SD2765Connection two Opposite end port numberR×
SD2766ReservedR×
SD2767Reserved  
SD2768Connection two Error codeR×
SD2769Connection two Error communication times low wordR×
SD2770Connection two Error communication times high wordR×
SD2780Connection three Local port numberThe third ModbusTCP client to connect the connection information and error information of this PLC.R×
SD2781Connection three The 1st byte of IP addressR×
SD2782Connection three The 2nd byte of IP addressR×
SD2783Connection three The 3rd byte of IP addressR×
SD2784Connection three The 4th byte of IP addressR×
SD2785Connection three Opposite end port numberR×
SD2786ReservedR×
SD2787Reserved  
SD2788Connection three Error codeR×
SD2789Connection three Error communication times low wordR×
SD2780Connection three Error communication times high wordR×
SD2800Connection four Local port numberThe forth ModbusTCP client to connect the connection information and error information of this PLC.R×
SD2801Connection four The 1st byte of IP addressR×
SD2802Connection four The 2nd byte of IP addressR×
SD2803Connection four The 3rd byte of IP addressR×
SD2804Connection four The 4th byte of IP addressR×
SD2805Connection four Opposite end port numberR×
SD2806ReservedR×
SD2807Reserved  
SD2808Connection four Error codeR×
SD2809Connection four Error communication times low wordR×
SD2810Connection four Error communication times high wordR×
SD2820Connection five Local port numberThe fifth ModbusTCP client to connect the connection information and error information of this PLC.R×
SD2821Connection five The 1st byte of IP addressR×
SD2822Connection five The 2nd byte of IP addressR×
SD2823Connection five The 3rd byte of IP addressR×
SD2824Connection five The 4th byte of IP addressR×
SD2825Connection five Opposite end port numberR×
SD2826ReservedR×
SD2827Reserved  
SD2828Connection five Error codeR×
SD2829Connection five Error communication times low wordR×
SD2830Connection five Error communication times high wordR×
SD2840Connection six Local port numberThe sixth ModbusTCP client to connect the connection information and error information of this PLC.R×
SD2841Connection six The 1st byte of IP addressR×
SD2842Connection six The 2nd byte of IP addressR×
SD2843Connection six The 3rd byte of IP addressR×
SD2844Connection six The 4th byte of IP addressR×
SD2845Connection six Opposite end port numberR×
SD2846ReservedR×
SD2847Reserved  
SD2848Connection six Error codeR×
SD2849Connection six Error communication times low wordR×
SD2850Connection six Error communication times high wordR×
SD2860Connection seven Local port numberThe seventh ModbusTCP client to connect the connection information and error information of this PLC.R×
SD2861Connection seven The 1st byte of IP addressR×
SD2862Connection seven The 2nd byte of IP addressR×
SD2863Connection seven The 3rd byte of IP addressR×
SD2864Connection seven The 4th byte of IP addressR×
SD2865Connection seven Opposite end port numberR×
SD2866ReservedR×
SD2867Reserved  
SD2868Connection seven Error codeR×
SD2869Connection seven Error communication times low wordR×
SD2870Connection seven Error communication times high wordR×
SD2880Connection eight Local port numberThe eighth ModbusTCP client to connect the connection information and error information of this PLC.R×
SD2881Connection eight The 1st byte of IP addressR×
SD2882Connection eight The 2nd byte of IP addressR×
SD2883Connection eight The 3rd byte of IP addressR×
SD2884Connection eight The 4th byte of IP addressR×
SD2885Connection eight Opposite end port numberR×
SD2866Reserved  
SD2867ReservedR×
SD2888Connection eight Error codeR×
SD2889Connection eight Error communication times low wordR×
SD2890Connection eight Error communication times high wordR×

Ethernet error codes table

Operational error

Error codeDescriptionActionProcessing schemeTest time
3680Ethernet data reception errorContinue to runCheck the environment for interference.When the instruction is executed
3681Ethernet data reception timeoutContinue to run

Check whether the network cable is loose.

Check whether the network opposite end is faulty and cannot send data.

Check whether the network opposite end is not responding in time and the data is too late.

For this reason, try increasing the receive timeout in the socket configuration.

When the instruction is executed
3684ModbusTCP station number configuration errorContinue to run

Check the setting of slave station number.

Check whether there is a problem with the receiving and sending mechanism of the slave station.

When the instruction is executed
3685ModbusTCP send buffer overflowContinue to runContact the technician for the errorWhen the instruction is executed
3686ModbusTCP function code errorContinue to runCheck whether the function code set is supported by the PLC.When the instruction is executed
3687ModbusTCP address errorContinue to run

Check whether the slave station has the address.

(Please refer to Modbus abnormality 02)

When the instruction is executed
3688ModbusTCP length errorContinue to runCheck whether the communication length exceeds the range of Modbus.When the instruction is executed
3689ModbusTCP data errorContinue to run

Check whether the parameter of instruction is incorrect.

Check whether the value set is supported by slave. (Please refer to Modbus abnormality 03)

When the instruction is executed
368AModbusTCP slave station is busyContinue to run

Slave returns message: Slave is busy.

(Please refer to Modbus abnormality 06)

When the instruction is executed
368BModbusTCP slave station does not support function codeContinue to runCheck whether the function code is supported by slave. (Please refer to Modbus abnormality 01)When the instruction is executed
368CModbusTCP slave station faultContinue to run

Slave returns message: Slave is faulty.

(Please refer to Modbus abnormality 04)

When the instruction is executed
368DModbusTCP slave station confirmationContinue to run

Slave returns message: Slave confirmation.

(Please refer to Modbus abnormality 05)

When the instruction is executed
368EModbusTCP protocol currently does not support this instructionContinue to runRS instruction could not be used when set to slave protocol. Please change protocol or close the contact before the RS instruction.When the instruction is executed
368FNetwork port sending timeoutContinue to runContact the technician for the error.When the instruction is executed
3690Receiving cache overflowContinue to runCheck whether the other device has been sending data.When the instruction is executed
36A0ModbusTCP unavailable gatewayContinue to run

Slave returns message: Unavailable gateway.

(Please refer to Modbus abnormality 0A)

When the instruction is executed
36A1ModbusTCP No response was received from the target device. Generally it means that the device is not on the network.Continue to run

Slave returns message: The device is not on the network.

(Please refer to Modbus abnormality 0B)

When the instruction is executed
36C0ModbusTCP transaction identifier errorContinue to runCheck whether the network is congested and data cannot be received.When the instruction is executed
36C1ModbusTCP The server is full of available linksContinue to runCheck whether SD2702 and SD2703 have too many clients to link.When the instruction is executed
36C8The Ethernet protocol stack is running out of spaceContinue to runContact the technician for the error.When the instruction is executed
36C9The number of links exceeded the limitContinue to runCheck whether the total number of links exceeds the limit.When the instruction is executed
36CAThe last sending is not completeContinue to runUse the send completion flag to judge the current send is complete before sending the next one.When the instruction is executed
36CBTCP abnormal writeContinue to runUse flag bit device to judge whether the connection is normal. If not, not data is sent. For example, after the closing flag is set,no data is sent.When the instruction is executed
36CCTCP abnormal outputContinue to runContact the technician for the error.When the instruction is executed
36CDThe IP address has been usedContinue to runCheck whether a connection using the same address information exists.When the instruction is executed
36CEThe server receiving link errorContinue to runContact the technician for the error.When the instruction is executed
36CFTCP receiving buffer overflowContinue to runContact the technician for the error.When the instruction is executed
36D0TCP connection failedContinue to runThe TCP client may be enabled when the network cable is not connected.When the instruction is executed
36D1Abnormal when closing the link initiativeContinue to runContact the technician for the error.When the instruction is executed
36D2An abnormal shutdown occurred inside the protocol stackContinue to runIt may be closed because of no response for a long time. Check whether the opposite end is online, and whether it could be pinged.When the instruction is executed
36D3Initiate an RST link on the opposite endContinue to run
  1. Check whether the opposite end initiates an abnormal shutdown.
  2. As a client, the number of links on the opposite end is full or the port on the opposite end is notopened.
When the instruction is executed
36D4A single-ended shutdown of the protocol stack occursContinue to runContact the technician for the error.When the instruction is executed
36D5There is an IP address conflictContinue to runThere are the same IP devices in the LAN, please change the IP address.When the instruction is executed
36D6There is an MAC address conflictContinue to runThere are the same MAC devices in the LAN, please change the MAC address.When the instruction is executed
36D7TCP sending buffer overflowContinue to runContact the technician for the error.When the instruction is executed
36D8UDP abnormal connectionContinue to runIP address and port number may have been used.When the instruction is executed
36D9UDP sending buffer overflowContinue to runContact the technician for the error.When the instruction is executed
36DAUDP insufficient memory space when sendingContinue to runContact the technician for the error.When the instruction is executed
36DBUDP failed to sendContinue to runContact the technician for the error.When the instruction is executed
36DCUDP memory release failureContinue to runContact the technician for the error.When the instruction is executed
36DDUDP receiving buffer overflowContinue to runThe data length that UDP received exceeds the limit value 512.When the instruction is executed
4084The data input in the application instruction exceeds the specified range.Continue to runModify application instruction parameter.When the application instruction is executed
4085The output result in the read application instruction exceeds the device range.Continue to runModify application instruction parameter.When the application instruction is executed
4086The output result in the read application instruction exceeds the device range.Continue to runModify application instruction parameter.When the application instruction is executed
5080The Ethernet socket is already linked and could not be opened againContinue to runCheck whether the SOCOPEN instruction is executed repeatedly.When the application instruction is executed
5081The Ethernet socket is not opened and could not be operatedContinue to runCheck whether the connected bit of SOCOPEN instruction (d2) parameter is set.When the application instruction is executed
5082The socket ID that Ethernet instruction inputs exceeds the rangeContinue to runModify application instruction parameter.When the application instruction is executed
5083Failed to create TCP serverContinue to runCheck whether the link is full.When the application instruction is executed
5084Failed to create linksContinue to runCheck whether the link is full.When the application instruction is executed
5086The socket ID used by Ethernet instruction is not configured in the host computer or is not enabled after configurationContinue to runCheck the Ethernet configuration of the host computer.When the application instruction is executed
5087SOCRECV instruction reception timeoutContinue to run
  1. Check whether the network connection is normal.
  2. Check whether the network opposite end has data sent.
When the application instruction is executed
5088The socket specified by SOCMTCP instruction uses the configuration mode of non-TCP clientContinue to runCheck the Ethernet configuration of the host computer.When the application instruction is executed
5089When Ethernet socket configures a TCP server, specify the local port as 502Continue to runThe port 502 is occupied by the system. Please modify the local port number.When the application instruction is executed
508AThe UDP port is set to 1092Continue to runThe UDP port 1092 is occupied by the system and could not be used. Please modify the local port number.When the application instruction is executed
5090Abnormal network cable connectionContinue to runCheck whether the network cable is connectedWhen the application instruction is executed