PLC-API stParams : parameter structure of the setpoint generator. This consists of the following elements: TYPE ST_CTRL_RAMP_GENERATOR_PARAMS : STRUCT tTaskCycleTime : TIME; (* task cycle time [TIME] *) tCtrlCycleTime : TIME; (* controller cycle time [TIME] *) fStartPos : LREAL; fStartVelo : LREAL; fVelocity : LREAL; (* >= 0.0 *) fTargetPos : LREAL; fTargetVelo : LREAL; fAcceleration : LREAL; (* > 0.0 *) fDeceleration : LREAL; (* > 0.0 *) eNewParameterType : E_CTRL_NEW_PARAMETER_TYPE; END_TYPE tCtrlCycleTime : cycle time with which the control loop is processed. This must be greater than or equal to the TaskCycleTime.
The function block uses this input value to calculate internally whether the state and the output values have to be updated in the current cycle. tTaskCycleTime : cycle time with which the function block is called. If the function block is called in every task cycle this corresponds to the task cycle time of the calling task. fStartPos : start position for the motion profile. fStartVelo : start velocity of the motion profile. fVelocity : velocity in units/second. fTargetPos : target position for the motion profile. fTargetVelo : target velocity of the motion profile.
Note The target velocity is retained when the target position has been reached (the bDone flag is set), but after this point the position is no longer calculated (constant position at velocity ≠ 0.0). fAcceleration : acceleration in units / second 2 . fDeceleration : deceleration in units / second 2 . eNewParameterType : TYPE E_CTRL_NEW_PARAMETER_TYPE : ( eCTRL_NEW_PARAMETER_TYPE_NotInstant := 0, eCTRL_NEW_PARAMETER_TYPE_Instant := 1 ); END_TYPE eCTRL_NEW_PARAMETER_TYPE_Instant : when a restart instruction is issued with a new parameter set, the new set is adopted immediately.
In other words a transition from the current state of movement to the data represented by the new parameter set is calculated, and the old parameters are discarded. eCTRL_NEW_PARAMETER_TYPE_NotInstant : when a restart instruction is issued with a new parameter set, the new set is not adopted immediately. In other words the current movement is first executed to completion, after which positioning to the new target is carried out with the new parameters. A TRUE at the bCommandBuffered output indicates that a non-instantaneous restart instruction is stored. An order that has already been stored can be overwritten or deleted by a further new, non-instantaneous parameter set.
Positioning examples TS4100 142 Version: 1.1 Positioning example 1: stParams.fStartPos := -500.0; stParams.fTargetPos := 2500.0; stParams.fStartVelo := 0.0; stParams.fVelocity := 1000.0; stParams.fTargetVelo := 0.0; stParams.fAcceleration := 1000.0; stParams.fDeceleration := 2000.0; fOverride := 100.0;