PLC API 6.8 FB_SimPosMotor Position-controlled simulation motor. This simulation motor travels automatically to the entered target position with a ramped velocity profile. The target position 'fTargetPosition' is transferred to 'bSet' with a rising edge. In addition to the present position, the current velocity and acceleration can be accessed at the outputs. VAR_INPUT VAR_INPUT bRun : BOOL; (* Motor running *) bSet : BOOL; (* Acitvates the move command *) fTargetPosition : REAL; (* Target Position ~(EUnit:mm)*) fMaxVelocity : REAL := 1000;(* Maximal Velocity ~(EUnit:m/s)*) fMaxAcceleration : REAL := 100; (* Maximal Acceleration ~(EUnit:mm/s^2*) END_VAR bRun :
Activates the simulation motor bSet : Adoption of maximum velocity and target position on rising edge fTargetPosition : Target position in mm fMaxVelocity : Maximum velocity in mm/s fMaxAcceleration : Max. acceleration in mm/s^2 VAR_OUTPUT VAR_OUTPUT fPosition : REAL := 0.0; (* Current position ~(EUnit:mm)*) bPositionReached : BOOL := TRUE; (* Position reached *) fVelocity : REAL := 0.0; (* Current velocity ~(EUnit:mm/s)*) fAcceleration : REAL := 0.0; (* Current acceleration ~(EUnit:mm/s^2)*) END_VAR fPosition : Current position in mm bPositionReached : TRUE when the pre-assigned position is reached fVelocity : Current velocity in mm/s fAcceleration :
Current acceleration in mm/s^2 TS1110 63 Version: 1.0 Development Environment Target System PLC Libraries to include (Standard.Lib; TcBase.Lib; TcSystem.Lib are included automatically)