MC_Jog
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.
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 | Determines the operation mode in which the manual function is executed.
| |
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. |
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. |
Inputs/outputs
VAR_IN_OUT
Axis : AXIS_REF;
END_VAR
Name | Type | Description |
---|---|---|
Axis | 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. |
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 |