Sample Programming
In this sample, the TCP socket service is used for data communications between the NJ/NX-series
Controller and a remote node.
IP address: 192.168.250.1
TCP port number: Automatically assigned.
Built-in EtherNet/IP port
The processing procedure is as follows:
1
The SktTCPConnect instruction is used to request connecting to the TCP port on the remote
node.
2
The SktClearBuf instruction is used to clear the receive buffer for a TCP socket.
3
The SktGetTCPStatus instruction is used to read the status of a TCP socket.
4
The SktTCPSend instruction is used to request sending data. The data in SendSocketDat[] is
sent.
5
The SktTCPRcv instruction is used to request receiving data. The received data is stored in
RcvSocketDat[].
6
The SktClose instruction is used to close the socket.
NY-series Instructions Reference Manual (W560)
IP address: 192.168.250.2
TCP port number: 6000
Data sent.
Remote node
Data received.
Ethernet line
2 Instruction Descriptions
2-1065
2