9 "SINAMICS V90 PN” Demo Case
9.3 Operating the application example
TOs of S7-1500(T)
Entry ID: 109743134, V1.0, 05/2017
Siemens AG 2017 All rights reserved
position of the positioning axis of the material line is transferred as product position
to the data logger of the user program.
The following code section from the "GetMeasuringInput” function block shows the
real data logging via the "MC_MeasuringInput” instruction.
//+++ Call function block +++
#instMeasuringInput(MeasuringInput:=#MeasuringInput,
Execute:=(#FunctionEnable AND
NOT(#instMeasuringInput.Done)),
Mode:=0);
//+++ Realize machine function +++
IF (#instMeasuringInput.Done = True)
THEN
//Get actual write index
#tempWriteIndex :=
#ProductPositionTable.WriteIndex_MeasuringInput;
//Save measured position of product on product belt
#ProductPositionTable.PositionTable[#tempWriteIndex] :=
#instMeasuringInput.MeasuredValue1;
//Generate next write index (write pointer)
//Incement index pointer
#tempWriteIndex := #tempWriteIndex + 1;
//Check modulo area of index pointer
IF (#tempWriteIndex > #ProductPositionTable.MaxIndex)
THEN
#tempWriteIndex := #ProductPositionTable.MinIndex;
END_IF;
//Write back index pointer
#ProductPositionTable.WriteIndex_MeasuringInput :=
#tempWriteIndex;
END_IF;
//+++ Output singals +++
#NewProductDetected := #instMeasuringInput.Done;
Due to the real measurement via the TM Timer technology module, it has to be
done without a display of the products on the material line in front of the
measuring input in the example application of the "SINAMICS V90 PN” demo
case.
As soon as the measurement of the product position is triggered via the S15
toggle switch, can the product be displayed on the user interface.