![background image](http://html1.mh-extra.com/html/omron/sysmac-nx1p2-10-1-series/sysmac-nx1p2-10-1-series_user-manual_1633435294.webp)
For an NX1P2 CPU Unit, replace the variable with _EIP1_EtnOnlineSta (Port1 Online).
// Start sequence when Trigger changes to TRUE.
IF ((Trigger=TRUE) AND (DoCIPTrigger=FALSE) AND (_EIP_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;
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', // Destination variable
name
Size :=UINT#1, // Number of elements to
write
SrcDat :=WriteDat); // Write data
IF (CIPWrite_instance.Done=TRUE) THEN
8 CIP Message Communications
8-32
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)
Содержание Sysmac NX1P2-10 1 Series
Страница 8: ...Manual Structure 6 NJ NX series CPU Unit Built in EtherNet IP Port User s Manual W506...
Страница 34: ...Revision History 32 NJ NX series CPU Unit Built in EtherNet IP Port User s Manual W506...
Страница 174: ...6 Testing Communications 6 4 NJ NX series CPU Unit Built in EtherNet IP Port User s Manual W506...
Страница 354: ...8 CIP Message Communications 8 92 NJ NX series CPU Unit Built in EtherNet IP Port User s Manual W506...
Страница 388: ...9 Socket Service 9 34 NJ NX series CPU Unit Built in EtherNet IP Port User s Manual W506...
Страница 394: ...10 Modbus TCP Master Function 10 6 NJ NX series CPU Unit Built in EtherNet IP Port User s Manual W506...
Страница 430: ...12 FTP Client 12 14 NJ NX series CPU Unit Built in EtherNet IP Port User s Manual W506...
Страница 569: ...I Index I 1 NJ NX series CPU Unit Built in EtherNet IP Port User s Manual W506 I...
Страница 576: ...Index I 8 NJ NX series CPU Unit Built in EtherNet IP Port User s Manual W506...
Страница 577: ......