![background image](http://html1.mh-extra.com/html/omron/cj1w-scu22/cj1w-scu22_operation-manual_742498212.webp)
5 Serial Gateway
5-20
CJ-series Serial Communications Units Operation Manual for NJ-series CPU Unit(W494)
Program Example
//Serial Gateway prohibition setting
IF ( State = INT#0 ) THEN
IF (( Trigger = TRUE ) AND (LastTrigger=FALSE)) THEN
SCU_P1_SgwDsblCmd := TRUE;
//Serial Gateway prohibited
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;
//Serial Communications Unit, Unit number 2
InPort.PhysicPortNo := USINT#1;
//Port number 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 ,
//ExecPMCR instruction initialization
DstDat := RecvData[0] );
//Dummy
State := INT#3
END_IF;
//ExecPMCR instruction execution
IF ( State = INT#3 ) THEN
ExecPMCR_instance( Execute := TRUE,
Port := InPort,
SeqNo := xxx,
SrcDat := SendData[0],
DstDat := RecvData[0] );
Содержание CJ1W-SCU22
Страница 192: ...4 Using Protocol Macros 4 56 CJ series Serial Communications Units Operation Manual for NJ series CPU Unit W494...
Страница 250: ...6 No protocol Mode 6 22 CJ series Serial Communications Units Operation Manual for NJ series CPU Unit W494...
Страница 460: ...A Standard System Protocol R 126 CJ series Serial Communications Units Operation Manual for NJ series CPU Unit W494...
Страница 473: ...Index 1 CJ series Serial Communications Units Operation Manual for NJ series CPU Unit W494 I Index...