• 沒有找到結果。

MC_MoveVelocity

Name Meaning Data type Valid range

De-fault Description

BufferMode Buffer Mode Selection

_eMC_BUF-FER_MODE

0: _mcAborting 1: _mcBuffered

0 *2 Specify the behavior when exe-cuting more than one motion in-struction.

0: Aborting 1: Buffered Continuous

(Reserved)

Continua-tion Mode Selection

BOOL TRUE or FALSE FALSE (Reserved)

*1. Refer to Unit Conversion Settings in the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat. No. W507) for information on command units.

*2. The default value for an enumeration variable is actually not the number, but the enumerator.

Output Variables

Name Meaning Data

type

Valid

range Description

InVelocity Target Velocity Reached

BOOL TRUE or

FALSE

TRUE when the target velocity is reached.

Busy Executing BOOL TRUE or

FALSE

TRUE when the instruction is acknowledged.

Active Controlling BOOL TRUE or

FALSE

TRUE when the axis is being controlled.

CommandAborted Command Aborted

BOOL TRUE or

FALSE

TRUE when the instruction is aborted.

Error Error BOOL TRUE or

FALSE

TRUE while there is an error.

ErrorID Error Code WORD *1 Contains the error code when an error occurs. A value of 16#0000 indicates normal execution.

*1. The upper four digits of the event code give the error code for ErrorID. Refer to the NJ/NX-series Troubleshooting Manual (Cat. No. W503) for the event codes.

 Output Variable Update Timing

Name Timing for changing to TRUE Timing for changing to FALSE

InVelocity When the target velocity is reached.

When Error changes to TRUE.

When CommandAborted changes to TRUE.

When the instruction is re-executed and the target velocity is changed.

Busy When Execute changes to TRUE.

When Error changes to TRUE.

When CommandAborted changes to TRUE.

Active When the instruction is started.

When Error changes to TRUE.

When CommandAborted changes to TRUE.

Name Timing for changing to TRUE Timing for changing to FALSE CommandAborted

When this instruction is aborted because

an-other motion control instruction was executed with the Buffer Mode set to Aborting or Buffered.

When this instruction is canceled due to an error.

When this instruction is executed while there is an error.

When you start this instruction during MC_Stop instruction execution.

When Execute is TRUE and changes to FALSE.

After one period when Execute is FALSE.

Error When there is an error in the execution condi-tions or input parameters for the instruction.

When the error is cleared.

In-Out Variables

Name Meaning Data type Valid

range Description

Axis Axis _sAXIS_REF --- Specifies the axis. *1

*1. Specify a user-defined Axis Variable that was created in the Axis Basic Settings of the Sysmac Studio (default: MC_Ax-is*) or a system-defined axis variable name (_MC_AX[*], _MC1_AX[*], or _MC2_AX[*]).

If you use Sysmac Studio version 1.29 or higher, you can specify the system-defined axis variable name for AT specifi-cation of a user-defined variable. This will allow you to specify the user-defined variable.

If you use Sysmac Studio version 1.28 or lower, do not specify any user-defined variable created in the variable table.

Function

• Pseudo velocity control is performed with position control.

• The velocity control operation starts when Execute changes to TRUE.

Instruction Details

This section describes the instruction in detail.

 Direction

• Specify the travel direction with Direction.

• When Direction specifies 0: _mcPositiveDirection (Positive direction), the axis moves in the posi-tive direction. When it specifies 2: _mcNegaposi-tiveDirection (Negaposi-tive direction), the axis moves in the negative direction.

• When Direction specifies 3: _mcCurrentDirection (Current direction), the axis motion depends on whether the axis is stopped or not. If the axis is stopped, it will move in the direction in which it was traveling previously. If the power is turned ON or after restarting, the axis moves in the positive di-rection.

If you execute this instruction during multi-execution of motion control instructions for the axis, the axis will move in the direction that it is currently traveling.

MC_MoveVelocity

3

Function

Precautions for Correct Use

If 3: _mcCurrentDirection (Current direction) is specified for Direction, operation is in the same command direction as the previous motion. Therefore, depending on the instructions that are used together, the direction may not be the same as the direction that was specified with the input to the motion control instruction for the previous motion.

When you specify 3: _mcCurrentDirection (Current direction), check the current direction with Dir.Posi (Positive Direction) and Dir.Nega (Negative Direction) in the Axis Variable.

Timing Charts

• Busy (Executing) changes to TRUE at the same time as Execute changes to TRUE. Active (Control-ling) changes to TRUE in the next period.

• InVelocity (Target Velocity Reached) changes to TRUE when Velocity (Target Velocity) is reached.

• If another instruction aborts this instruction, CommandAborted changes to TRUE and Busy (Execut-ing), Active (Controll(Execut-ing), and InVelocity (Target Velocity Reached) change to FALSE.

Time Decelerates to a stop

when another instruction causes an error.

Target velocity Velocity Busy

CommandAborted InVelocity

Error

16#0000 ErrorID

Execute

Active

The InVelocity (Target Velocity Reached) output variable indicates when the velocity has reached the same velocity for this instruction and the re-executed motion control instruction. Therefore, after InVelocity (Target Velocity Reached) changes to TRUE, even if the velocity is changed by the override factor, InVelocity (Target Velocity Reached) will not change to FALSE.

If the override factor changes before InVelocity (Target Velocity Reached) changes to TRUE, InVelocity (Target Velocity Reached) will change to TRUE when the new target velocity is reached.

You can specify Acceleration (Acceleration Rate), Deceleration (Deceleration Rate) and Jerk as input variables.

When the Velocity (Target Velocity) is 0 and the instruction is executed, the axis will enter continuous operation without motion.

The following chart shows an operation example of when Velocity (Target Velocity) is 0.

Busy

CommandAborted InVelocity

Error

16#0000 ErrorID

Execute

Active

Target velocity Time Velocity

When the Acceleration (Acceleration Rate) or Deceleration (Deceleration Rate) is 0 and the instruction is executed, the axis will reach the target velocity without accelerating or decelerating.

The following chart shows an operation example of when the Acceleration (Acceleration Rate) is 0.

0 Velocity

Time Target

velocity

Specify Jerk when you want to accelerate or decelerate smoothly.

The following chart shows an operation example when Jerk is specified.

0 Velocity

Time Target

velocity

For details on Jerk, refer to the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat. No.

W507).

Re-execution of Motion Control Instructions

You can change the operation of the instruction if you change an input parameter during continuous operation and then change Execute to TRUE again.

Input variables Velocity (Target Velocity), Acceleration (Acceleration Rate), and Deceleration (Deceler-ation Rate) can be changed by re-executing the motion control instruction.

MC_MoveVelocity

3

Function

When Velocity (Target Velocity) is changed by re-executing a motion control instruction, InVelocity (Target Velocity Reached) operates for the new target velocity that was set at re-execution.

For details on re-execution of motion control instructions, refer to the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat. No. W507).

Multi-execution of Motion Control Instructions

For details on multi-execution of motion control instructions, refer to the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat. No. W507).

 Execution during Execution of Other Instructions

You can switch to this instruction or buffer this instruction if you execute it during execution of another instruction.

You can buffer one instruction per axis.

Specify the operation of this instruction using BufferMode (Buffer Mode Selection) for multi-execution of instructions.

Buffer Mode

Selec-tion Description

Aborting Aborts the instruction being executed and switches to this instruction.

If the direction of axis motion is reversed by switching instructions, the motion will be re-versed according to the Operation Selection at Reversing axis parameter.

Buffered Buffers this instruction and executes it automatically after the current instruction is com-pleted.

For details on BufferMode (Buffer Mode Selection), refer to the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat. No. W507).

 Execution of Other Instructions during Instruction Execution

If another instruction is executed during execution of this instruction, the BufferMode input variable to the other instruction must be set to Aborting or Buffered.

If you specify Buffered, the buffered instruction is executed when the InVelocity (Target Velocity