8-23
8 Message Communications
CJ-series EtherNet/IP Units Operation Manual for NJ-series CPU Unit (W495)
8-2 Using
CIP Messa
g
e Co
mm
un
icati
ons
8
8
-2
-7 Sample Prog
ra
mming f
o
r CIP Connection
(C
lass
3) Messa
ge Comm
unications
ST
// Start sequence when Trigger changes to TRUE.
IF ((Trigger=TRUE) AND (DoCIPTrigger=FALSE) AND (J01_ETNOnlineSta=TRUE))THEN
DoCIPTrigger:=TRUE;
Stage
:=INT#1;
CIPOpen_instance(Execute:=FALSE);
// Initialize instance.
CIPWrite_instance(
Execute
:=FALSE,
// Initialize instance.
SrcDat
:=WriteDat);
// Dummy
CIPRead_instance(
// Initialize instance.
Execute
:=FALSE,
// Dummy
DstDat
:=ReadDat);
// Dummy
CIPSend_instance(
Execute
:=FALSE,
// Initialize instance.
ServiceDat
:= Dummy,
// Dummy
RespServiceDat
:=RespDat);
// Dummy
CIPClose_instance(Execute:=FALSE);
// Initialize instance.
END_IF;
Internal
Variables
Variable
Data type
Initial value
Comment
Trigger
BOOL
False
Execution condition
DoCIPTrigger
BOOL
False
Processing
Stage
INT
0
Status change
WriteDat
INT
0
Write data
ReadDat
INT
0
Read data
RoutePathDat
string[256]
01\#10\02\192.168.250.1\01\#00
Route path
ReqPath
_sREQUEST_
PATH
(ClassID:=0, InstanceID:=0,
isAttributeID:=False, AttributeID:=0)
Request path
RespDat
ARRAY[0..10] OF
BYTE
[11(16#0)]
Response data
Dummy
BYTE
16#0
Dummy
CIPOpen_instance
CIPOpen
CIPWrite_instance
CIPWrite
CIPRead_instance
CIPRead
CIPSend_instance
CIPSend
CIPClose_instance
CIPClose
External
Variables
Variable
Data type
Constant
Comment
J01_ETNOnlineSta
BOOL
Online
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: ......