Sample Programming
(* -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- Record the log code 100, log name Production Order, and log message Production Start, RecipeCode=12345678 into the Execution Log.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- *)
// 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_PutLog_instance( Execute:=FALSE );
// Create the log message.
Msg := CONCAT('Production Start,RecipeCode=',UDINT_TO_STRING(RecipeCode));
OperatingStart := FALSE;
END_IF;
IF (Operating=TRUE) THEN
// Record the log message into the Execution Log.
DB_PutLog_instance(
Execute := TRUE,
LogType := _DBC_LOGTYPE_EXECUTION,
LogCode := 100,
LogName := 'Production Order',
LogMsg := Msg );
IF (DB_PutLog_instance.Done=TRUE) THEN
// Normal end processing
Operating := FALSE;