![background image](http://html.mh-extra.com/html/omron/sysmac-ny512-1300/sysmac-ny512-1300_user-manual_742451221.webp)
8-25
8 CIP Message Communications
NY-series Industrial Panel PC / Industrial Box PC Built-in EtherNet/IP Port User’s Manual (W563)
8-2
CIP Messag
ing C
o
m
m
u
n
icat
ions
Client
Fu
nct
ion
8
8-2
-8 Sample Progr
ammin
g for CI
P
C
onnection
(Class 3)
Message
Communicatio
ns
IF (DoCIPTrigger=TRUE) THEN
CASE Stage OF
1 :
// Open CIP Class 3 Connection (Large_Forward_Open)
CIPOpen_instance(
Execute
:=TRUE,
TimeOut
:=UINT#20,
// Timeout time: 2.0 s
RoutePath :='02\192.168.250.2');
// Route path
IF (CIPOpen_instance.Done=TRUE) THEN
Stage
:=INT#2;
// Normal end
ELSIF (CIPOpen_instance.Error=TRUE) THEN
Stage
:=INT#10;
// Error end
END_IF;
2 :
// Request writing value of variable.
CIPWrite_instance(
Execute
:=TRUE,
Handle
:=CIPOpen_instance.Handle,
// Handle
DstDat
:='WritingDat',
// Source variable name
Size
:=UINT#1,
// Number of elements to write
SrcDat
:=WriteDat);
// Write data
IF (CIPWrite_instance.Done=TRUE) THEN
Stage
:=INT#3;
// Normal end
ELSIF (CIPWrite_instance.Error=TRUE) THEN
Stage
:=INT#20;
// Error end
END_IF;
3 :
// Request reading value of variable.
CIPRead_instance(
Execute
:=TRUE,
Handle
:=CIPOpen_instance.Handle,
// Handle
SrcDat
:='OriginalDat',
// Source variable name
Size
:=UINT#1,
// Number of elements to read
DstDat
:=ReadDat);
// Read data
IF (CIPRead_instance.Done=TRUE) THEN
Stage
:=INT#4;
// Normal end
ELSIF (CIPRead_instance.Error=TRUE) THEN
Stage
:=INT#30;
// Error end
END_IF;
Summary of Contents for Sysmac NY512-1300
Page 459: ......