Sample Programming
(* ---------------------------------------------------------------------------------------------------------------------
-
Change the variable Warning to TRUE when the Spool usage of the DB Connection named MyDababase1 has exceeded 80%.
--------------------------------------------------------------------------------------------------------------------- *)
// Start the sequence when the variable Trigger changes to TRUE.
IF ( (Trigger=TRUE) AND (LastTrigger=FALSE) ) THEN
OperatingStart := TRUE;
Operating := TRUE;
END_IF;
LastTrigger := Trigger;
// Sequence start processing
IF (OperatingStart=TRUE) THEN
// Initialize the instruction instance.
DB_GetConnectionStatus_instance( Execute:=FALSE );
OperatingStart := FALSE;
END_IF;
IF (Operating=TRUE) THEN
// Get the status of the DB Connection.
DB_GetConnectionStatus_instance(
Execute := TRUE,
DBConnectionName := 'MyDatabase1',
ConnectionStatus => MyStatus
);
IF (DB_GetConnectionStatus_instance.Done=TRUE) THEN
// Normal end processing
// Change the variable Warning to TRUE when the Spool usage has exceeded 80%.
IF (MyStatus.SpoolUsageRate > SINT#80) THEN
Warning := TRUE;
END_IF;
Operating := FALSE;
END_IF;
IF (DB_GetConnectionStatus_instance.Error=TRUE) THEN
// Error handler
Operating := FALSE;
END_IF;
END_IF;