Omron Sysmac NJ-series User Manual page 335

Machine automation controller cpu unit built-in ethernet/iptm port
Hide thumbs Also See for Sysmac NJ-series:
Table of Contents

Advertisement

3 :
SktUDPRcv_instance(
Execute
Socket
TimeOut
Size
RcvDat
IF (SktUDPRcv_instance.Done=TRUE) THEN
Stage
ELSIF (SktUDPRcv_instance.Error=TRUE) THEN
Stage
END_IF;
4 :
SktClose_instance(
Execute
Socket
IF (SktClose_instance.Done=TRUE) THEN
Stage
ELSIF (SktClose_instance.Error=TRUE) THEN
Stage
END_IF;
0 :
DoSendAndRcv:=FALSE;
Trigger
ELSE
DoSendAndRcv:=FALSE;
Trigger
END_CASE;
END_IF;
 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 SktUDPCreate instruction is used to request creating a UDP socket.
2
The SktUDPRcv instruction is executed to request reception. The receive data is stored in
RcvSocketDat[].
3
Execute the SktUDPSend instruction to request sending. The data in SendSocketDat[] is sent.
4
The SktClose instruction is executed to close the socket.
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User's Manual (W506)
// Request receiving data.
:=TRUE,
:=WkSocket,
:=UINT#0,
:=UINT#2000,
:=RcvSocketDat[0]);
:=INT#4;
:=INT#30;
// Request closing data.
:=TRUE,
:=WkSocket);
:=INT#0;
:=INT#40;
// Normal end
:=FALSE;
// Interrupted by error.
:=FALSE;
9 Socket Service
// Socket
// Timeout value
// Receive data size
// Receive data
// Normal end
// Error end
// Socket
// Normal end
// Error end
9
9-21

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sysmac nx-seriesSysmac nx1p2-10 seriesSysmac nx1p2-90 seriesSysmac nj501-5 seriesSysmac nj501-4 seriesSysmac nj501-3 series ... Show all

Table of Contents