8 Message Communications
8-24
CJ-series EtherNet/IP Units Operation Manual for NJ-series CPU Unit (W495)
IF (DoCIPTrigger=TRUE) THEN
CASE Stage OF
1 :
// Open CIP class 3 connection.
CIPOpen_instance(
Execute
:=TRUE,
TimeOut
:=UINT#20,
// Timeout time: 2.0 s
RoutePath :='RoutePathDat');
// 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 CJ1W-EIP21
Page 8: ...Manual Structure 6 CJ series EtherNet IP Units Operation Manual for NJ series CPU Unit W495...
Page 42: ...Revision History 40 CJ series EtherNet IP Units Operation Manual for NJ series CPU Unit W495...
Page 68: ...1 Introduction 1 26 CJ series EtherNet IP Units Operation Manual for NJ series CPU Unit W495...
Page 266: ...9 FTP Server 9 20 CJ series EtherNet IP Units Operation Manual for NJ series CPU Unit W495...
Page 431: ...Index 1 CJ series EtherNet IP Units Operation Manual for NJ series CPU Unit W495 I Index...
Page 436: ...Index 6 CJ series EtherNet IP Units Operation Manual for NJ series CPU Unit W495 Index...
Page 437: ......