Appendix A
A-33
A
NJ/NX-series Database Connection CPU Units User’s Manual (W527)
IF (DB_Update_instance.Error=TRUE) THEN
// Go to the next step when the instruction is not completed within the specified time.
IF (DB_Update_instance.ErrorID = 16#3012) THEN
Operating_Update:=FALSE; // Normal end
ELSE
// Execute the error handler.
// Implement the error handler (FaultHandler_Update) according to the device.
FaultHandler_Update();
Operating_Update := FALSE;
END_IF;
END_IF;
END_IF;
// ---------------------------------------------------------------------------------------------------------------------
// - Close the DB Connection “MyDB1”.
// Start the sequence when the variable Trigger_Close changes to TRUE.
IF ( (Trigger_Close=TRUE) AND (LastTrigger_Close=FALSE) ) THEN
OperatingStart_Close := TRUE;
Operating_Close := TRUE;
END_IF;
LastTrigger_Close := Trigger_Close;
// Sequence start processing
IF (OperatingStart_Close=TRUE) THEN
// Initialize the instance of the applicable DB Connection Instruction.
DB_Close_instance( Execute:=FALSE );
OperatingStart_Close := FALSE;
END_IF;
// Close the DB Connection “MyDB1”.
IF (Operating_Close=TRUE) THEN
// Close the DB Connection.
DB_Close_instance( Execute:=TRUE, DBConnection:=MyDB1 );
IF (DB_Close_instance.Done=TRUE) THEN
Operating_Close := FALSE; // Normal end
END_IF;
IF (DB_Close_instance.Error=TRUE) THEN
// Execute the error handler.
// Program the error handler (FaultHandler_Close) according to the device.
FaultHandler_Close();
Operating_Close := FALSE;
END_IF;
END_IF;