In this example the function has been programmed in ladder diagram (LD) and structured text (ST).
Example
The same POU header is used for all programming languages.
DUT
The DUT F171_PulseOutput_Trapezoidal_DUT is predefined in the FP Library.
POU header
All input and output variables used for programming this function have been declared in the POU
header.
LD
ST
When programming with structured text, enter the following:
IF
DF(bMotorSwitch)
dutTrapez.diInitialAndFinalSpeed:=diInitialSpeed;
dutTrapez.diTargetSpeed:=diTargetSpeed;
dutTrapez.diAccelerationDecelerationTime:=diAccelerationTime;
dutTrapez.diDeviationCounterClearSignalOutputTime:=10;
END_IF;
IF
DF(bMotorSwitch)
F171_PulseOutput_Trapezoidal(s_dutDataTable
n_iPulseOutputChannel
END_IF;
THEN
THEN
:= 0);
Pulse output instructions
:= dutTrapez,
1051