EasyManuals Logo
Home>Omron>Computer Hardware>Sysmac NJ-series

Omron Sysmac NJ-series User Manual

Omron Sysmac NJ-series
578 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
Page #337 background imageLoading...
Page #337 background image
9-23
9 Socket Service
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
9-6 Details on Using the Socket Services
9
9-6-4 UDP Sample Programming
2 : // Request receiving data.
SktUDPRcv_instance(
Execute :=TRUE,
Socket :=WkSocket, // Socket
TimeOut :=UINT#0, // Timeout value
Size :=UINT#2000, // Receive data size
RcvDat :=RcvSocketDat[0]); // Receive data
IF (SktUDPRcv_instance.Done=TRUE) THEN
Stage :=INT#3; // Normal end
ELSIF (SktUDPRcv_instance.Error=TRUE) THEN
Stage :=INT#20; // Error end
END_IF;
3 : // Send request
WkSocket.DstAdr.PortNo:=UINT#6000;
WkSocket.DstAdr.IpAdr :='192.168.250.1';
SktUDPSend_instance(
Execute :=TRUE,
Socket :=WkSocket, // Socket
SendDat :=SendSocketDat[0], // Send data
Size :=UINT#2000); // Send data size
IF (SktUDPSend_instance.Done=TRUE) THEN
Stage :=INT#4; // Normal end
ELSIF (SktUDPSend_instance.Error=TRUE) THEN
Stage :=INT#30; // Error end
END_IF;
4 : // Request closing data.
SktClose_instance(
Execute :=TRUE,
Socket :=WkSocket); // Socket
IF (SktClose_instance.Done=TRUE) THEN
Stage :=INT#0; // Normal end
ELSIF (SktClose_instance.Error=TRUE) THEN
Stage :=INT#40; // Error end
END_IF;
0 : // Normal end
DoSendAndRcv:=FALSE;
Trigger :=FALSE;
ELSE // Interrupted by error.
DoSendAndRcv:=FALSE;
Trigger :=FALSE;
END_CASE;
END_IF;

Table of Contents

Other manuals for Omron Sysmac NJ-series

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Omron Sysmac NJ-series and is the answer not in the manual?

Omron Sysmac NJ-series Specifications

General IconGeneral
BrandOmron
ModelSysmac NJ-series
CategoryComputer Hardware
LanguageEnglish

Related product manuals