![Omron Sysmac NY512-1300 Скачать руководство пользователя страница 282](http://html.mh-extra.com/html/omron/sysmac-ny512-1300/sysmac-ny512-1300_user-manual_742451282.webp)
9 Socket Service
9-24
NY-series Industrial Panel PC / Industrial Box PC Built-in EtherNet/IP Port User’s Manual (W563)
In this sample, the TCP socket service is used for data communications between the NY-series Control-
ler and a remote node.
The processing procedure is as follows:
1
The SktTCPConnect instruction is executed to request connecting to the TCP port on the
remote node.
2
The SktClearBuf instruction is executed to clear the receive buffer for a TCP socket.
3
The SktGetTCPStatus instruction is executed to read the status of a TCP socket.
4
The SktTCPSend instruction is executed to request sending data. The data in
SendSocketDat[]
is sent.
5
The SktTCPRcv instruction is executed to request receiving data. The receive data is stored in
RcvSocketDat[]
.
6
The SktClose instruction is executed to close the socket.
ST
*1 Replace the variable name with
_EIP1_EtnOnlineSta
(Port1 Online) or
_EIPIn1_EtnOnlineSta
(Internal Port1
Online), depending on which communications port you use.
9-6-5
TCP Sample Programming
Internal
Variables
Variable
Data type
Initial value
Comment
Trigger
BOOL
False
Execution condition
DoTCP
BOOL
False
Processing
Stage
INT
0
Status change
RcvSocketDat
ARRAY[0..1999] OF
BYTE
[2000(16#0)]
Receive data
WkSocket
_sSOCKET
(Handle:=0,SrcAdr:=(PortNo:=0,
IpAdr:=’’), DstAdr:=(PortNo:=0,
IpAdr:=’’))
Socket
SendSocketDat
ARRAY[0..1999] OF
BYTE
[2000(16#0)]
Send data
SktTCPConnect_
instance
SktTCPConnect
SktClearBuf_instance
SktClearBuf
SktGetTCPStatus_
instance
SktGetTCPStatus
SktTCPSend_instance
SktTCPSend
SktTCPRcv_instance
SktTCPRcv
SktClose_instance
SktClose
External
Variables
Variable
Data type
Constant
Comment
_EIP_EtnOnlineSta
*1
BOOL
Online
IP address: 192.168.250.1
TCP port number: Automatically assigned.
Ethernet line
Built-in EtherNet/IP port
Data received.
Remote node
IP address: 192.168.250.2
TCP port number: 6000
Data sent.
Содержание Sysmac NY512-1300
Страница 290: ...9 Socket Service 9 32 NY series Industrial Panel PC Industrial Box PC Built in EtherNet IP Port User s Manual W563 ...
Страница 310: ...10 FTP Server 10 20 NY series Industrial Panel PC Industrial Box PC Built in EtherNet IP Port User s Manual W563 ...
Страница 324: ...11 FTP Client 11 14 NY series Industrial Panel PC Industrial Box PC Built in EtherNet IP Port User s Manual W563 ...
Страница 452: ...Appendices A 66 NY series Industrial Panel PC Industrial Box PC Built in EtherNet IP Port User s Manual W563 ...
Страница 453: ...Index 1 NY series Industrial Panel PC Industrial Box PC Built in EtherNet IP Port User s Manual W563 I Index ...
Страница 459: ......