![Omron CS1W-ETN01 Operation Manuals Download Page 122](http://html1.mh-extra.com/html/omron/cs1w-etn01/cs1w-etn01_operation-manuals_742528122.webp)
6-2
Section
Using Socket Services with Socket Service Request Switches
110
6-2-8 TCP/IP Communications Programming Example
The following programming example illustrates transferring 100 bytes of data
between an Ethernet Unit and a host computer using TCP/IP communications.
The programming example uses the following system configuration. For the
TCP connection, the Ethernet Unit uses a passive open and the host computer
uses an active open.
Host computer
Ethernet Unit
IP address:
196.36.32.55
Port number: 4096
IP address:
196.36.32.101
Port number: 4096
PC
The data will flow between the CPU Unit, Ethernet Unit, and host computer as
shown in the following diagram.
Host computer
Line
(Ethernet)
Ethernet
Unit
CPU Unit
Request Switches and ex-
ecution bits turned ON
(see Note).
Sent to line.
Processing in
host computer
Execution bits turned OFF
Note Here, “execution bits” refer to CIO 000000 to CIO 000003, which are used in the
ladder diagram to control execution of communications.
Basic Operations
•
CIO 000000 is turned ON to request opening a TCP socket from the Ethernet
Unit.
•
CIO 000001 is turned ON to request closing the TCP socket from the Ethernet
Unit.
•
CIO 000002 is turned ON to request sending data from the Ethernet Unit. Data
(100 bytes) is sent beginning at D00000.
•
CIO 000003 is turned ON to request receiving data from the Ethernet Unit. The
data that is received (100 bytes) is stored beginning at D01000.
•
One of the bits between CIO 000100 and CIO 000103 will turn ON if an error
occurs. Refer to 6-2-2 Response Codes for information on errors.
System Configuration
Data Flow