Omron NX701-1620 User Manual page 239

Machine automation controller nj/nx-series database connection cpu units
Hide thumbs Also See for NX701-1620:
Table of Contents

Advertisement

// Retrieve the records from the DB Connection MyDB1. Timeout is not monitored for the instruction execution.
IF (Operating_Select=TRUE) THEN
// Retrieve records.
DB_Select_instance(
Execute
:= TRUE,
DBConnection
:= MyDB1,
Where
:= WhereCond_Select,
Sort
:= SortCond_Select,
MapVar
:= MapVar_Select
);
IF (DB_Select_instance.Done=TRUE) THEN
// If two or more records were retrieved, delete the older records.
IF (DB_Select_instance.SelectedCnt > 1) THEN
Request_Delete := TRUE;
END_IF;
Operating_Select:=FALSE; // Normal end
END_IF;
IF (DB_Select_instance.Error=TRUE) THEN
// Error handler.
// Program the error handler (FaultHandler_Select) according to the device.
FaultHandler_Select();
Operating_Select := FALSE;
END_IF;
END_IF;
// ---------------------------------------------------------------------------------------------------------------------
// - Delete the records other than the latest one from the DB table.
// Start the sequence when the variable Trigger_Delete changes to TRUE.
IF ( (Request_Delete=TRUE) AND (LastRequest_Delete=FALSE) ) THEN
OperatingStart_Delete := TRUE;
Operating_Delete := TRUE;
END_IF;
LastRequest_Delete := Request_Delete;
// Sequence start processing
IF (OperatingStart_Delete=TRUE) THEN
// Initialize the instance of the applicable DB Connection Instruction.
DB_Delete_instance( Execute:=FALSE );
// Create the conditions for the Where clause (delete the records other than the latest one).
WhereCond_Delete := CONCAT( '"LotNo" = $'',
NJ/NX-series Database Connection CPU Units User's Manual (W527)
UINT_TO_STRING( LotNo ),
'$' AND "FinishTime" < TO_TIMESTAMP($'',
DtToString( MapVar_Select[0].FinishTime),
'$',$'YYYY-MM-DD-HH24:MI:SS.FF9$')'
Appendix A
A
A-51

Advertisement

Table of Contents

Troubleshooting

loading

Table of Contents