EasyManua.ls Logo

Omron NJ501-1500

Omron NJ501-1500
990 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...
2 Instruction Descriptions
2-758
NJ-series Instructions Reference Manual (W502)
z 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 SktUDPCreate instruction is used to request creating a UDP socket.
2
The SktUDPRcv instruction is used to request receiving data. The received data is stored in
RcvSocketDat[].
3
The SktUDPSend instruction is used to request sending data. The data in SendSocketDat[] is
sent.
4
The SktClose instruction is used to close the socket.
3 :
SktUDPRcv_instance(
Execute :=TRUE,
Socket :=WkSocket,
TimeOut:=UINT#0,
Size :=UINT#2000,
RcvDat :=RcvSocketDat[0]);
IF (SktUDPRcv_instance.Done=TRUE) THEN
Stage:=INT#4;
ELSIF (SktUDPRcv_instance.Error=TRUE) THEN
Stage:=INT#30;
END_IF;
4 :
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 :
DoSendAndRcv:=FALSE;
Trigger :=FALSE;
ELSE
DoSendAndRcv:=FALSE;
Trigger :=FALSE;
END_CASE;
END_IF;
// Socket
// Normal end
// Error end
// Request closing.
// Normal end
// Interrupted by error.
// Socket
// Timeout time
// Receive data size
// Receive data
// Normal end
// Error end
// Request receiving data.

Table of Contents

Related product manuals