![Omron CS1W-ETN01 Operation Manuals Download Page 99](http://html1.mh-extra.com/html/omron/cs1w-etn01/cs1w-etn01_operation-manuals_742528099.webp)
6-1
Section
Overview
87
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).
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
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 lan-
guage interface libraries, which allow TCP or UDP protocols to be programming
using library functions. With UNIX computers, socket interfaces are supported in
the form of system calls.
The CS1-series PCs support the socket service from the user program. The user
program requests service functions either by manipulating Socket Service Re-
quest Switches in the CPU Bus Unit Area in the CIO Area or by sending FINS
commands to the Ethernet Unit by executing CMND(490) instruction in the lad-
der diagram.
Socket communications services can be used to transfer arbitrary data between
a PC and a host computer or between two PCs. The Ethernet supports two sock-
et services: a UDP socket service and a TCP socket service. Refer to 2-1-3 Se-
lecting 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.
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
6-1-4 Socket Port Numbers
Port numbers up to 1023 on a UNIX workstation can be used by the superuser
only. Port numbers 0 to 255 are reserved for well-known ports. Consequently,
port numbers 1024 and above should be used for socket services. The Ethernet
Unit does not support port #0.