Appendix A
A-45
A
NJ/NX-series Database Connection CPU Units User’s Manual (W527)
DB_Delete (Delete DB Record)
- Retrieve records for the specified lot number from the DB Connection MyDB1 when the variable Trigger_Select changes to TRUE.
Check the completion of the DB_Select instruction.
Accept the trigger for retrieving DB records.
Create the conditions for the Where and Sort clauses.
// Create the conditions for Where clause ("LotNo" = XXXX)
WhereCond_Select := CONCAT( '"LotNo" = $'', UINT_TO_STRING( LotNo ), '$'' );
// Create the conditions for Sort clause
// Sort the production completion time in descending order
SortCond_Select := '"FinishTime" DESC';
Retrieve the records from the DB Connection MyDB1.
Timeout is not monitored for the instruction execution.
MyDB1
WhereCond_Select
SortCond_Select
T#0ms
MapVar_Select
Execute
DBConnection
Where
Sort
TimeOut
MapVar
Done
Busy
Error
ErrorID
RecCnt
SelectedCnt
When the instruction is terminated due to an error, execute the error handler for the device (FaultHandler_Select).
Program the FaultHandler_Select according to the device.
If two or more records were retrieved, delete the records other than the latest one.
//
Normal end processing
IF DB_Select_instance.SelectedCnt > 1 THEN
Request_Delete := TRUE;
END_IF;
DB Connection Instructions