EasyManua.ls Logo

Omron NJ501-1300 - Page 236

Omron NJ501-1300
398 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
9 Socket Service
9-26
NJ-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
0 : // Normal end
DoTCP :=FALSE;
Trigger :=FALSE;
ELSE // Interrupted by error.
DoTCP :=FALSE;
Trigger :=FALSE;
END_CASE;
END_IF;
z Remote Node Programming
In this example, programming is also required in the remote node. The order of sending and receiv-
ing is reversed in comparison with the above procedure.
1
The SktTCPAccept instruction is executed to request accepting a TCP socket.
2
The SktTCPRcv instruction is executed to request receiving data. The receive data is stored in
RcvSocketDat[].
3
The SktTCPSend instruction is executed to request sending data. The data in SendSocketDat[]
is sent.
4
The SktClose instruction is executed to close the socket.
ST
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
SktTCPAccept_instance SktTCPAccept
SktTCPSend_instance SktTCPSend
SktTCPRcv_instance SktTCPRcv
SktClose_instance SktClose
External
Variables
Variable Data type Constant Comment
_EIP_EtnOnlineSta BOOL Online

Table of Contents

Related product manuals