![background image](http://html1.mh-extra.com/html/omron/sysmac-cj1w-eip21/sysmac-cj1w-eip21_operation-manuals_742257223.webp)
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
Содержание SYSMAC CJ1W-EIP21
Страница 8: ...Manual Structure 6 CJ series EtherNet IP Units Operation Manual for NJ series CPU Unit W495...
Страница 10: ...Sections in this Manual 8 CJ series EtherNet IP Units Operation Manual for NJ series CPU Unit W495...
Страница 20: ...Read and Understand this Manual 18 CJ series EtherNet IP Units Operation Manual for NJ series CPU Unit W495...
Страница 42: ...Revision History 40 CJ series EtherNet IP Units Operation Manual for NJ series CPU Unit W495...
Страница 68: ...1 Introduction 1 26 CJ series EtherNet IP Units Operation Manual for NJ series CPU Unit W495...
Страница 80: ...2 Installing Ethernet Networks 2 12 CJ series EtherNet IP Units Operation Manual for NJ series CPU Unit W495...
Страница 130: ...6 Testing Communications 6 4 CJ series EtherNet IP Units Operation Manual for NJ series CPU Unit W495...
Страница 206: ...7 Tag Data Link Functions 7 76 CJ series EtherNet IP Units Operation Manual for NJ series CPU Unit W495...
Страница 246: ...8 Message Communications 8 40 CJ series EtherNet IP Units Operation Manual for NJ series CPU Unit W495...
Страница 266: ...9 FTP Server 9 20 CJ series EtherNet IP Units Operation Manual for NJ series CPU Unit W495...
Страница 374: ...13 Troubleshooting 13 56 CJ series EtherNet IP Units Operation Manual for NJ series CPU Unit W495...
Страница 431: ...Index 1 CJ series EtherNet IP Units Operation Manual for NJ series CPU Unit W495 I Index...
Страница 436: ...Index 6 CJ series EtherNet IP Units Operation Manual for NJ series CPU Unit W495 Index...
Страница 437: ......