Omron CJ1W-ETN11 Network Card User Manual


 
105
Overview Section 6-1
Specific Socket Service Functions
The socket service functions listed in the following table can be executed
either using Socket Service Request Switches or using CMND(490).
6-1-2 Sockets
Sockets are interfaces that allow TCP and UDP protocols to be used directly
from the user program. With personal computers, socket are provided as C
language interface libraries, which allow TCP or UDP protocols to be pro-
gramming using library functions. With UNIX computers, socket interfaces are
supported in the form of system calls.
The CS/CJ-series PCs support the socket service from the user program. The
user program requests service functions either by manipulating Socket Ser-
vice Request Switches in the CPU Bus Unit Area in the CIO Area or by send-
ing FINS commands to the Ethernet Unit by executing CMND(490) instruction
in the ladder diagram.
Socket communications services can be used to transfer arbitrary data
between a PC and a host computer or between two PCs. The Ethernet sup-
ports two socket services: a UDP socket service and a TCP socket service.
Refer to 2-1-3 Selecting Communications Services for a comparison of the
socket services and the FINS communications service.
6-1-3 Using Sockets with the Ethernet Unit
The Ethernet Unit supports up to 16 simultaneous socket connections for the
socket services, 8 each for UDP and TCP sockets. Socket numbers 1 to 8 are
assigned to sockets for both UDP and TCP sockets. Sockets are managed
from the ladder-diagram program by assigning a socket port for each socket
number. The socket port number is assigned when the socket is opened.
6-1-4 Socket Port Numbers
Port numbers up to 1023 on a UNIX workstation can be used by the supe-
ruser only. Port numbers 0 to 255 are reserved for well-known ports. Conse-
Protocol Socket service request
UDP Open UDP socket
Receive via UDP socket
Send via UDP socket
Close UDP socket
TCP Open TCP socket, passive
Open TCP socket, active
Receive via TCP socket
Send via TCP socket
Close TCP socket
UDP socket
port 1
TCP socket
port 65535
Sockets
Socket ports are
assigned to socket
numbers.
UDP socket 1
TCP socket 8
Socket
services
UDP open request