Omron CJ1W-SCU32 Operation Manual page 248

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

Advertisement

6 No-protocol Mode
IF (OperatingStart=TRUE) THEN
SerialRcv_instance(
Execute:=FALSE,
Port := InPort,
Size := UINT#13,
DstDat := RecvDat[0],
RcvSize => RecvSize);
InPort.UnitNo := _eUnitNo#_CBU_No00;
InPort.PhysicPortNo := USINT#2;
OperatingStart:=FALSE;
END_IF;
//SerialRcv instruction execution
IF (Operating=TRUE) THEN
SerialRcv_instance(
Execute:=TRUE,
Port := InPort,
Size := UINT#13,
DstDat := RecvDat[0],
RcvSize => RecvSize);
IF (SerialRcv_instance.Done = TRUE) THEN
//Processing at normal end
RecvStringDat := AryToString(In := RecvDat[0], Size := RecvSize); //Conversion of character
Code:=STRING_TO_ULINT(RecvStringDat);
Operating := FALSE;
END_IF;
IF (SerialRcv_instance.Error = TRUE) THEN
//Processing at error end
Operating := FALSE;
END_IF;
END_IF;
6-20
//Instance initialization
//Port specification
//Receive data size
//Receive data
//Size of actually received data
//Serial Communications Unit, Unit number 0
//Serial port 2
//Start condition
//Port specification
//Receive data size
//Receive data
//Size of actually received data
CJ-series Serial Communications Units Operation Manual for NJ-series CPU Unit(W494)
codes to character string
//Conversion of character
string to integer

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cj1w-scu22Cj1w-scu42

Table of Contents