Mitsubishi Electric MELSEC-Q-MR-JE-C Reference Manual

PLCopen Motion Control Function Block Reference
-MR-JE-C

CONTENTS

CHAPTER 1 OVERVIEW 3
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3
1.3 System Configuration Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3
1.4 Relevant Manuals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.5 Notes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
CHAPTER 2 FUNCTION DESCRIPTION 6
2.1 Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6
2.2 Program Details (Sample/PrgAxis1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.3 FB Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Data communication method. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
CC-Link IE Field Network Basic setting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12
2.4 How to Use FB Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15
Saving the user library. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Installing the user library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17
CHAPTER 3 FB LIBRARY 19
3.1 Function Overview of the FB Library. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19
List of FBs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19
Restrictions and precautions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
FB status diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .20
Unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21
Link device. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22
3.2 Details of the FB Library. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23
MC_Power (Operation Possible). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23
MCv_Home (Home Position Return). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25
MC_Stop (Forced Stop). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27
MC_Halt (Stop) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .29
MC_MoveAbsolute (Absolute Value Positioning) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32
MC_MoveRelative (Relative Value Positioning) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .34
MC_MoveAdditive (Commanded Position Change) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36
MC_MoveVelocity (Velocity Control) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
MC_TorqueControl (Torque Control). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41
MC_ReadActualPosition (Current Position Read). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .44
MC_ReadActualVelocity (Current Velocity Read) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .46
MC_ReadActualTorque (Current Torque Read) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .48
MC_ReadStatus (Status Read) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50
MC_ReadAxisInfo (Axis Information Read). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .53
MC_ReadAxisError (Axis Error Read). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55
MC_Reset (Axis Error Reset) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
3.3 List of Structures. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .59
AXIS_REF_JEC (Axis information) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .59
3.4 List of Global Labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
MC_DIRECTION (Direction Selection) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60
3.5 Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
List of error codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
CONTENTS
1
INSTRUCTION INDEX 63
REVISIONS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .65
TRADEMARKS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .66
2
1 OVERVIEW
1.1 Introduction
This function block (FB) library is used in a system in which the CC-Link IE Field Network Basic compatible MELSEC-Q series QnUDVCPU module and the MR-JE-C servo amplifier are connected. The FBs included in this library operate in the environment in which the profile mode is set as the co ntrol mode of the servo amplifier MR-JE-C. For the profile mode setting, refer to the instruction manual of the servo amplifier in use.

1.2 Applicable Hardware and Software

Applicable hardware and software Description
CPU module MELSEC-Q series CPU module Q**UDVCPU (First five digits of the serial No. are "18112" or later)
* Q06UDVCPU or later is recommended. Slave unit CC-Link IE Field Network Basic compatible MELSERVO-JE servo amplifier MR-JE-C Engineering software MELSOFT GX Works2 of version 1.560J or later

1.3 System Configuration Example

1

1.4 Relevant Manuals

• MR-JE-_C SERVO AMPLIFIER INSTRUCTION MANUAL [SH030257]
• MR-JE-_C SERVO AMPLIFIER INSTRUCTION MANUAL (CC-Link IE Field Network Basic) [SH030256]
• MR-JE-_C SERVO AMPLIFIER INSTRUCTION MANUAL (PROFILE MODE) [SH030254]
• MELSERVO-JE Servo amplifier INSTRUCTION MANUAL (TROUBLE SHOOTING) [SH030166]
• QCPU User's Manual (Hardware Design, Maintenance and Inspection) [SH080483]
• QnUCPU User's Manual (Function Explanation, Program Fundamentals) [SH080807]
• GX Works2 Version1 Operating Manual (Common) [SH080779]

1.1 Introduction

1 OVERVIEW

3
1.5 Notes
This manual describes functions of the function blocks. This manual does not include the information on restrictions for using CPU modules and the combination. Please read the user's manuals of the products before using them. Please note the followings and use the FBs described in this manual.
• When using the FBs in an actual system, confirm that the FBs do not cause system control problems.
• Consider the points where interlock conditions are required in the system and insert interlock conditio ns.
• Mitsubishi Electric Corporation will not compensate any damages caused by the FBs.
• Contents may be deleted or changed without prior notice.
4
1 OVERVIEW

1.5 Notes

MEMO
1
1 OVERVIEW
1.5 Notes
5
2 FUNCTION DESCRIPTION
2.1 Program
This FB library includes the sample programs which can be used in the configuration described in " P a g e 3 System Configuration Example". Each FB operation can be checked with the sample programs.
Program configuration
File name Description Model Engineering environment
MotionControl_JEC_FBs_Q.gxw FBD, ST program QnUDVCPU MELSOFT GX Works2
List of programs
Program name Description Execution type Description method
Sample/PrgAxis1 Each FB execution program axis 1 Scan FBD Sample/PrgAxis2 Each FB execution program axis 2 Scan FBD
FB/FUN
FB name Description Execution type Description method
CCIEFBasicStart Start of cyclic communication of the
specified axis
Scan FBD
Structure
Program name Description
stRemoteRegBasic Device definition of the refresh setting used in the FB library
Global label
Label name Description
G_stLinkBasic Refresh data information used in the FB library Axis1 Axis 1 information Axis2 Axis 2 information
Servo amplifier MR-JE-C parameter
Set the following parameters to the servo amplifier in advance. This sample program is designed not to use the input signals of the servo amplifier. Configure the settings according to safety measures required for system operation.
Parameter Setting detail Axis 1 Axis 2
PA01: Operation mode Profile mode 1009 1009 PD01: I/O signal automatic on
selection 1
Forced stop (automatic on) Forward rotation stroke end (automatic on) Reverse rotation stroke end (automatic on)
1C00 1C00
6

2 FUNCTION DESCRIPTION

2.1 Program

2.2 Program Details (Sample/PrgAxis1)
1. Configure the initial setting for using the FB library.
When the CPU module is switched from STOP to RUN, the axis information (Axis1) is set.
2. Start the cyclic communication of the servo amplifier.
When the CPU module is switched from STOP to RUN, the communication with the specified axis is started.
2
3. Set the servo amplifier in the servo ON status.
When the PowerOn label is turned ON, the specified axis is set in the servo ON status.
4. Execute the home position return.
When the Homing label is turned ON, the home position return is executed.
2 FUNCTION DESCRIPTION

2.2 Program Details (Sample/PrgAxis1)

7
5. Control the velocity and torque.
When the ExecSpeed label is turned ON, the velocity is controlled. When the ExecTorque label is turned ON, the torque is controlled.
6. Stop or forcibly stop the axis.
When the ExecHalt label is turned ON, the specified axis is stopped. When the ExecStop label is turned ON, the specified axis is forcibly stopped.
7. Read the axis error code and reset the error.
When the ReadError label is turned ON, the alarm of the servo amplifiers is read. When the ExecReset label is turned ON, the error is reset. Reset the error after the error cause is eliminated.
8
2 FUNCTION DESCRIPTION
2.2 Program Details (Sample/PrgAxis1)
8. Perform the position control.
When the ExecAbs label is turned ON, the absolute value positioning is performed. When the ExecInc label is turned ON, the relative value positioning is performed. When the ExecAdd label is turned ON, the commanded position is changed.
2
9. Monitor the current position, velocity, and torque.
When the Monitor label is turned ON, monitoring the current position, velocity, and torque is started.
2 FUNCTION DESCRIPTION
2.2 Program Details (Sample/PrgAxis1)
9
10.Monitor the axis information and status.
When the Monitor label is turned ON, monitoring the axis information and status is started.
10
2 FUNCTION DESCRIPTION
2.2 Program Details (Sample/PrgAxis1)
2.3 FB Operation
FB reads the data after the global labels
related to RX and RWr are set.
Write area
QCPU MR-JE-C
Read area
Write area
Device
Link
refresh
FB
MR-JE-C
Device
Write
FB
QCPU
Read area
Read area
Write area
Link
refresh
FB writes the data after the global labels
related to RY and RWw are set.
Read

Data communication method

To control the devices connected with CC-Link IE Field Network Basic, the control information is transmitted to and received from the connected devices though the RX/RY/RWr/RWw register. The FBs described in this manual execute reference and updating of the device specified in the link refresh setting. Defining the contents that the customer sets in the link refresh setting to the global label enables the FBs to access the device specified in the link refresh setting. The data is exchanged between the QCPU and the MR-JE-C in the fixed cycle by using the set device.
2
2 FUNCTION DESCRIPTION

2.3 FB Operation

11

CC-Link IE Field Network Basic setting

This section describes the setting method of the system in which the CC-Link IE Field Network Basic compatible CPU module (QnUDVCPU) and the MR-JE-C servo amplifier are connected.
1. Set the IP address of the CPU module (QnUDVCPU).
[Navigation] window [Parameter] [PLC Parameter]
Select the "Built-in Ethernet Port Setting" tab on the "Q Parameter Setting" window, and set the IP address.
12
2 FUNCTION DESCRIPTION
2.3 FB Operation
2. Configure the settin gs of CC-Link IE Field Network Basic.
[Navigation] window [Parameter] [PLC Parameter]
Select "CC-Link IEF Basic Setting" in the "Built-in Ethernet Port Setting" tab on the "Q Parameter Setting" window.
• Select "Use the CC-Link IEF Basic" on the "CC-Link IEF Basic Setting" window.
• Configure the network setting. Select "Network Configuration Setting" on the "CC-Link IEF Basic Setting" window. Add the MR-JE-C.
2
• Configure the refresh setting. In the following example, RX and RY are assigned to the device B, and RWw and RWr are assigned to the device W.
2 FUNCTION DESCRIPTION
2.3 FB Operation
13
3. Set the global label.
1) 2) 4)3)
Set the information specified in the refresh setting to the global label.
• Structure definition Define the devices specified in the refresh setting in the structure. The number of array elements of each label data type is equal to the number of "Points" of each devices set in the refresh setting. Structure na me : stR e mo te R egB a si c
Label name Data type Remark
bnRX Bit (0..n) n is "Number of RX device points - 1". In the example of Step 2, n i s " 127". bnRY Bit (0..n) n is "Number of RY device points - 1". In the example of Step 2, n is "127". unRWr Word [unsigned] (0..n) n is "Number of RWr device points - 1". In the example of Step 2, n is "63". unRWw Word [unsigned] (0..n) n is "Number of RWw device point s - 1". In the example of Step 2, n is "63".
• Global label definition Define the global label by using the structure set above. This library operates by using the data refreshed in the global label "G_stLinkBasic". Correctly assign the device used for data refresh. Otherwise, the FBs do not properly operate.
1) Select "VAR_GLOBAL" in "Class".
2) Set "G_stLinkBasic" in "Label Name".
3) Select the structure "stRemoteRegBasic" in "Data Type".
4) Assign the device according to the refresh setting.
14
2 FUNCTION DESCRIPTION
2.3 FB Operation
2.4 How to Use FB Library
To use the FB library of the sample project in other programs, output the FB library and import it to other project. The following shows the procedure.

Saving the user library

1. Open the project (MotionControl_JEC_FBs_Q.gxw).
Select "User Library" in "Navigation".
2
2. Select the library (MotionControl_JEC_V100A). Right-click the library and select "Open" from the menu.
2 FUNCTION DESCRIPTION

2.4 How to Use FB Library

15
3. After the library became editable, right-click the library and select "Save as" from the menu.
4. Enter the library file name and click the [Save] button.
In the following example, the library is named "MotionControl_JEC".
After the library has been saved, the following dialog box appears.
16
2 FUNCTION DESCRIPTION
2.4 How to Use FB Library

Installing the user library

1. Create a new project with the following setting.
Type: the model when the library is saved, Project Type: Structured Project, Language: Structured Ladder/FBD
2. Select "User Library" in "Navigation", and select "Install" from the library menu.
2
Select the saved library in the following dialog.
2 FUNCTION DESCRIPTION
2.4 How to Use FB Library
17
When the library has been installed normally, the following message appears and the library appears on the tree.
3. Expand the "FB/FUN" tree under "User Library", and add an FB to the program by dragging and dropping it.
Add the I/O label definition. If necessary, add the conditions such as the interlock or others.
18
2 FUNCTION DESCRIPTION
2.4 How to Use FB Library
3 FB LIBRARY
3.1 Function Overview of the FB Library

List of FBs

The following table lists the FBs used in the MELSEC-Q series QnUDVCPU module.
This library controls up to 16 stations of the servo amplifier MR-JE-C. The MR-JE-C uses the default mapping of the cyclic communication in the profile mode. For details, refer to the instruction manual of the servo amplifier in use.
MotionControl_JEC
Item Description Version
MC_Power_JEC Operation possible 00A MCv_Home_JEC Home position return 00A MC_Stop_JEC Forced stop 00A MC_Halt_JEC Stop 00A MC_MoveAbsolute_JEC Absolute value positioning 00A MC_MoveRelative_JEC Relative value positioning 00A MC_MoveAdditive_JEC Commanded position change 00A MC_MoveVelocity_JEC Velocity control 00A MC_TorqueControl_JEC Torque control 00A MC_ReadActualPosition_JEC Current position read 00A MC_ReadActualVelocity_JEC Current velocity read 00A MC_ReadActualTorque_JEC Current torque read 00A MC_ReadStatus_JEC Status read 00A MC_ReadAxisInfo_JEC Axis information read 00A MC_ReadAxisError_JEC Axis error read 00A MC_Reset_JEC Axis error reset 00A
3

Restrictions and precautions

Item Description
Restrictions and precautions
The following describes restrictions and precautions common to all FBs. The restrictions and precautions specific to each FB are separately described. Refer to Page 23 Details of the FB Library.
• The FB does not include error recovery processing. Program the error recovery processing separately in accordance with the required system operation.
• The FB does not detect an alarm or a warning that has occurred in the servo amplifier . Program the pro cessing to monitor alarms and warnings in the servo amplifiers. For the alarms and warnings that have occurred in the servo amplifiers, refer to the instruction manual of the servo amplifiers in use.
• The FB cannot be used in an interrupt program.
• Please ensure that an execution command (Execute or Enable) can be turned OFF with a program. Do not use this FB in programs that are only executed once, such as a subroutine program and FOR-NEXT loop because an execution command (Execute or Enable) cannot be turned OFF in these programs.
• The number of FB steps in a program varies depending on the CPU model to be used and I/O definitions.
• A duplicated coil warning may occur during compilation. However, the warning does not generate any problems.
• Set a circuit for each input label in an FB.
• When two or more FBs are used, be careful not to repeatedly specify and simultaneously start an axis.
• When an execution command (Execute or Enable) is turned ON, the FB reads data of the input label. Thus, set the input label before turning ON an execution command (Execute or Enable).
• Do not change the values of other input labels af ter tur ning ON an execution co mmand (Execute or Enab le). For some FBs such as the one whose operation type is real-time execution, however, input labels can be changed even after an execution command (Execute or Enable) is turned ON. For details, refer to Page 23 Details of th e FB Li brary.
• The FBs controls 16 slave stations. Set a station number of the servo amplifier within the setting range.
• The FBs control the servo amplifier MR-JE-C in the profile mode of the control mode. Set the parameter (PA01) of the servo amplifier to the profile mode. Use the default mapping for the cyclic communication.

3 FB LIBRARY

3.1 Function Overview of the FB Library

19

FB status diagram

MC_MoveAbsolute MC_MoveRelative MC_MoveAdditive MC_Halt
MC_MoveVelocity MC_TorqueControl
MC_Home
MC_Stop
Continuous
Motion (6)
Disabled (0)
Stopping (2)
Homing (3) Standstill (4)
Discrete Motion
(5)
Errorstop (1)
Done
Done
*1
*2
*3
*4
*5
*6
*7
The following figure shows the status diagram of this FB library. An axis is always in a defined status. A solid arrow in the status diagram figure indicates a transition caused by the start of an FB. A dashed arrow indicates a transition caused by the command end of an axis or the system.
*1 When an error occurs in the axis, the status transits from any status. *2 When Enable of MC_Power is OFF and no error has occurred in the axis *3 When MC_Reset is executed and Status of MC_Power is OFF *4 When MC_Reset is executed and both Enable and Status of MC_Power are ON *5 When both Enable and Status of MC_Power are ON *6 When Done of MC_Stop is ON, and Execute of MC_Stop is OFF. *7 In the zero velocity status. For zero velocity status, refer to the instruction manual of the servo amplifier in use.
Status Description
Disabled Indicates the initial status of an axis. Enable of MC_Power is OFF and no error has occurred in the axis. ErrorStop The status transits to this status when an error occurs. This status remains while an error has occurred. Stopping The status transits to this status when MC_Stop is executed. This stat us remains while Execute of MC_Stop is ON. Homing Indicates that the home position return is in execution. Standstill Indicates that MC_Power is ON and no error has occurred in the axis. DiscreteMotion Indicates that the positioning control FB is in execution.
ContinuousMotion Indicates that the continuous control FB is in execution. The status transits to this status when MC_MoveVelocity or
The status transits to this status when MC_MoveAbsolut e, MC_MoveRelative, MC_MoveAdditive, or MC_Halt is executed.
MC_TorqueControl is executed.
20
3 FB LIBRARY
3.1 Function Overview of the FB Library

Unit

The following table lists the units used in this FB library.
Item Description
Control unit degree, pulse
-3
Positioning range • -360000 to 360000 (10
• -999999 to 999999 (pulse)
Velocity command 0.00 to 167772.15 (r/min)
Acceleration/ deceleration time
Set a value within the permissible speed of the servo motor. Position control
0 to 20000 (ms) Velocity control 0 to 50000 (ms)
• Select degree or pulse as the control unit with the parameter (PT01) of the servo amplifier.
• For the real-type data, when a value whose number of decimal places exceeds the number of significant digits is input in each unit, the value is rounded off.
(Example) When an input value of an FB is 123.456789, the value after being rounded off is 123.45679.
degree)
3
3 FB LIBRARY
3.1 Function Overview of the FB Library
21

Link device

The following table lists the link devices accessed by this FB library. The devices marked with in the FB library are referred and updated. Set the device s wh ich are not used by the FB library as needed. n in the device No. indicates the value set by the station number setting.
Master station Servo amplifier (RYn) Servo amplifier Master station (RXn) Device No. Device name Access Device No. Device name Access
RY(n+3)F Cyclic communication ready command RX(n+3)F Cyclic communication ready
Master station Servo amplifier (RWwn) Servo amplifier Master station (RWrn) Device No. Device name Access Device No. Device name Access
RWwn00 Control mode RWrn00 Control mode display RWwn01 Control command RWrn01  RWwn02 Control input 1 RWrn02 Control status RWwn03 Control input 2 RWrn03 Current position (command unit) RWwn04 Control input 3 RWrn04 RWwn05 Position command (pp) RWrn05 Current velocity RWwn06 RWrn06 RWwn07 Velocity command (pv) RWrn07 Droop pulse RWwn08 RWrn08 RWwn09 Velocity limit value (tq) RWrn09 Current torque RWwn0A RWrn0A Control output 1 RWwn0B Torque command (tq) RWrn0B Control output 2 RWwn0C Command velocity (pp) RWrn0C Control output 3 RWwn0D RWrn0D Alarm No. RWwn0E Acceleration time consta nt (pp, pv) RWrn0E Touch probe function status RWwn0F RWrn0F Touch probe 1 RWwn10 Deceleration time constant (pp, pv) RWrn10 RWwn11 RWrn11 Touch probe 1 RWwn12 Torque command chan ge amount (per 1 RWwn13 RWrn13 Input device status 1 RWwn14 Torque limit value (positive) RWrn14 RWwn15 Torque limit value (negative) RWrn15  RWwn16 RWrn16  RWwn17 Touch probe function setting RWrn17  RWwn18 Positioning operation setting RWrn18  RWwn19 Control input 5 RWrn19  RWwn1A RWwn1A  RWwn1B RWwn1B  RWwn1C RWwn1C  RWwn1D RWwn1D  RWwn1E RW RWwn1F RWwn1F 
sec) (tq)
RWrn12
wn1E 
Position latched on the rising edge
Position latched on the falling edge
22
3 FB LIBRARY
3.1 Function Overview of the FB Library
3.2 Details of the FB Library
DUT: Axis Axis :DUT B: Enable Status :B
Error :B
ErrorID :UW
MC_Power_JEC
(2)
(5)
(4)
(3)
(1)(1)

MC_Power (Operation Possible)

Name
MC_Power_JEC
Overview
Item Description
Function overview Switches the status of the servo amplifier of the specified axis to Operable . Symbol
[Structured Ladder]
Symbol [Structured Text]
MC_Power_JEC (Axis, Enable, Status, Error, ErrorID)
Labels
I/O label
No. Variable name Name Data type Setting range Description
(1) Axis Axis information AXIS_REF_JEC Page 59 AXIS_REF_JEC (Axis information)
Input labels (Load: П: Always, : Only at start)
No. Variable name Name Data type Import Setting
range
(2) Enable Enable Bit ON, OFF While Enable is ON, the axis control is valid.
Description
3
Output labels
No. Variable name Name Data type Default value Description
(3) Status Operable Bit OFF It indicates that the servo amplifier is ready for
operation.
(4) Error Error Bit OFF When ON, it indicates that an error has occurred in
the FB.
(5) ErrorID Error code Word [unsigned] 0 The error code generated in the FB is returned.
3 FB LIBRARY

3.2 Details of the FB Library

23
Function overview
Enable
Status
Error
ErrorID
0
Enable
Status
Error
ErrorID
Error code
Item Description
Applicable hardware and software
Language Structured Text Number of basic steps 518 steps Function description This FB initializes the information of the specified axis and switches the axis status to Operable.
Restrictions and precautions Before executing this FB, set the axis number (AxisNo) of the AXIS_REF structure. FB operation type Pulsed execution (multiple scan execution type) Timing chart [Normal completion]
Applicable CPU QnUDVCPU Applicable engineering tool GX Works2
While Enable is ON, the specified axis is in the servo ON status. The display of the servo amplifier changes to "d**", and Status turns ON. The axis status transits from Disabled to Standstill. When the power of the servo amplifier is shut off, the axis status transits to ErrorStop. For the axis status, refer to Page 20 FB status diagram. When an error has occurred in the FB, this FB turns ON Error and stores an error code in ErrorID. For details of error codes, refer to Page 61 Troubleshooti ng.
[Error completion]
24
3 FB LIBRARY
3.2 Details of the FB Library

MCv_Home (Home Position Return)

DUT: Axis Axis :DUT B: Execute Don e :B
Busy :B Error :B
ErrorID :UW
MCv_Home_JEC
(1) (3) (4) (5) (6)
(1) (2)
Name
MCv_Home_JEC
Overview
Item Description
Function overview Executes the home position return of the specified axis. Symbol
[Structured Ladder]
3
Symbol [Structured Text]
MCv_Home_JEC (Axis, Execute, Done, Busy, Error, ErrorID)
Labels
I/O label
No. Variable name Name Data type Setting range Description
(1) Axis Axis information AXIS_REF_JEC Page 59 AXIS_REF_JEC (Axis information)
Input labels (Load: П: Always, : Only at start)
No. Variable name Name Data type Import Setting
range
(2) Execute Execution command Bit ON, OFF ON: The FB is executed.
Output labels
No. Variable name Name Data type Default value Description
(3) Done Execution
completion
(4) Busy Executing Bit OFF It indicates that the home position return is in
(5) Error Error Bit OFF When ON, it indicates that an error has occurred in
(6) ErrorID Error code Word [unsigned] 0 The error code generated in the FB is returned.
Bit OFF It indicates that the home position return is
Description
completed.
execution.
the FB.
3 FB LIBRARY
3.2 Details of the FB Library
25
Function overview
Execute
Busy
Done
Error
ErrorID 0
Execute
Busy
Done
Error
ErrorID
Error code
Item Description
Applicable hardware and software
Language Structured Text Number of basic steps 869 steps Function description This FB executes home position return of the specified axis based on the set home position return parameters.
Restrictions and precautions Set home position parameters with an engineering tool in advance. FB operation type Pulsed execution (multiple scan execution type) Timing chart [Normal completion]
Applicable CPU QnUDVCPU Applicable engineering tool GX Works2
This FB is executed when Execute turns ON. Busy is ON during home position return. When the processing is normally completed, Done turns ON and Busy turns OFF. Axis status: When the FB is started with the axis in the Standstill status, the status changes to Standstill when the processing is completed. When an error has occurred in the FB, this FB turns ON Error and stores an error code in ErrorID. For details of error codes, refer to Page 61 Troubleshooti ng.
[Error completion]
26
3 FB LIBRARY
3.2 Details of the FB Library

MC_Stop (Forced Stop)

DUT: Axis Axis :DUT B: Execute Don e :B
Busy :B Error :B
ErrorID :UW
MC_Stop_JEC
(1)(1)
(2) (3)
(4) (5) (6)
Name
MC_Stop_JEC
Overview
Item Description
Function overview Forcibly stops the specified axis. Symbol
[Structured Ladder]
3
Symbol [Structured Text]
MC_Stop_JEC (Axis, Execut e, Done, Busy, Error, ErrorID)
Labels
I/O label
No. Variable name Name Data type Setting range Description
(1) Axis Axis information AXIS_REF_JEC Page 59 AXIS_REF_JEC (Axis information)
Input labels (Load: П: Always, : Only at start)
No. Variable name Name Data type Import Setting
range
(2) Execute Execution command Bit ON, OFF ON: The FB is executed.
Output labels
No. Variable name Name Data type Default value Description
(3) Done Execution
completion (4) Busy Executing Bit OFF It indicates that the velocity is decreasing to 0. (5) Error Error Bit OFF When ON, it indicates that an error has occurred in
(6) ErrorID Error code Word [unsigned] 0 The error code generated in the FB is returned.
Bit OFF It indicates that the velocity has reached 0.
Description
the FB.
3 FB LIBRARY
3.2 Details of the FB Library
27
Function overview
Item Description
Applicable hardware and software
Language Structured Text Number of basic steps 436 steps Function description This FB stops the contro l of the specified axis and changes the axis status to Stopping. This FB aborts the motion FB s in
Restrictions and precautions The deceleration time follows the setting of the forced stop deceleration time constant (PC51) of the servo amplifier
FB operation type Pulsed execution (multiple scan execution type) Timing chart [Normal completion]
Applicable CPU QnUDVCPU Applicable engineering tool GX Works2
execution. This FB is executed when Execute turns ON, and Busy turns ON when the processing is normally started. Done turns ON when the processing is completed and the axis stops. Other FBs cannot be executed until the axis velocity reaches 0. When the servo amplifier decelerates to stop, the status changes to the Switch On Disable status. In the torque control, the status immediately ch anges to the Switch On Disabl e status an d the servo amplifier stop s by using a dynamic brake. The axis status transits to Stopping. While Execute is ON or the velocity has not reached 0, the Stopping status remains. The axis status transits to Standstill when Done turns ON, and Execute turns OFF . When an error has occurred in the FB, this FB turns ON Error and stores an error code in ErrorID. For details of error codes, refer to Page 61 Troubleshooti ng.
parameter.
Execute
Busy
Done
AxisStatus
Error
ErrorID
[Error completion]
Execute
Busy
Done
AxisStatus
Error
Stopping Standstill
0
28
3 FB LIBRARY
3.2 Details of the FB Library
ErrorID
Error code

MC_Halt (Stop)

DUT: Axis Axis :DUT B: Execute Don e :B
Busy :B
CommandAborted :B
Error :B
ErrorID :UW
D: Deceleration
MC_Halt_JEC
(1)
(8)
(5)
(4)
(3)
(2)
(1)
(6) (7)
Name
MC_Halt_JEC
Overview
Item Description
Function overview Stops the specified axis. Symbol
[Structured Ladder]
3
Symbol [Structured Text]
MC_Halt_JEC (Axis, Execute, Deceleration, Done, Busy, CommandAborted, Error, ErrorID)
Labels
I/O label
No. Variable name Name Data type Setting range Description
(1) Axis Axis information AXIS_REF_JEC Page 59 AXIS_REF_JEC (Axis information)
Input labels (Load: П: Always, : Only at start)
No. Variable name Name Data type Import Setting
range
(2) Execute Execution command Bit ON, OFF ON: The FB is executed. (3) Deceleration Deceleration time Double word
[signed]
Acceleration/ deceleration time on "Page 21 Unit"
Output labels
No. Variable name Name Data type Default value Description
(4) Done Execution
completion (5) Busy Executing Bit OFF It indicates that the velocity is decreasing to 0. (6) CommandAborted Abortion of
execution (7) Error Error Bit OFF When ON, it indicates that an error has occurred in
(8) ErrorID Error code Word [unsigned] 0 The error code generated in the FB is returned.
Bit OFF It indicates that the velocity has reached 0.
Bit OFF It indicates that another FB has aborted the
Description
The time taken for the servo motor to stop from the rated speed is set.
execution of the FB.
the FB.
3 FB LIBRARY
3.2 Details of the FB Library
29
Function overview
Item Description
Applicable hardware and software
Language Structured Text Number of basic steps 592 steps Function description This FB stops the contro l of the specified axis.
Restrictions and precautions • Deceleration time of the input label is valid only in the velocity control. At the home position return, the axis stops following
FB operation type Pulsed execution (multiple scan execution type)
Applicable CPU QnUDVCPU Applicable engineering tool GX Works2
This FB is executed when Execute turns ON, and Busy turns ON when the processing is normally started. Done turns ON when the processing is completed and the axis stops. The axis status is in the DiscreteMotion status after Execute turns ON unti l the axis velocity reaches 0. The axis status transits to St andstill when Done turns ON. When the continuous control FB is executed while this FB is in execution, the operation varies depending on the control which was performed before the execution of this FB. When the home position return control or the position control was perfor med before the execution of this FB, an error occurs in the continuous control FB, and the stop operation continues. When the velocity control or the torque control was performed before the execu tion of this FB, CommandAborted turns ON in this FB, and the control is switched to the continuous control FB after a deceleration stop. When Execute is turned OFF while this FB is in execution, the stop operation continues. Another MC_Halt cannot be executed. When an error has occurred in the FB, this FB turns ON Error and stores an error code in ErrorID. For details of error codes, refer to Page 61 Troubleshooti ng.
the setting of "Home position return acceleration time constant (PT61)" or "Home position return deceleration time constant (PT62)" depending on the setting of "Home position return de celeration time constant selection (PT60)" of the servo amplifier parameter. In the execution of the positioning control FB, the deceleration time specified with the positioning control FB in execution is applied. In the torque control, the axis decelerates to stop with the tor que slope specified with the torque control.
• While this FB is in execution, the home position return and the positioning control FB cannot be executed.
• This FB cannot be executed when the positioning control FB has completed positioning.
30
3 FB LIBRARY
3.2 Details of the FB Library
Item Description
Execute
Busy
Done
AxisStatus
CommandAborted
Error
ErrorID 0
DiscreteMotion Standstill
Timing chart [Normal completion]
[Error completion]
Execute
Busy
3
Done
AxisStatus
CommandAborted
Error
ErrorID
Error code
3 FB LIBRARY
3.2 Details of the FB Library
31

MC_MoveAbsolute (Absolute Value Positioning)

Name
MC_MoveAbsolute_JEC
Overview
Item Description
Function overview Specifies the commanded absolute position of the specified axis and executes positioning. Symbol
[Structured Ladder]
(2) (3)
(4) (5) (6)
(7)
DUT: Axis Axis :DUT B: Execute Don e :B
W: Direction
MC_MoveAbsolute_JEC
Busy :BL: Position
CommandAborted :BL: Velocity
Error :BD: Acceleration
ErrorID :UWD: Deceleration
(1)(1) (8)
(9) (10) (11) (12)
Symbol [Structured Text]
MC_MoveAbsolute_JEC (Axis, Execute, Position, Velocity, Acceleration, Deceleration, Direction, Done, Busy, CommnadAborted, Error, ErrorID)
Labels
I/O label
No. Variable name Name Data type Setting range Description
(1) Axis Axis information AXIS_REF_JEC Page 59 AXIS_REF_JEC (Axis information)
Input labels (Load: П: Always, : Only at start)
No. Variable name Name Data type Import Setting
range
(2) Execute Execution command Bit ON, OFF ON: The FB is executed. (3) Position Commanded
position
(4) Velocity Velocity Double-precision
(5) Acceleration Acceleration time Double word
(6) Deceleration Deceleration time Double word
(7) Direction Rotation direction Word [signed] 1, 2, 3, 4 Page 60 MC_DIRECTION (Direction Selection)
Double-precision real number
real number
[signed]
[signed]
Positioning range on "Page 21 Unit"
 Velocity
command on "Page 21 Unit"
0 to 20000
(ms)
0 to 20000
(ms)
Description
The commanded absolute position is set.
The velocity command value is set.
The time taken for the servo motor to reach the rated speed is set.
The time taken for the servo motor to stop from the rated speed is set.
Output labels
No. Variable name Name Data type Default value Description
(8) Done Execution
completion (9) Busy Executing Bit OFF It indicates that the FB is in execution. (10) CommandAborted Abortion of
(11) Error Error Bit OFF When ON, it indicates that an error has occurred in
(12) ErrorID Error code Word [unsigned] 0 The error code generated in the FB is returned.
execution
3 FB LIBRARY
32
3.2 Details of the FB Library
Bit OFF It indicates that the axis has reached the
commanded position.
Bit OFF It indicates that another FB has aborted the
execution of the FB.
the FB.
Function overview
Execute
Busy
Done
CommandAborted
Error
ErrorID
Error code
Item Description
Applicable hardware and software
Language Structured Text Number of basic steps 1245 steps Function description This FB executes positioning of the specified axis to the commanded absolute position.
Restrictions and precautions • Before executing this FB, set the torque limit value (PositiveTorqueLimit, NegativeTorqueLimit) of the AXIS_REF
FB operation type Pulsed execution (multiple scan execution type) Timing chart [Normal completion]
Applicable CPU QnUDVCPU Applicable engineering tool GX Works2
This FB is executed when Execute turns ON, and Busy turns ON when the processing is normally started. When the processing is completed and positioning of the axis is completed, Done turns ON. When one path to the commanded position is determined, the Directi on input is ignored. The axis status during positioning control is DiscreteMotion. When an error has occurred in the FB, this FB turns ON Error and stores an error code in ErrorID. For details of error codes, refer to Page 61 Troubleshooti ng.
structure.
• When executing this FB while the continuous control FB is in execution (AxisS t atu s is ContinuousMotion), execut e this FB with the axis stopped.
• When turning OFF an execution command (Execute) after turning it ON, be sure to turn it OFF after Executing (Busy) is ON.
• When the unit is degree, and another MC_MoveAbsolute is executed while this FB is in execution, Direction becomes invalid, and the rotation direction in execution is used.
• This FB cannot be executed while a positioning warning (alarm number: F4) is occurring in the servo amplifier.
• When another positioning control FB is executed with an execution completion (Done) of this FB, do not turn ON the execution command (Execute) of the another FB to be executed, and turn OFF the execution command (Execute) of the executed FB in the same scan. Otherwise, an error occurs in the another FB to be executed.
3
Execute
Busy
Done
CommandAborted
Error
ErrorID 0
[Error completion]
3 FB LIBRARY
3.2 Details of the FB Library
33

MC_MoveRelative (Relative Value Positioning)

DUT: Axis Axis :DUT B: Execute Don e :B
Busy :B
CommandAborted :B
Error :B
ErrorID :UW
L: Distance L: Velocity D: Acceleration D: Deceleration
MC_MoveRelative_JEC
(1)
(8) (9) (10) (11)
(5)
(4)
(3)
(2)
(1)
(6)
(7)
Name
MC_MoveRelative_JEC
Overview
Item Description
Function overview Moves an axis for the specified distance from the current position. Symbol
[Structured Ladder]
Symbol [Structured Text]
MC_MoveRelative_JEC (Axis, Execute, Distance, Velocity, Acceleration, Decelerat i on, Done, Busy, CommnadAborted, Error, ErrorID)
Labels
I/O label
No. Variable name Name Data type Setting range Description
(1) Axis Axis information AXIS_REF_JEC Page 59 AXIS_REF_JEC (Axis information)
Input labels (Load: П: Always, : Only at start)
No. Variable name Name Data type Import Setting
range
(2) Execute Execution command Bit ON, OFF ON: The FB is executed. (3) Distance Travel distance Double-precision
real number
(4) Velocity Velocity Double-precision
real number
(5) Acceleration Acceleration time Double word
[signed]
(6) Deceleration Deceleration time Double word
[signed]
Positioning range on "Page 21 Unit"
 Velocity
command on "Page 21 Unit"
0 to 20000
(ms)
0 to 20000
(ms)
Description
The travel distance is set.
The velocity command value is set.
The time taken for the servo motor to reach the rated speed is set.
The time taken for the servo motor to stop from the rated speed is set.
Output labels
No. Variable name Name Data type Default value Description
(7) Done Execution
(8) Busy Executing Bit OFF It indicates that the FB is in execution. (9) CommandAborted Abortion of
(10) Error Error Bit OFF When ON, it indicates that an error has occurred in
(11) ErrorID Error code Word [unsigned] 0 The error code generated in the FB is returned.
34
3 FB LIBRARY
3.2 Details of the FB Library
completion
execution
Bit OFF It indicates that the axis has reached the
Bit OFF It indicates that another FB has aborted the
commanded position.
execution of the FB.
the FB.
Function overview
Item Description
Applicable hardware and software
Language Structured Text Number of basic steps 1174 steps Function description This FB moves the specified axis for the specified distance from the set value.
Restrictions and precautions • Before executing this FB, set the torque limit value (PositiveTorqueLimit, NegativeTorqueLimit) of the AXIS_REF
FB operation type Pulsed execution (multiple scan execution type) Timing chart [Normal completion]
Applicable CPU QnUDVCPU Applicable engineering tool GX Works2
This FB is executed when Execute turns ON, and Busy turns ON when the processing is normally started. When the processing is completed and positioning of the axis is completed, Done turns ON. The axis status during positioning control is DiscreteMotion. When an error has occurred in the FB, this FB turns ON Error and stores an error code in ErrorID. For details of error codes, refer to Page 61 Troubleshooti ng.
structure.
• When executing this FB while the continuous control FB is in execution (AxisS t atu s is ContinuousMotion), execut e this FB with the axis stopped.
• When turning OFF an execution command (Execute) after turning it ON, be sure to turn it OFF after Executing (Busy) is ON.
• This FB cannot be executed while a positioning warning (alarm number: F4) is occurring in the servo amplifier.
• This FB cannot be used to control the axis of which the unit is set as degree.
• This FB cannot be executed while the positioning control FB is in execution (AxisStatus is DiscreteMotion).
• When another positioning control FB is executed with an execution completion (Done) of this FB, do not turn ON the execution command (Execute) of the another FB to be executed, and turn OFF the execution command (Execute) of the executed FB in the same scan. Otherwise, an error occurs in the another FB to be executed.
3
Execute
Busy
Done
CommandAborted
Error
ErrorID
[Error completion]
Execute
Busy
Done
CommandAborted
0
Error
ErrorID
Error code
3 FB LIBRARY
3.2 Details of the FB Library
35

MC_MoveAdditive (Commanded Position Change)

DUT: Axis Axis :DUT B: Execute Don e :B
Busy :B
CommandAborted :B
Error :B
ErrorID :UW
L: Distance L: Velocity D: Acceleration D: Deceleration
MC_MoveAdditive_JEC
(1)(1)
(8) (9) (10) (11)
(2) (3) (4) (5) (6)
(7)
Name
MC_MoveAdditive_JEC
Overview
Item Description
Function overview Adds a specified relative position in the previous positioning command of the specified axis and executes positioning. Symbol
[Structured Ladder]
Symbol [Structured Text]
MC_MoveAddtive_JEC (Axis, Execute, Distance, Velocity, Acceleration, Deceleration, Done, Busy, CommnadAborted, Error, ErrorID)
Labels
I/O label
No. Variable name Name Data type Setting range Description
(1) Axis Axis information AXIS_REF_JEC Page 59 AXIS_REF_JEC (Axis information)
Input labels (Load: П: Always, : Only at start)
No. Variable name Name Data type Import Setting
range
(2) Execute Execution command Bit ON, OFF ON: The FB is executed. (3) Distance Travel distance Double-precision
real number
(4) Velocity Commanded
velocity
(5) Acceleration Acceleration time Double word
(6) Deceleration Deceleration time Double word
Double-precision real number
[signed]
[signed]
Positioning range on "Page 21 Unit"
 Velocity
command on "Page 21 Unit"
0 to 20000
(ms)
0 to 20000
(ms)
Description
The travel distance of the relative position is set.
The velocity command value is set.
The time taken for the servo motor to reach the rated speed is set.
The time taken for the servo motor to stop from the rated speed is set.
Output labels
No. Variable name Name Data type Default value Description
(7) Done Execution
completion (8) Busy Executing Bit OFF It indicates that the FB is in execution. (9) CommandAborted Abortion of
execution (10) Error Error Bit OFF When ON, it indicates that an error has occurred in
(11) ErrorID Error code Word [unsigned] 0 The error code generated in the FB is returned.
36
3 FB LIBRARY
3.2 Details of the FB Library
Bit OFF It indicates that the axis has reached the
commanded position.
Bit OFF It indicates that another FB has aborted the
execution of the FB.
the FB.
Function overview
Execute
Busy
Done
CommandAborted
Error
ErrorID
Error code
Item Description
Applicable hardware and software
Language Structured Text Number of basic steps 1188 steps Function description This FB adds the specified relative position in the previous positioning command of the specified axis and executes
Restrictions and precautions • Before executing this FB, set the torque limit value (PositiveTorqueLimit, NegativeTorqueLimit) of the AXIS_REF
FB operation type Pulsed execution (multiple scan execution type) Timing chart [Normal completion]
Applicable CPU QnUDVCPU Applicable engineering tool GX Works2
positioning. This FB is executed when Execute turns ON, and Busy turns ON when the processing is normally started. When the processing is completed and positioning of the axis is completed, Done turns ON. The axis status during positioning control is DiscreteMotion. This FB can be used when the axis status is Standstill or DiscreteMotion. It cannot be used when the axis status is ContinuousMotion. When an error has occurred in the FB, this FB turns ON Error and stores an error code in ErrorID. For details of error codes, refer to Page 61 Troubleshooti ng.
structure.
• When executing this FB while the continuous control FB i s in execution ( AxisS t atus is ContinuousMotion) , execute this FB with the axis stopped.
• When turning OFF an execution command (Execute) after turning it ON, be sure to turn it OFF after Executing (Busy) is ON.
• This FB cannot be executed when a positioning warning (alarm number: F4) is occurring in the servo amplifier.
• This FB cannot be used to control the axis of which the unit is set as degree.
• When another positioning control FB is executed with an execution completion (Done) of this FB, do not turn ON the execution command (Execute) of the another FB to be executed, and turn OFF the execution command (Execute) of the executed FB in the same scan. Otherwise, an error occurs in the another FB to be executed.
3
Execute
Busy
Done
CommandAborted
Error
ErrorID 0
[Error completion]
3 FB LIBRARY
3.2 Details of the FB Library
37

MC_MoveVelocity (Velocity Control)

Name
MC_MoveVelocity_JEC
Overview
Item Description
Function overview Controls the velocity of the specified axis to the commanded velocity. Symbol
[Structured Ladder]
(1) (1) (2) (3) (4) (5) (6)
DUT: Axis Axis :DUT B: Execute InVelocity :B L: Velocity Busy :B D: Acceleration Active :B D: Deceleration Com mandAborted :B W: Direction Error :B
MC_MoveVelocity_JEC
ErrorID :UW
(7) (8) (9) (10) (11) (12)
Symbol [Structured Text]
MC_MoveVelocity_JEC (Axis, Execute, Velocity, Acceleration, Deceleration, Direction, InVelocity, Busy , Active, CommandAborted, Error, ErrorID)
Labels
I/O label
No. Variable name Name Data type Setting range Description
(1) Axis Axis information AXIS_REF_JEC Page 59 AXIS_REF_JEC (Axis information)
Input labels (Load: П: Always, : Only at start)
No. Variable name Name Data type Import Setting
range
(2) Execute Execution command Bit ON, OFF ON: The FB is executed. (3) Velocity Commanded
velocity
(4) Acceleration Acceleration time Double word
(5) Deceleration Deceleration time Double word
(6) Direction Rotation direction Word [signed] 1, 2 The rotation direction is specified.
Double-precision real number
[signed]
[signed]
 Velocity
command on "Page 21 Unit"
0 to 50000
(ms)
0 to 50000
(ms)
Description
The velocity command value is set. It can be specified with a sign.
The time taken for the servo motor to reach the rated speed is set.
The time taken for the servo motor to stop from the rated speed is set.
MC_DIRECTION defined values can be used. Select one of the following two values.
• mcPositiveDirection positive direction (1)
• mcNegativeDirection negative direction (2)
Output labels
No. Variable name Name Data type Default value Description
(7) InVelocity Commanded
(8) Busy Executing Bit OFF It indicates that the FB is in execution. (9) Active Controlling Bit OFF It indicates that the FB is controlling the axis. (10) CommandAborted Abortion of
(11) Error Error Bit OFF When ON, it indicates that an error has occurred in
(12) ErrorID Error code Word [unsigned] 0 The error code generated in the FB is returned.
velocity reached
execution
3 FB LIBRARY
38
3.2 Details of the FB Library
Bit OFF It indicates that the velocity has reached the
specified value.
Bit OFF It indicates that another FB has aborted the
execution of the FB.
the FB.
Function overview
Item Description
Applicable hardware and software
Language Structured Text Number of basic steps 986 steps Function description This FB controls the velocity of the specified axis to the commanded velocity.
Restrictions and precautions • Before executing this FB, set the torque limit value (PositiveTorqueLimit, NegativeTorqueLimit) of the AXIS_REF
FB operation type Pulsed execution (multiple scan execution type)
Applicable CPU QnUDVCPU Applicable engineering tool GX Works2
This FB is executed when Execute turns ON, and Busy turns ON when the processing is normally started. When the mode of the axis changes to the velocity control mode, Active turns ON. When the velocity of the axis has reached the commanded velocity, InVelocity turns ON. Once InVelocity turns ON when the velocity of the axis has reached the commanded velocity, InVelocity remains ON until Execute turns OFF or the control is aborted. The actual rotation direction depends on the sign specified with the commanded velocity (Velocity) and the setting of the rotation direction (Direction). The axis status transits to ContinuousMotion. Abort the execution of the FB and switch the control by executing another MC_MoveVelocity or MC_TorqueControl. To stop the operation, use MC_Halt. When the control is aborted, CommandAborted turns ON. When Execute turns OFF, CommandAborted turns OFF. When an error has occurred in the FB, this FB turns ON Error and stores an error code in ErrorID. For details of error codes, refer to Page 61 Troubleshooti ng.
structure.
• When the positioning control FB is in execution (AxisStatus is DiscreteMotion), execute this FB with the axis stopped.
• When the mode is switched from the velocity control mode to the torque control mode, the servo motor speed may momentarily fluctuate. Thus, it is recommended switching the mode from the velocity control mode to the torque control mode after the servo motor is stopped.
3
3 FB LIBRARY
3.2 Details of the FB Library
39
Item Description
Execute
Busy
Active
InVelocity
CommandAborted
Error
ErrorID
Velocity
0
Execute
Busy
Active
InVelocity
CommandAborted
Error
ErrorID
Error code
Timing chart [Normal completion]
[Error completion]
40
3 FB LIBRARY
3.2 Details of the FB Library

MC_TorqueControl (Torque Control)

Name
MC_TorqueControl_JEC
Overview
Item Description
Function overview Controls the specified axis with the specified torque. Symbol
[Structured Ladder]
(1) (2) (3) (4) (5) (6)
DUT: Axis Axis :DUT B: Execute InTorque :B E: Torque Busy :B L: TorqueRamp L: Velocity W: Direction
MC_TorqueControl_JEC
Active :B
CommandAborted :B
Error :B
ErrorID :UW
3
(1) (7) (8) (9) (10) (11) (12)
Symbol [Structured Text]
MC_TorqueControl_JEC (Axis, Execute, Torque, TorqueRamp, Velocity, Direction, InTorque, Busy, Active, CommandAborted, Error, ErrorID)
Labels
I/O label
No. Variable name Name Data type Setting range Description
(1) Axis Axis information AXIS_REF_JEC Page 59 AXIS_REF_JEC (Axis information)
Input labels (Load: П: Always, : Only at start)
No. Variable name Name Data type Import Setting
range
(2) Execute Execution command Bit ON, OFF ON: The FB is executed. (3) Torque Commanded torque Single-precision
real number
(4) TorqueRamp Torque slope Double-precision
real number
(5) Velocity Limit velocity Double-precision
real number
(6) Direction Rotation direction Word [signed] 1, 2 The rotation direction is specified.
-1000.0 to
1000.0 [%]
0.0 to
1000000.0 [%/ s]
 Velocity
command on "Page 21 Unit"
Description
The command torque is set. Set the ratio to the rated torque of the servo motor to be used in percentage.
The slope of the torque command is set in percentage per second.
The velocity limit value in the torque control mode is set.
MC_DIRECTION definition can be used. Select one of the following two values.
• mcPositiveDirection positive direction (1)
• mcNegativeDirection negative direction (2)
Output labels
No. Variable name Name Data type Default value Description
(7) InTorque Commanded torque
reached (8) Busy Executing Bit OFF It indicates that the FB is in execution. (9) Active Controlling Bit OFF It indicates that the FB is controlling the axis. (10) CommandAborted Abortion of
execution (11) Error Error Bit OFF When ON, it indicates that an error has occurred in
(12) ErrorID Error code Word [unsigned] 0 The error code generated in the FB is returned.
Bit OFF It indicates that the torque has reached the specified
value.
Bit OFF It indicates that another FB has aborted the
execution of the FB.
the FB.
3 FB LIBRARY
3.2 Details of the FB Library
41
Function overview
Item Description
Applicable hardware and software
Language Structured Text Number of basic steps 1001 steps Function description This FB controls the specified axis with the specified torque.
Restrictions and precautions • Before executing this FB, set the torque limit value (PositiveTorqueLimit, NegativeTorqueLimit) of the AXIS_REF
FB operation type Pulsed execution (multiple scan execution type)
Applicable CPU QnUDVCPU Applicable engineering tool GX Works2
This FB is executed when Execute turns ON, and Busy turns ON when the processing is normally started. When the mode of the axis changes to the torque control mode, Active turns ON. When the torque of the axis has reached the commanded torque, InTorque turns ON. Once InTorque turns ON when the torque has reached the commanded torqu e, InTorque remains ON until Execute turns OFF or the control is aborted. The axis status transits to ContinuousMotion. Abort the execution and switch the control by executing another MC_TorqueControl or MC_MoveVelocity. To stop the operation, use MC_Halt. When the control is aborted, CommandAborted turns ON. When Execute turns OFF, CommandAborted turns OFF. When an error has occurred in the FB, this FB turns ON Error and stores an error code in ErrorID. For details of error codes, refer to Page 61 Troubleshooti ng.
structure.
• When the positioning control FB is in execution (AxisStatus is DiscreteMotion), execute this FB with the axis stopped.
42
3 FB LIBRARY
3.2 Details of the FB Library
Item Description
Execute
Busy
Active
InTorque
CommandAborted
Error
ErrorID
Torque
0
Timing chart [Normal completion]
[Error completion]
3
Execute
Busy
Active
InTorque
CommandAborted
Error
ErrorID
Error code
3 FB LIBRARY
3.2 Details of the FB Library
43

MC_ReadActualPosition (Current Position Read)

(1) (1)
(5) (6)
(2) (3)
(4)
DUT: Axis Axis :DUT B: Enable Valid :B
Error :B
ErrorID :UW
Position :L
MC_ReadActualPosition_JEC
Name
MC_ReadActualPosition_JEC
Overview
Item Description
Function overview Reads the current position of the specified axis. Symbol
[Structured Ladder]
Symbol [Structured Text]
MC_ReadActualPosition_JEC (Axis, Enable, Valid, Error, ErrorID, Position)
Labels
I/O label
No. Variable name Name Data type Setting range Description
(1) Axis Axis information AXIS_REF_JEC Page 59 AXIS_REF_JEC (Axis information)
Input labels (Load: П: Always, : Only at start)
No. Variable name Name Data type Import Setting
range
(2) Enable Enable Bit ON, OFF ON: The FB is executed.
Output labels
No. Variable name Name Data type Default value Description
(3) Valid Output value valid Bit OFF During ON, the output value is valid. (4) Error Error Bit OFF When ON, it indicates that an error has occurred in
(5) ErrorID Error code Word [unsigned] 0 The error code generated in the FB is returned. (6) Position Current feed value Double-precision
real number
0 The current position of the specified axis is returned.
Description
the FB.
-3
degree, pulse)
(10
44
3 FB LIBRARY
3.2 Details of the FB Library
Function overview
Enable
Reading of current value
Valid
Error
ErrorID
0
Read value
Item Description
Applicable hardware and software
Language Structured Text Number of basic steps 150 steps Function description This FB reads the current position of the specified axis.
Restrictions and precautions FB operation type Pulsed execution (multiple scan execution type) Timing chart [Normal completion]
Applicable CPU QnUDVCPU Applicable engineering tool GX Works2
The FB is executed when Enable turns ON, and the current position is read. Read data is always updated while Valid is ON. When an error has occurred in the FB, this FB turns ON Error and stores an error code in ErrorID. For details of error codes, refer to Page 61 Troubleshooti ng.
3
[Error completion]
Enable
Reading of each current value
Valid
Error
ErrorID
0
Error code
3 FB LIBRARY
3.2 Details of the FB Library
45

MC_ReadActualVelocity (Current Velocity Read)

DUT: Axis Axis :DUT B: Enable Valid :B
Error :B
ErrorID :UW
Velocity :L
MC_ReadActualVelocity_JEC
(1) (3) (4) (5) (6)
(2)
(1)
Name
MC_ReadActualVelocity_JEC
Overview
Item Description
Function overview Returns the current velocity of the specified axis. Symbol
[Structured Ladder]
Symbol [Structured Text]
MC_ReadActualVelocity_JEC (Axis, Enable, Valid, Error, ErrorID, Velocity)
Labels
I/O label
No. Variable name Name Data type Setting range Description
(1) Axis Axis information AXIS_REF_JEC Page 59 AXIS_REF_JEC (Axis information)
Input labels (Load: П: Always, : Only at start)
No. Variable name Name Data type Import Setting
range
(2) Enable Enable Bit ON, OFF ON: The FB is executed.
Output labels
No. Variable name Name Data type Default value Description
(3) Valid Output value valid Bit OFF During ON, the output value is valid. (4) Error Error Bit OFF When ON, it indicates that an error has occurred in
(5) ErrorID Error code Word [unsigned] 0 The error code generated in the FB is returned. (6) Velocity Current velocity Double-precision
real number
0 The current velocity of the specified axis is returned
Description
the FB.
(r/min).
46
3 FB LIBRARY
3.2 Details of the FB Library
Function overview
Item Description
Applicable hardware and software
Language Structured Text Number of basic steps 157 steps Function description This FB reads the current velocity of the specified axis.
Restrictions and precautions FB operation type Pulsed execution (multiple scan execution type) Timing chart [Normal completion]
Applicable CPU QnUDVCPU Applicable engineering tool GX Works2
This FB is executed when Enable turns ON, and the velocity of the specified axis is read. Read data is always updated while Valid is ON. When an error has occurred in the FB, this FB turns ON Error and stores an error code in ErrorID. For details of error codes, refer to Page 61 Troubleshooti ng.
Enable
3
Velocity
Valid
Error
ErrorID
[Error completion]
Enable
Velocity
Valid
Error
ErrorID
Current velocity
0
0
Error code
3 FB LIBRARY
3.2 Details of the FB Library
47

MC_ReadActualTorque (Current Torque Read)

Name
MC_ReadActualTorque_JEC
Overview
Item Description
Function overview Reads the current torque of the specified axis. Symbol
[Structured Ladder]
(1) (2)
DUT: Axis Axis :DUT B: Enable Valid :B
MC_ReadActualTorque_JEC
ErrorID :UW
Torque :E
Error :B
(1) (3) (4) (5) (6)
Symbol [Structured Text]
MC_ReadActualTorque_JEC (Axis, Enable, Valid, Error, ErrorID, Torque)
Labels
I/O label
No. Variable name Name Data type Setting range Description
(1) Axis Axis information AXIS_REF_JEC Page 59 AXIS_REF_JEC (Axis information)
Input labels (Load: П: Always, : Only at start)
No. Variable name Name Data type Import Setting
range
(2) Enable Enable Bit ON, OFF ON: The FB is executed.
Output labels
No. Variable name Name Data type Default value Description
(3) Valid Output value valid Bit OFF During ON, the output value is valid. (4) Error Error Bit OFF When ON, it indicates that an error has occurred in
(5) ErrorID Error code Word [unsigned] 0 The error code generated in the FB is returned. (6) Torque Current torque Single-precision
real number
0 The current torque of the specified axis is returned.
Description
the FB.
48
3 FB LIBRARY
3.2 Details of the FB Library
Function overview
Enable
Torque
Valid
Error
ErrorID
Current torque
0
Item Description
Applicable hardware and software
Language Structured Text Number of basic steps 113 steps Function description This FB reads the current torque of the specified axis.
Restrictions and precautions FB operation type Pulsed execution (multiple scan execution type) Timing chart [Normal completion]
Applicable CPU QnUDVCPU Applicable engineering tool GX Works2
The FB is executed when Enable turns ON, and the torque of the specified axis is read. Read data is always updated while Valid is ON. When an error has occurred in the FB, this FB turns ON Error and stores an error code in ErrorID. For details of error codes, refer to Page 61 Troubleshooti ng.
3
[Error completion]
Enable
Torque
Valid
Error
ErrorID
0 Error code
3 FB LIBRARY
3.2 Details of the FB Library
49

MC_ReadStatus (Status Read)

Name
MC_ReadStatus_JEC
Overview
Item Description
Function overview Returns the detailed status of the status diagram of the specified axis. Symbol
[Structured Ladder]
(1) (2)
DUT: Axis Axis :DUT B: Enable Valid :B
MC_ReadStatus_JEC
ContinuousMotion :B
SynchronizedMotion :B
Error :B
ErrorID :UW
ErrorStop :B
Disabled :B Stopping :B
Homing :B
StandStill :B
DiscreteMotion :B
(1) (3) (4) (5) (6) (7) (8) (9) (10) (11) (12) (13)
Symbol [Structured Text]
MC_ReadStatus_JEC (Axis, Enable, Valid, Error, ErrorID, ErrorStop, Disabled, Stopping, Homing, Standstill, DiscreteMotion, CoutinuousMotion, SynchronizedMotion)
50
3 FB LIBRARY
3.2 Details of the FB Library
Labels
I/O label
No. Variable name Name Data type Setting range Description
(1) Axis Axis information AXIS _REF_JEC Page 59 AXIS_REF_JEC (Axis information)
Input labels (Load: П: Always, : Only at start)
No. Variable name Name Data type Import Setting
range
(2) Enable Enable Bit ON, OFF ON: The FB is executed.
Output labels
No. Variable name Name Data type Default value Description
(3) Valid Output value valid Bit OFF During ON, the output value is valid. (4) Error Error B it OFF When ON, it indicat es that an error ha s occurred in
(5) ErrorID Error code Word [unsigned] 0 The error code generated in the FB is returned. (6) ErrorStop ErrorStop status Bit OFF It indicates that the axis is in the ErrorStop status.
(7) Disabled Disabled status Bit OFF It indicates that the axis is in the Disabled status.
(8) Stopping Stopping status Bit OFF It indicates that the axis is in the Stopping status.
(9) Homing Homing status Bit OFF It indicates that the axis is in the Homing status.
(10) Standstill StandStill status Bit OFF It indicates that the axis is in the Standstill status.
(11) DiscreteMotion DiscreteMotion
status
(12) ContinuousMotion ContinuousMotion
status
(13) SynchronizedMotion SynchronizedMotion
status
Bit OFF It indicates that the axis is in the DiscreteMotion
Bit OFF It indicates that the axis i s in the Continuo usMotion
Bit OFF It indicates that the axis is in the
Description
the FB.
Refer to Page 20 FB status diagram.
Refer to Page 20 FB status diagram.
Refer to Page 20 FB status diagram.
Refer to Page 20 FB status diagram.
Refer to Page 20 FB status diagram.
status. Refer to Page 20 FB status diagram.
status. Refer to Page 20 FB status diagram.
SynchronizedMotion status.
3
3 FB LIBRARY
3.2 Details of the FB Library
51
Function overview
Enable
Status of AxisStatus
Valid
Error
ErrorID
Any of signals turns ON.
0
Enable
Status of AxisStatus
Valid
Error
ErrorID
0 Error code
Item Description
Applicable hardware and software
Language Structured Text Number of basic steps 416 steps Function description This FB reads the status of the specified axis.
Restrictions and precautions • The output label SyncronizedMotion is always OFF. FB operation type Pulsed execution (multiple scan execution type) Timing chart [Normal completion]
Applicable CPU QnUDVCPU Applicable engineering tool GX Works2
The FB is executed when Enable turns ON, and the status is consecutively read. When the status is normally read, one of the output labels turns ON and indicates the status. Read data is always updated while Valid is ON. When an error has occurred in the FB, this FB turns ON Error and stores an error code in ErrorID. For details of error codes, refer to Page 61 Troubleshooti ng.
[Error completion]
52
3 FB LIBRARY
3.2 Details of the FB Library

MC_ReadAxisInfo (Axis Information Read)

DUT: Axis Axis :DUT B: Enable Valid :B
Error :B
ErrorID :UW
HomeAbsSwitch :B
LimitSwitchPos :B
LimitSwitchNeg :B
CommunicationReady :B
ReadyForPowerOn :B
PowerOn :B
IsHomed :B
AxisWarning :B
MC_ReadAxisInfo_JEC
(5)
(4)
(3)
(1)
(2)
(1)
(9)
(8)
(7)
(6)
(13)
(12)
(11)
(10)
Name
MC_ReadAxisInfo_JEC
Overview
Item Description
Function overview Reads the axis information of the specified axis. Symbol
[Structured Ladder]
3
Symbol [Structured Text]
MC_ReadAxisInfo_JEC (Axis, Enable, Valid, Error, ErrorID, HomeAbsSwitch, LimitSwitchPos, LimitSwitchNeg, CommunicationReady, ReadyForPowerOn, PowerOn, IsHomed, AxisWarning)
Labels
I/O label
No. Variable name Name Data type Setting range Description
(1) Axis Axis information AXIS_REF_JEC Page 59 AXIS_REF_JEC (Axis information)
Input labels (Load: П: Always, : Only at start)
No. Variable name Name Data type Import Setting
range
(2) Enable Enable Bit ON, OFF ON: The FB is executed.
Output labels
No. Variable name Name Data type Default value Description
(3) Valid Output value valid Bit OFF During ON, the output value is valid. (4) Error Error Bit OFF When ON, it indicates that an error has occurred
(5) ErrorID Error code Word [unsigned] 0 The error code generated in the FB is returned. (6) HomeAbsSwitch Proximity dog signal Bit OFF It indicates the status of the proximity dog signal. (7) LimitSwitchPos Positive limit signal Bit OFF It indicates the status of the hardware stroke limit
(8) LimitSwitchNeg Negative limit signal Bit OFF It indicates the status of the hardware stroke limit
(9) CommunicationReady Communication
(10) ReadyForPowerOn Ready for operation Bit OFF It indicates the ready for operation status. (11) PowerOn Operable Bit OFF It indicates the operable status. (12) IsHomed Home position valid Bit OFF It indicates that the home position return is
(13) AxisWarning Axis warning Bit OFF It indicates the axis warning status.
ready
Bit OFF It indicates the communication ready status.
Description
in the FB.
signal in the positive direction.
signal in the negative direction.
completed.
3 FB LIBRARY
3.2 Details of the FB Library
53
Function overview
Enable
Status of each signal
Valid
Error
ErrorID
Each signal status is output.
0
Enable
Status of each signal
Valid
Error
ErrorID 0 Error code
Item Description
Applicable hardware and software
Language Structured Text Number of basic steps 235 steps Function description This FB is executed when Enable turns ON, and the axis information of the specified axis is read.
Restrictions and precautions The status of Control input 5 (Control DI5: bit 11) is output to Proximity dog signal (HomeAbsSwitch). FB operation type Pulsed execution (multiple scan execution type) Timing chart [Normal completion]
Applicable CPU QnUDVCPU Applicable engineering tool GX Works2
Read data is always updated while Valid is ON. When an error has occurred in the FB, this FB turns ON Error and stores an error code in ErrorID. For details of error codes, refer to Page 61 Troubleshooti ng.
[Error completion]
54
3 FB LIBRARY
3.2 Details of the FB Library

MC_ReadAxisError (Axis Error Read)

DUT: Axis Axis :DUT B: Enable Valid :B
Error :B
ErrorID :UW
AxisErrorID :UW
MC_ReadAxisError_JEC
(5)
(4)
(6)
(2)
(1)
(3)
(1)
Name
MC_ReadAxisError_JEC
Overview
Item Description
Function overview Reads the error number of the specified axis. Symbol
[Structured Ladder]
3
Symbol [Structured Text]
MC_ReadAxisError_JEC (Axis, Enable, Valid, Error, ErrorID, AxisErrorID)
Labels
I/O label
No. Variable name Name Data type Setting range Description
(1) Axis Axis information AXIS_REF_JEC Page 59 AXIS_REF_JEC (Axis information)
Input labels (Load: П: Always, : Only at start)
No. Variable name Name Data type Import Setting
range
(2) Enable Enable Bit ON, OFF ON: The FB is executed.
Output labels
No. Variable name Name Data type Default value Description
(3) Valid Output value valid Bit OFF During ON, the output value is valid. (4) Error Error Bit OFF When ON, it indicates that an error has occurred in
(5) ErrorID Error code Word [unsigned] 0 The error code generated in the FB is returned. (6) AxisErrorID Axis error No. Word [unsigned] 0 The error code of the axis is returned.
Description
the FB.
3 FB LIBRARY
3.2 Details of the FB Library
55
Function overview
Item Description
Applicable hardware and software
Language Structured Text Number of basic steps 103 steps Function description This FB reads the error number of the specified axis.
Restrictions and precautions FB operation type Pulsed execution (multiple scan execution type) Timing chart [Normal completion]
Applicable CPU QnUDVCPU Applicable engineering tool GX Works2
The FB is executed when Enable turns ON, and the error number of the specified axis is read. Read data is always updated while Valid is ON. When no error has occurred in the specified axis, 0 is returned to AxisErrorID. When an error has occurred in the FB, this FB turns ON Error and stores an error code in ErrorID. For details of error codes, refer to Page 61 Troubleshooti ng.
Enable
AxisErrorID
Valid
Error
ErrorID
[Error completion]
Enable
AxisErrorID
Valid
Error
ErrorID
Axis error No.
0
0
Error code
56
3 FB LIBRARY
3.2 Details of the FB Library

MC_Reset (Axis Error Reset)

DUT: Axis Axis :DUT B: Execute Done : B
Busy :B Error :B
ErrorID :UW
MC_Reset_JEC
(5) (6)
(4)
(3)
(1)
(2)
(1)
Name
MC_Reset_JEC
Overview
Item Description
Function overview Clears the error of the specified axis. Symbol
[Structured Ladder]
3
Symbol [Structured Text]
MC_ Reset_JEC (Axis, Execute, Done, Busy, Error, ErrorID)
Labels
I/O label
No. Variable name Name Data type Setting range Description
(1) Axis Axis information AXIS_REF_JEC Page 59 AXIS_REF_JEC (Axis information)
Input labels (Load: П: Always, : Only at start)
No. Variable name Name Data type Import Setting
range
(2) Execute Execution command Bit ON, OFF ON: The FB is executed.
Output labels
No. Variable name Name Data type Default value Description
(3) Done Execution
completion (4) Busy Executing Bit OFF It indicates that the FB is in execution. (5) Error Error Bit OFF When ON, it indicates that an error has occurred in
(6) ErrorID Error code Word [unsigned] 0 The error code generated in the FB is returned.
Bit OFF It indicates that the reset is completed.
Description
the FB.
3 FB LIBRARY
3.2 Details of the FB Library
57
Function overview
Item Description
Applicable hardware and software
Language Structured Text Number of basic steps 228 steps Function description This FB clears an error (alarm) of the specified axis.
Restrictions and precautions For how to eliminate error causes, refer to the instruction manual of the servo amplifier in use. FB operation type Pulsed execution (multiple scan execution type) Timing chart [Normal completion]
Applicable CPU QnUDVCPU Applicable engineering tool GX Works2
The FB is executed when Execute turns ON, and Busy turns ON when the processing is started. Done turns ON when the error of the axis is cleared. If Execute is turned ON while the error cause of the axis still remains, the error is not cleared. In this case, Busy remains ON. Turn OFF Execute once and turn ON it after clearing the error cause. When an error has occurred in the FB, this FB turns ON Error and stores an error code in ErrorID. For details of error codes, refer to Page 61 Troubleshooti ng.
Execute
Busy
Done
Error
ErrorID 0
[Error completion]
Execute
Busy
Done
Error
ErrorID
Error code
58
3 FB LIBRARY
3.2 Details of the FB Library
3.3 List of Structures
The following table lists the structures used in each library.
Structure name Description Version
AXIS_REF_JEC Axis information (MotionControl_JEC) 00A

AXIS_REF_JEC (Axis information)

Name
AXIS_REF_JEC
Labels
Label name Data type Access Type Description
AxisNo Word [signed] Read/Write The axis number of the control target is specified.
PosTrqLimit Single-precision real
number
NegTrqLimit Single-precision real
number
WaitTime Word [unsigned] Read/Write The adjustment value of the transmission delay time is specified.
FbExecCount Word [signed] Read only Function block execution counter
Read/Write Forward torque limit value is specified.
Read/Write Reverse torque limit value is specified.
[Setting range] 1 to 16
[Setting range] 0 to 1000.0 [%]
[Setting range] 0 to 1000.0 [%]
[Setting range] 0 to 30000 (ms)
3
3 FB LIBRARY

3.3 List of Structures

59
3.4 List of Global Labels

MC_DIRECTION (Direction Selection)

Name
MC_DIRECTION_JEC
Overview
This parameter is used to specify the travel direction of when the unit is "degree".
Labels
Label name Data type Access Type Constant Description
mcPositiveDirection Word [signed] Read only 1 The axis rotates and moves in the address increasing
mcNegativeDirection Word [signed] Read only 2 The axis rotates and moves in the address decreasing
mcShortestWay Word [signed] Read only 3 The axis rotates and moves from the current position
mcCurrentDirection Word [signed] Read only 4 The axis rotates and moves to the commanded
direction regardless of the position data sign.
direction regardless of the position data sign.
to the commanded position by taking a shortcut in a direction of shorter distance. If the distance from the current position to the commanded position is the same in the CCW direction and the CW direction, the axis rotates and moves in the CCW direction.
position in the direction specified with the position data sign.
60
3 FB LIBRARY

3.4 List of Global Labels

3.5 Troubleshooting

List of error codes

Error code (Hexadecimal)
1100 A value out of the range is set as an axis number. Correct the axis number.
1103 A value out of the range is set as a commanded position or
1107 A value out of the range is set to a rotation direction. Correct the rotatio n di rection value to a value defined with
110E A value out of the range is set as the forward torque limit
1202 An error occurred. Eliminate the error and execute the FB again. 1203 The FB cannot be executed. Execute the control FB again after the control in execution is completed.
1204 The axis is in the Stopping status. Execute the FB again after changing the axis status to StandStill.
Description Remedy
1 to 16 * Even if the axis number is set within the range, the FB may not operate depending on the system configuration.
Review and correct a value of the commanded position or travel distance.
travel distance.
MC_DIRECTION. Review the torque limit value.
value or the reverse torque limit value.
Do not execute another MC_Halt while MC_Halt is in execution.
3
3 FB LIBRARY

3.5 Troubleshooting

61
MEMO
62
3 FB LIBRARY
3.5 Troubleshooting

INSTRUCTION INDEX

M
MC_Halt_JEC. . . . . . . . . . . . . . . . . . . . . . . . . . 29
MC_MoveAbsolute_JEC . . . . . . . . . . . . . . . . . . 32
MC_MoveAdditive_JEC. . . . . . . . . . . . . . . . . . . 36
MC_MoveRelative_JEC. . . . . . . . . . . . . . . . . . . 34
MC_MoveVelocity_JEC. . . . . . . . . . . . . . . . . . . 38
MC_Power_JEC . . . . . . . . . . . . . . . . . . . . . . . . 23
MC_ReadActualPosition_JEC . . . . . . . . . . . . . . 44
MC_ReadActualTorque_JEC . . . . . . . . . . . . . . . 48
MC_ReadActualVelocity_JEC . . . . . . . . . . . . . . 46
MC_ReadAxisError_JEC . . . . . . . . . . . . . . . . . . 55
MC_ReadAxisInfo_JEC. . . . . . . . . . . . . . . . . . . 53
MC_ReadStatus_JEC . . . . . . . . . . . . . . . . . . . . 50
MC_Reset_JEC . . . . . . . . . . . . . . . . . . . . . . . . 57
MC_Stop_JEC . . . . . . . . . . . . . . . . . . . . . . . . . 27
MC_TorqueControl_JEC . . . . . . . . . . . . . . . . . . 41
MCv_Home_JEC . . . . . . . . . . . . . . . . . . . . . . . 25
I
63
MEMO
64

REVISIONS

*The manual number is given on the bottom left of the back cover.
Revision date *Manual number Description
May 2017 BCN-B62005-824-A First edition June 2018 BCN-B62005-824-B Added or modified parts
Section 3.2
Japanese manual number: BCN-B62005-823-B
This manual confers no industrial property rights of any other kind, nor does it confer any patent licenses. Mitsubishi Electric Corporation cannot be held responsible for any problems involving industrial property rights which may occur as a result of using the contents noted in this manual.
2017 MITSUBISHI ELECTRIC CORPORATION
65

TRADEMARKS

Ethernet is a registered trademark of Fuji Xerox Corporation in Japan. PLCopen and related logos are registered trademarks of PLCopen The company names, system names and product names mentioned in this manual are either registered trademarks or trademarks of their respective companies. In some cases, trademark symbols such as '
' or '' are not specified in this manual.
.
66
BCN-B62005-824-B(1806)MEE
Specifications subject to change without notice.
When exported from Japan, this manual does not require application to the Ministry of Economy, Trade and Industry for service transaction permission.
HEAD OFFICE : TOKYO BUILDING, 2-7-3 MARUNOUCHI, CHIYODA-KU, TOKYO 100-8310, JAPAN NAGOYA WORKS : 1-14 , YADA-MINAMI 5-CHOME , HIGASHI-KU, NAGOYA , JAPAN
Loading...