Tcp/Ip Communications Programming Example - Omron CS1W-ETN11 Operation Manual

10base-5, 10base-t ethernet units
Hide thumbs Also See for CS1W-ETN11:
Table of Contents

Advertisement

Using Socket Services with Socket Service Request Switches
6-2-8

TCP/IP Communications Programming Example

System Configuration
Data Flow
Basic Operations
130
The following programming example illustrates transferring 100 bytes of data
between an Ethernet Unit and a host computer using TCP/IP communica-
tions.
The programming example uses the following system configuration. For the
TCP connection, the Ethernet Unit uses a passive open and the host com-
puter uses an active open.
Host computer
IP address:
Port number: 4096
The data will flow between the CPU Unit, Ethernet Unit, and host computer as
shown in the following diagram.
Host computer
Processing in
host computer
Note Here, "execution bits" refer to CIO 000000 to CIO 000003, which are used in
the ladder diagram to control execution of communications.
• 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 Codesfor information on errors.
196.36.32.55
IP address:
Port number: 4096
Line
Ethernet
(Ethernet)
Unit
Sent to line.
Section 6-2
Ethernet Unit
PC
196.36.32.101
CPU Unit
Request Switches and ex-
ecution bits turned ON
(See note.)
Execution bits turned OFF

Advertisement

Table of Contents
loading

Table of Contents