EasyManua.ls Logo

Omron NJ501-1500

Omron NJ501-1500
990 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
2 Instruction Descriptions
2-772
NJ-series Instructions Reference Manual (W502)
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).
In this sample, the TCP socket service is used for data communications between the NJ-series Control-
ler and a remote node.
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.
Sample Programming
IP address: 192.168.250.1
TCP port number: Automatically assigned.
Ethernet line
Built-in EtherNet/IP port
Data received.
Remote node
IP address: 192.168.250.2
TCP port number: 6000
Data sent.

Table of Contents

Related product manuals