![](/images/new-backgrounds/1300968/300968137x1.webp)
6 F 3 B 0 3 6 2
6. Socket Interface Communication
CAUTION
1.Chapter 6 presents information related to using the functions provided by the Ethernet Port from a T2N, including the instruction (request) format, important items that require attention, and sample programs. That chapter also presents items considered necessary when using the Ethernet Port.
Make a point of understanding the content of chapter 4 thoroughly before writing programs that use the Ethernet Port. The sample programs present basic examples of Ethernet Port usage, and should be reviewed carefully before use in an actual system.
This chapter describes the functions and positioning of the socket interface, and the differences between the UDP socket interface and the TCP socket interface. Next, this chapter presents notes on using the Ethernet Port socket interface and describes the procedures for using this functionality.
6.1 Overview
This section describes the functions and positioning of the socket interface, and the differences between the UDP socket interface and the TCP socket interface.
1.Positioning and functionality
The socket interface is a programming interface that allows user programs to use the TCP/IP and UDP/IP functions. Socket interface communication is a communication technique that has become standard on engineering workstations (EWS) and other networked computer systems.
The socket interface can be used for communication between host application programs and user programs running on the T2N.
The Ethernet Port socket interface provides eight sockets, and the communication protocol (TCP/IP or UDP/IP) used with the remote destination can be specified for each socket. User programs on the T2N use the SEND and RECV instructions to use the socket interface.
TCP/IP (Transmission Control Protocol/Internet Protocol) UDP/IP (User Datagram Protocol/Internet Protocol)
Figure 6.1 shows the positioning of the socket interface.
EWS
Application program
System
calls
OS (UNIX)
Socket interface
UDP/TCP
IP
CSMA/CD
T2N
T2N user program
SEND and RECV
instructions
T2N firmware
Socket interface
UDP/TCP
IP
CSMA/CD
Data communication
TCP or UDP
Figure 6.1 Positioning of the Socket Interface
⎯ 68 ⎯