Nj-Series Instructions Reference Manual (W502 - Omron NJ501-1500 Reference Manual

Machine automation controller nj-series
Hide thumbs Also See for NJ501-1500:
Table of Contents

Advertisement

2 Instruction Descriptions
• You can execute a maximum of 32 of the following instructions at the same time: SktUDPCreate,
SktUDPRcv, SktUDPSend, SktTCPAccept, SktTCPConnect, SktTCPRcv, SktTCPSend, SktGetTCP-
Status, SktClose, and SktClearBuf.
• You can open a maximum of 16 sockets combined for UDP and TCP sockets.
• An error occurs in the following cases. Error will change to TRUE.
• There is a setting error for the local IP address.
• The value of DstAdr is outside of the valid range.
• The value of DstTcpPort is outside of the valid range.
• The TCP port that is specified with SrcTcpPort is already open.
• The remote node that is specified with DstAdr does not exist.
• The remote node that is specified with DstAdr and DstTcpPort is not waiting for a connection.
• Address resolution failed for the host name that is specified with DstAdr.
• A connection is already open for the same client (IP address and TCP port).
Sample Programming
In this sample, the TCP socket service is used for data communications between the NJ-series Control-
ler 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.
2-772
IP address: 192.168.250.2
TCP port number: 6000
Data sent.
Remote node
Data received.
Ethernet line

NJ-series Instructions Reference Manual (W502)

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Nj501-1300Nj501-1400

Table of Contents