MC_Jog

MC_Jog 1:

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.

Inputs

VAR_INPUT
JogForward : BOOL;
JogBackwards : BOOL;
Mode : E_JogMode;
Position : LREAL;
Velocity : LREAL;
Acceleration : LREAL;
Deceleration : LREAL;
Jerk : LREAL;
END_VAR

E_JogMode

JogForward

The command is executed with rising edge, and the axis is moved in positive direction of travel. Depending on the operation mode (see mode), the axis moves as long as the signal remains TRUE, or it 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 operation 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 is moved 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 stops 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. MC_JOGMODE_INCHING_MODULO:
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 position will snap to an integer multiple of the position parameter. The axis stops 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 operation 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.

MC_Jog 2:

The parameters Position, Velocity, Acceleration, Deceleration and Jerk are not used in the operation modes MC_JOGMODE_STANDARD_SLOW and MC_JOGMODE_STANDARD_FAST and can remain unassigned.

Outputs

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.

Active

Active indicates that the axis is moved via the jog function.

CommandAborted

Becomes TRUE if the process is interrupted by an external event, e.g. by the call up of MC_Stop.

Error

Becomes TRUE if an error occurs.

ErrorID

If the error output is set, this parameter supplies the error number.

Inputs/outputs


VAR_IN_OUT
Axis : AXIS_REF;
END_VAR

AXIS_REF

Axis

Axis data structure

The axis data structure of type AXIS_REF addresses an axis unambiguously within the system. Among other parameters it contains the current axis status, including position, velocity or error state.