8-17
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
-6 Sample Prog
ra
mming f
or CIP Connectio
nless
(U
CMM) Message Comm
unications
ST
// Start sequence when Trigger changes to TRUE.
IF ((Trigger=TRUE) AND (DoUCMMTrigger=FALSE) AND (J 01_ETNOnlineSta=TRUE))
THEN
DoUCMMTrigger
:=TRUE;
Stage
:=INT#1;
CIPUCMMWrite_instance(
Execute
:=FALSE,
// Initialize instance.
SrcDat
:=WriteDat);
// Dummy
CIPUCMMRead_instance(
// Initialize instance.
Execute
:=FALSE,
// Dummy
DstDat
:=ReadDat);
// Dummy
CIPUCMMSend_instance(
Execute
:=FALSE,
// Initialize instance.
ServiceDat
:= Dummy,
// Dummy
RespServiceDat
:=RespDat);
// Dummy
END_IF;
IF (DoUCMMTrigger=TRUE) THEN
CASE Stage OF
1 :
// Request writing value of variable.
CIPUCMMWrite_instance(
Execute
:=TRUE,
RoutePath
:='RoutePathDat',
// Route path
TimeOut
:=UINT#20,
// Timeout value
DstDat
:='WritingDat',
// Source variable name
Size
:=UINT#1,
// Number of elements to write
SrcDat
:=WriteDat);
// Write data
IF (CIPUCMMWrite_instance.Done=TRUE) THEN
Stage
:=INT#2;
// Normal end
ELSIF (CIPUCMMWrite_instance.Error=TRUE) THEN
Internal
Variables
Variable
Data type
Initial value
Comment
Trigger
BOOL
False
Execution condition
DoUCMMTrigger
BOOL
False
Processing
Stage
INT
0
Status change
WriteDat
INT
0
Write data
ReadDat
INT
0
Read data
ReqPath
_sREQUEST_
PATH
(ClassID:=0, InstanceID:=0,
isAttributeID:=False, AttributeID:=0)
Request path
RoutePathDat
string[256]
01\#10\02\192.168.250.2\01\#00
Route path
RespDat
ARRAY[0..10] OF
BYTE
[11(16#0)]
Response data
Dummy
BYTE
16#0
Dummy
CIPUCMMWrite_instance
CIPUCMMWrite
CIPUCMMRead_instance
CIPUCMMRead
CIPUCMMSend_instance
CIPUCMMSend
External
Variables
Variable
Data type
Constant
Comment
J 01_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: ......