8 Example Application
8.3 Programming of the processing stations
//Check modulo area of index pointer
IF (#tempReadIndex > #ProductPositionTable.MaxIndex)
THEN
#tempReadIndex := #ProductPositionTable.MinIndex;
END_IF;
//Write back index pointer
#ProductPositionTable.ReadIndex_SynchronousOperation :=
//Set output signals
#statBusy := False;
#statError := False;
#statErrorId := #ERRORID_DEFAULT;
If an error occurred during the execution of the function or the technology function
was replaced by another technology function, the error will be detected and passed
on to the outputs of the function block.
//Check error of synchronous operation/movement
ELSIF (((#instMcCamIn.Error = TRUE)
OR (#instMcCamIn.CommandAborted = True))
AND
(#statExecute = True))
THEN
//Save error id
IF (#instMcCamIn.CommandAborted = True)
THEN
//No error id is set by the function block
#statErrorId := #ERRORID_COMMAND_ABORTED;
ELSE
//Save error id of the function block
#statErrorId := #instMcCamIn.ErrorId;
END_IF;
//Set output signals
#statBusy := False;
#statError := True;
//Stop execution of function block
#statExecute := False;
END_IF;
Subsequently, the following technology functions are called with preset
parameters:
"MC_InterpolateCam"
The cam disc is only interpolated if has not yet been interpolated.
TOs of S7-1500(T)
Entry ID: 109743134,
V1.0,
05/2017
#tempReadIndex;
42