Omron CJ1W-SCU32 Operation Manual page 212

Machine automation controller, cj / nj-series, serial communications units, cpu unit
Table of Contents

Advertisement

5 Serial Gateway
Program Example
//Serial Gateway prohibition setting
IF ( State = INT#0 ) THEN
IF (( Trigger = TRUE ) AND (LastTrigger=FALSE)) THEN
SCU_P1_SgwDsblCmd := TRUE;
State := INT#1;
END_IF;
LastTrigger := Trigger;
END_IF;
//Start condition check
IF ( State = INT#1 ) THEN
IF (( _Port_isAvailable = TRUE ) AND ( SCU_P1_PmrExecSta <> TRUE ) AND ( SCU_P
1_PmrSgwProhSta = TRUE ) AND ( ExecPMCR_instance.Busy <> TRUE )) THEN
State := INT#2;
END_IF;
END_IF;
//Communication parameters settings and ExecPMCR instruction initialization
IF ( State = INT#2 ) THEN
InPort.UnitNo := _eUnitNo#_CBU_No02;
InPort.PhysicPortNo := USINT#1;
SendData[0] := WORD#16#xxxx;
SendData[1] := WORD#16#xxxx;
SendData[2] := WORD#16#xxxx;
SendData[3] := WORD#16#xxxx;
SendData[4] := WORD#16#xxxx;
RecvData[0] := WORD#16#xxxx;
ExecPMCR_instance( Execute := FALSE ,
State := INT#3
END_IF;
//ExecPMCR instruction execution
IF ( State = INT#3 ) THEN
ExecPMCR_instance( Execute := TRUE,
5-20
DstDat := RecvData[0] );
Port := InPort,
SeqNo := xxx,
SrcDat := SendData[0],
DstDat := RecvData[0] );
CJ-series Serial Communications Units Operation Manual for NJ-series CPU Unit(W494)
//Serial Gateway prohibited
//Serial Communications Unit, Unit number 2
//Port number 1
//ExecPMCR instruction initialization
//Dummy

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cj1w-scu22Cj1w-scu42

Table of Contents