Omron K6CM User Manual page 233

Motor condition
Hide thumbs Also See for K6CM:
Table of Contents

Advertisement

IF ( bExecute[ iWk1 ] = TRUE ) THEN
// off the execute flag temporarily
bExecute[ iWk1 ] := FALSE;
IF ( iRetryCnt[ iSelectableUNIT[ iWk1 ] ] >= iRetryValue ) THEN // when retry over
IF (bInitUnitConf = TRUE) THEN
bEnable[ iSelectableUNIT[ iWk1 ] ] := FALSE; // disable the node if retry over at the first collectio
END_IF;
iStatus[ iSelectableUNIT[ iWk1 ] ] := UINT#4;
ELSE
iRetryCnt[ iSelectableUNIT[ iWk1 ] ] := iRetryCnt[ iSelectableUNIT[ iWk1 ] ] + UINT#1; // add count of retry
END_IF;
END_IF;
END_IF;
// when successful completion with flag unhandled
IF ( iStatus[ iSelectableUNIT[ iWk1 ] ] = UINT#3 ) THEN
IF ( bExecute[ iWk1 ] = TRUE ) THEN
// off the execute flag temporarily
bExecute[ iWk1 ] := FALSE;
// if product code is not applicable units, remove it as object of execution
IF (bInitUnitConf = TRUE) THEN
IF (iProCode[ iSelectableUNIT[ iWk1 ] ] = UINT#0) THEN
bEnable[ iSelectableUNIT[ iWk1 ] ] := FALSE;
END_IF;
END_IF;
END_IF;
END_IF;
END_FOR;
// setting of bExecute
FOR iWk1 := UINT#0 TO iNumOfParallel - UINT#1 BY UINT#1 DO
// raise the flag of FB execution if untreated and effective status
IF ( iStatus[ iSelectableUNIT[ iWk1 ] ] = UINT#0 AND bEnable[ iSelectableUNIT[ iWk1 ] ] = TRUE) THEN
IF ( bExecute[ iWk1 ] = FALSE ) THEN
bExecute[ iWk1 ] := TRUE;
END_IF;
END_IF;
END_FOR;
// finish data collecting (= begin CSV making) if all units are successful completion or retry over
FOR iWk1 := UINT#0 TO iNumOfUnits - UINT#1 BY UINT#1 DO
IF ( bEnable[ iWk1 ] = TRUE ) AND ( iStatus[ iWk1 ] <= UINT#2 ) THEN
EXIT;
END_IF;
END_FOR;
IF ( iWk1 = iNumOfUnits ) THEN
bCollecting := FALSE;
END_IF;
END_IF;
// K6CM data collection FB execution
FOR iWk1 := UINT#0 TO iNumOfParallel - UINT#1 BY UINT#1 DO
insK6CM_Read[ iWk1 ](
Execute := bExecute[ iWk1 ],
IPAddress := sIPAddress[ iSelectableUNIT[ iWk1 ] ],
TimeOut := iCIPTimeOut,
Done => bDone[ iWk1 ],
Busy => bBusy[ iWk1 ],
Error => bError[ iWk1 ],
ErrorID => wErrID[ iSelectableUNIT[ iWk1 ] ],
ErrorIDEx => dwErrIDEx[ iSelectableUNIT[ iWk1 ] ],
ProductCode => iProCodeWk,
RespServiceDat => stRespServiceDat[ iSelectableUNIT[ iWk1 ] ] );
// status setting along result of FB execution
// executing
IF ( bBusy[ iWk1 ] = TRUE ) THEN
iStatus[ iSelectableUNIT[ iWk1 ] ] := UINT#1;
END_IF;
// successful completion
IF ( bDone[ iWk1 ] = TRUE ) THEN
iStatus[ iSelectableUNIT[ iWk1 ] ] := UINT#3;
IF (bInitUnitConf = TRUE) THEN
iProCode[ iSelectableUNIT[ iWk1 ] ] := iProCodeWk;
END_IF;
END_IF;
// abnormal completion
IF ( bError[ iWk1 ] = TRUE ) THEN
iStatus[ iSelectableUNIT[ iWk1 ] ] := UINT#2;
END_IF;
END_FOR;
// data collection complete of all units --> raise the flag of CSV output
insF_TRIG( Clk := bCollecting, Q => bCollecting_pls );
IF ( bCollecting_pls = TRUE ) THEN
bOutput := TRUE;
iOutputSeq := UINT#0;
END_IF;
// output the data headers to CSV
IF ( bOutput = TRUE ) AND ( bInitUnitConf = FALSE ) THEN
CASE iOutputSeq OF
// instance initialization
UINT#0:
insFileOpen( Execute := FALSE );
insFilePuts( Execute := FALSE );
insFileClose( Execute := FALSE );
IF bCollecting = FALSE THEN
iOutputSeq := UINT#1;
END_IF;
For the subsequent codes, refer to the actual sample program.
K6CM Motor Condition Monitoring Device User's Manual (N219)
8 Monitoring and Setting Using the EtherNet/IP Devices
In accordance with the above status processing result, the K6CM-dedicated
FB is called for each device.
The collected data is stored in stRespServiceDat.
From here on, it is CSV file output processing.
8
8 - 43

Advertisement

Table of Contents
loading

This manual is also suitable for:

K6cm-ismK6cm-cimK6cm-vbmK6cm-ci2m

Table of Contents