Nj-Series Instructions Reference Manual (W502 - Omron NJ501-1500 Reference Manual

Machine automation controller nj-series
Hide thumbs Also See for NJ501-1500:
Table of Contents

Advertisement

2 Instruction Descriptions
3 :
SktGetTCPStatus_instance(
Execute:=TRUE,
Socket :=WkSocket);
IF (SktGetTCPStatus_instance.Done=TRUE) THEN
Stage:=INT#4;
ELSIF (SktGetTCPStatus_instance.Error=TRUE) THEN
Stage:=INT#30;
END_IF;
4 :
SktTCPSend_instance(
Execute
Socket :=WkSocket,
SendDat:=SendSocketDat[0],
Size
IF (SktTCPSend_instance.Done=TRUE) THEN
Stage:=INT#5;
ELSIF (SktTCPSend_instance.Error=TRUE) THEN
Stage:=INT#40;
END_IF;
5 :
SktTCPRcv_instance(
Execute
Socket :=WkSocket,
TimeOut:=UINT#0,
Size
RcvDat :=RcvSocketDat[0]);
IF (SktTCPRcv_instance.Done=TRUE) THEN
Stage:=INT#6;
ELSIF (SktTCPRcv_instance.Error=TRUE) THEN
Stage:=INT#50;
END_IF;
6 :
SktClose_instance(
Execute:=TRUE,
Socket :=WkSocket);
IF (SktClose_instance.Done=TRUE) THEN
Stage:=INT#0;
ELSIF (SktClose_instance.Error=TRUE) THEN
Stage:=INT#40;
END_IF;
0 :
DoTCP:=FALSE;
Trigger :=FALSE;
ELSE
DoTCP:=FALSE;
Trigger :=FALSE;
END_CASE;
END_IF;
Programming in the Remote Node
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 used to request accepting a TCP socket.
2
The SktTCPRcv instruction is used to request receiving data. The received data is stored in
RcvSocketDat[].
3
The SktTCPSend instruction is used to request sending data. The data in SendSocketDat[] is
sent.
2-774
// Request reading status.
// Socket
// Normal end
// Error end
// Request sending data
:=TRUE,
// Socket
// Send data
:=UINT#2000);
// Send data size
// Normal end
// Error end
// Request receiving data
:=TRUE,
// Socket
// Timeout time
:=UINT#2000,
// Receive data size
// Receive data
// Normal end
// Error end
// Request closing.
// Socket
// Normal end
// Error end
// Normal end
// Interrupted by error.

NJ-series Instructions Reference Manual (W502)

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Nj501-1300Nj501-1400

Table of Contents