MC_Jog
The MC_Jog function block enables an axis to be moved via manual keys. The key signal can be linked directly with the JogForward and JogBackwards inputs. The required operating mode is specified via the mode input. An inching mode for moving the axis by a specified distance whenever the key is pressed is also available. The velocity and dynamics of the motion can be specified depending on the mode.
VAR_INPUT
VAR_INPUT
JogForward : BOOL;
JogBackwards : BOOL;
Mode : E_JogMode;
Position : LREAL;
Velocity : LREAL;
Acceleration : LREAL;
Deceleration : LREAL;
Jerk : LREAL;
END_VAR
JogForward : The command is executed with rising edge and the axis moved in positive direction of travel.
Depending on the mode the axis moves as long as the signal remains TRUE or stops automatically after a specified distance. During the motion no further signal edges are accepted (this includes the JogBackwards input). If signal edges occur simultaneously at the JogForward and JogBackwards inputs, JogForward has priority.
JogBackwards : The command is executed with rising edge and the axis moved in negative direction of travel.
JogForward and JogBackwards should be triggered alternatively, although they are also mutually locked internally.
Mode : The mode input specifies the mode for manual operation.
MC_JOGMODE_STANDARD_SLOW
The axis moves as long as the signal at one of the jog inputs is TRUE. The low velocity for manual functions specified in the TwinCAT System Manager and standard dynamics are used. In this mode the position, velocity and dynamics data specified in the function block have no effect.
MC_JOGMODE_STANDARD_FAST
The axis moves as long as the signal at one of the jog inputs is TRUE. The high velocity for manual functions specified in the TwinCAT System Manager and standard dynamics are used. In this mode the position, velocity and dynamics data specified in the function block have no effect.
MC_JOGMODE_CONTINOUS
The axis moves as long as the signal at one of the jog inputs is TRUE. The velocity and dynamics data specified by the user are used. The position has no effect.
MC_JOGMODE_INCHING
With rising edge at one of the jog inputs the axis is moved by a certain distance which is specified via the position input. The axis stop automatically, irrespective of the state of the jog inputs. A new movement step is only executed once a further rising edge is encountered. With each start the velocity and dynamics data specified by the user are used.
Position : Relative distance for movements in MC_JOGMODE_INCHING mode.
Velocity : Maximum travel velocity (>0).
Acceleration : Acceleration (=0). If the value is 0, the standard acceleration from the axis configuration in the System Manager is used.
Deceleration : Deceleration (=0). If the value is 0, the standard deceleration from the axis configuration in the System Manager is used.
Jerk : Jerk (=0). If the value is 0, the standard jerk from the axis configuration in the System Manager is used.
Note:
The parameters Position, Velocity, Acceleration, Deceleration and Jerk are not used in the operating modes MC_JOGMODE_STANDARD_SLOW and MC_JOGMODE_STANDARD_FAST and do not have to be specified.
VAR_OUTPUT
VAR_OUTPUT
Done : BOOL;
Busy : BOOL;
CommandAborted : BOOL;
Error : BOOL;
ErrorID : UDINT;
END_VAR
Done : Becomes TRUE if a movement is completed successfully.
Busy : Becomes TRUE as soon as the function block is active, and becomes FALSE when it has returned to its initial state. Only then can a further edge be accepted at the jog inputs.
CommandAborted : Becomes TRUE, if the command could not be fully executed. The reason may be a stop command.
Error: Becomes TRUE, as soon as an error occurs.
ErrorID : Supplies the error number when the Error output is set.
VAR_IN_OUT
VAR_IN_OUT
Axis : NCTOPLC_AXLESTRUCT;
END_VAR
Axis : Axis structure.
Requirements
Development environment | Target system type | PLC libraries to be linked |
---|---|---|
TwinCAT v2.10 from build 1303 | PC (i386) | TcMC.Lib |