MC_Jog

MC_Jog 1:

The function block MC_Jog enables an axis to be moved via manual keys. The key signal can be linked directly with the "JogForward" and "JogBackwards" inputs. The required operation 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 operation mode.

MC_Jog 2: Inputs

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

Name

Type

Description

JogForward

BOOL

The command is executed with a rising edge, and the axis is moved in positive direction of travel. Depending on the operation mode (see "Mode" input), 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 a simultaneous signal edge occurs at the inputs "JogForward" and "JogBackwards", "JogForward" has priority.

JogBackwards

BOOL

The command is executed with a rising edge, and the axis is moved in negative direction of travel. "JogForward" and "JogBackwards" should be triggered alternatively, although they are also mutually locked internally.

Mode

E_JogMode

Determines the operation mode in which the manual function is executed.

  • 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 operation mode the position, velocity and dynamics data specified in the function block have no effect.
  • MC_JOGMODE_CONTINUOUS
    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 a 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 a rising edge at one of the jog inputs the axis is moved by a certain distance which is specified via the "Positions" 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

LREAL

Relative distance for movements in MC_JOGMODE_INCHING operation mode.

Velocity

LREAL

Maximum travel velocity (>0).

Acceleration

LREAL

Acceleration (≥0). If the value is 0, the standard acceleration from the axis configuration in the System Manager is used.

Deceleration

LREAL

Deceleration (≥0). If the value is 0, the standard deceleration from the axis configuration in the System Manager is used.

Jerk

LREAL

Jerk (≥0). At a value of 0, the standard jerk from the axis configuration in the System Manager is applied.

MC_Jog 3:

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.

MC_Jog 4: Inputs/outputs

VAR_IN_OUT
    Axis : AXIS_REF;
END_VAR

Name

Type

Description

Axis

AXIS_REF

Axis data structure that unambiguously addresses an axis in the system. Among other parameters it contains the current axis status, including position, velocity or error state.

MC_Jog 5: Outputs

VAR_OUTPUT
    Done           : BOOL;
    Busy           : BOOL;
    CommandAborted : BOOL;
    Error          : BOOL;
    ErrorID        : UDINT;
END_VAR

Name

Type

Description

Done

BOOL

TRUE if a movement was successfully completed.

Busy

BOOL

TRUE as soon as the function block is active. FALSE if it is in the default state. Only then can a further edge be accepted at the jog inputs.

Active

BOOL

Indicates that the axis is moved via the jog function.

CommandAborted

BOOL

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

Error

BOOL

TRUE, if an error occurs.

ErrorID

UDINT

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

Requirements

Development environment

Target system type

PLC libraries to include

TwinCAT v3.0.0

PC or CX (x86 or x64)

Tc2_MC2