OVERVIEW 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 control mode of the servo amplifier MR-JE-C.
• 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 conditions. • Mitsubishi Electric Corporation will not compensate any damages caused by the FBs. • Contents may be deleted or changed without prior notice.
FUNCTION DESCRIPTION Program This FB library includes the sample programs which can be used in the configuration described in "Page 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...
Program Details (Sample/PrgAxis1) 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. 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. Set the servo amplifier in the servo ON status.
Page 10
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. 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.
Page 11
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. Monitor the current position, velocity, and torque.
Page 12
Monitor the axis information and status. When the Monitor label is turned ON, monitoring the axis information and status is started. 2 FUNCTION DESCRIPTION 2.2 Program Details (Sample/PrgAxis1)
FB Operation 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.
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. Set the IP address of the CPU module (QnUDVCPU). [Navigation] window ...
Page 15
Configure the settings 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. •...
Page 16
Set the global label. 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"...
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 Open the project (MotionControl_JEC_FBs_Q.gxw). Select "User Library"...
Page 18
After the library became editable, right-click the library and select "Save as" from the menu. 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. 2 FUNCTION DESCRIPTION 2.4 How to Use FB Library...
Installing the user library Create a new project with the following setting. Type: the model when the library is saved, Project Type: Structured Project, Language: Structured Ladder/FBD Select "User Library" in "Navigation", and select "Install" from the library menu. Select the saved library in the following dialog. 2 FUNCTION DESCRIPTION 2.4 How to Use FB Library...
Page 20
When the library has been installed normally, the following message appears and the library appears on the tree. 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. 2 FUNCTION DESCRIPTION 2.4 How to Use FB Library...
FB LIBRARY 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.
FB status diagram 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. MC_MoveAbsolute MC_MoveRelative MC_MoveAdditive...
Unit The following table lists the units used in this FB library. Item Description Control unit degree, pulse Positioning range • -360000 to 360000 (10 degree) • -999999 to 999999 (pulse) Velocity command 0.00 to 167772.15 (r/min) Set a value within the permissible speed of the servo motor. Acceleration/ Position control deceleration time...
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 devices which 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 ...
Details of the FB Library 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 MC_Power_JEC [Structured Ladder] DUT: Axis Axis :DUT B: Enable Status :B Error :B ErrorID :UW Symbol...
Page 26
Function overview Item Description Applicable hardware and Applicable CPU QnUDVCPU software Applicable engineering tool GX Works2 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. While Enable is ON, the specified axis is in the servo ON status.
MCv_Home (Home Position Return) Name MCv_Home_JEC Overview Item Description Function overview Executes the home position return of the specified axis. Symbol MCv_Home_JEC [Structured Ladder] DUT: Axis Axis :DUT B: Execute Done :B Busy :B Error :B ErrorID :UW Symbol MCv_Home_JEC (Axis, Execute, Done, Busy, Error, ErrorID) [Structured Text] Labels ■I/O label...
Page 28
Function overview Item Description Applicable hardware and Applicable CPU QnUDVCPU software Applicable engineering tool GX Works2 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. This FB is executed when Execute turns ON.
MC_Stop (Forced Stop) Name MC_Stop_JEC Overview Item Description Function overview Forcibly stops the specified axis. Symbol MC_Stop_JEC [Structured Ladder] DUT: Axis Axis :DUT B: Execute Done :B Busy :B Error :B ErrorID :UW Symbol MC_Stop_JEC (Axis, Execute, Done, Busy, Error, ErrorID) [Structured Text] Labels ■I/O label...
Page 30
Function overview Item Description Applicable hardware and Applicable CPU QnUDVCPU software Applicable engineering tool GX Works2 Language Structured Text Number of basic steps 436 steps Function description This FB stops the control of the specified axis and changes the axis status to Stopping. This FB aborts the motion FBs in execution.
MC_Halt (Stop) Name MC_Halt_JEC Overview Item Description Function overview Stops the specified axis. Symbol MC_Halt_JEC [Structured Ladder] DUT: Axis Axis :DUT B: Execute Done :B D: Deceleration Busy :B CommandAborted :B Error :B ErrorID :UW Symbol MC_Halt_JEC (Axis, Execute, Deceleration, Done, Busy, CommandAborted, Error, ErrorID) [Structured Text] Labels ■I/O label...
Page 32
Function overview Item Description Applicable hardware and Applicable CPU QnUDVCPU software Applicable engineering tool GX Works2 Language Structured Text Number of basic steps 592 steps Function description This FB stops the control of the specified axis. 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.
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 MC_MoveAbsolute_JEC [Structured Ladder] DUT: Axis Axis :DUT B: Execute Done :B L: Position Busy :B L: Velocity CommandAborted :B (10) D: Acceleration...
Page 35
Function overview Item Description Applicable hardware and Applicable CPU QnUDVCPU software Applicable engineering tool GX Works2 Language Structured Text Number of basic steps 1245 steps Function description This FB executes positioning of the specified axis to the commanded absolute position. This FB is executed when Execute turns ON, and Busy turns ON when the processing is normally started.
MC_MoveRelative (Relative Value Positioning) Name MC_MoveRelative_JEC Overview Item Description Function overview Moves an axis for the specified distance from the current position. Symbol MC_MoveRelative_JEC [Structured Ladder] DUT: Axis Axis :DUT B: Execute Done :B L: Distance Busy :B L: Velocity CommandAborted :B D: Acceleration Error :B...
Page 37
Function overview Item Description Applicable hardware and Applicable CPU QnUDVCPU software Applicable engineering tool GX Works2 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. This FB is executed when Execute turns ON, and Busy turns ON when the processing is normally started.
MC_MoveAdditive (Commanded Position Change) 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 MC_MoveAdditive_JEC [Structured Ladder] DUT: Axis Axis :DUT B: Execute Done :B L: Distance Busy :B L: Velocity...
Page 39
Function overview Item Description Applicable hardware and Applicable CPU QnUDVCPU software Applicable engineering tool GX Works2 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 positioning.
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 MC_MoveVelocity_JEC [Structured Ladder] DUT: Axis Axis :DUT B: Execute InVelocity :B L: Velocity Busy :B D: Acceleration Active :B D: Deceleration CommandAborted :B (10)
Page 41
Function overview Item Description Applicable hardware and Applicable CPU QnUDVCPU software Applicable engineering tool GX Works2 Language Structured Text Number of basic steps 986 steps Function description This FB controls the velocity of the specified axis to the commanded velocity. This FB is executed when Execute turns ON, and Busy turns ON when the processing is normally started.
Page 42
Item Description Timing chart [Normal completion] Execute Busy Active InVelocity CommandAborted Error ErrorID Velocity [Error completion] Execute Busy Active InVelocity CommandAborted Error Error code ErrorID 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 MC_TorqueControl_JEC [Structured Ladder] DUT: Axis Axis :DUT B: Execute InTorque :B E: Torque Busy :B L: TorqueRamp Active :B L: Velocity CommandAborted :B (10) W: Direction...
Page 44
Function overview Item Description Applicable hardware and Applicable CPU QnUDVCPU software Applicable engineering tool GX Works2 Language Structured Text Number of basic steps 1001 steps Function description This FB controls the specified axis with the specified torque. 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.
Page 45
Item Description Timing chart [Normal completion] Execute Busy Active InTorque CommandAborted Error ErrorID Torque [Error completion] Execute Busy Active InTorque CommandAborted Error Error code ErrorID 3 FB LIBRARY 3.2 Details of the FB Library...
MC_ReadActualPosition (Current Position Read) Name MC_ReadActualPosition_JEC Overview Item Description Function overview Reads the current position of the specified axis. Symbol MC_ReadActualPosition_JEC [Structured Ladder] DUT: Axis Axis :DUT B: Enable Valid :B Error :B ErrorID :UW Position :L Symbol MC_ReadActualPosition_JEC (Axis, Enable, Valid, Error, ErrorID, Position) [Structured Text] Labels ■I/O label...
Page 47
Function overview Item Description Applicable hardware and Applicable CPU QnUDVCPU software Applicable engineering tool GX Works2 Language Structured Text Number of basic steps 150 steps Function description This FB reads the current position of the specified axis. The FB is executed when Enable turns ON, and the current position is read. Read data is always updated while Valid is ON.
MC_ReadActualVelocity (Current Velocity Read) Name MC_ReadActualVelocity_JEC Overview Item Description Function overview Returns the current velocity of the specified axis. Symbol MC_ReadActualVelocity_JEC [Structured Ladder] DUT: Axis Axis :DUT B: Enable Valid :B Error :B ErrorID :UW Velocity :L Symbol MC_ReadActualVelocity_JEC (Axis, Enable, Valid, Error, ErrorID, Velocity) [Structured Text] Labels ■I/O label...
Page 49
Function overview Item Description Applicable hardware and Applicable CPU QnUDVCPU software Applicable engineering tool GX Works2 Language Structured Text Number of basic steps 157 steps Function description This FB reads the current velocity of the specified axis. 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.
MC_ReadActualTorque (Current Torque Read) Name MC_ReadActualTorque_JEC Overview Item Description Function overview Reads the current torque of the specified axis. Symbol MC_ReadActualTorque_JEC [Structured Ladder] DUT: Axis Axis :DUT B: Enable Valid :B Error :B ErrorID :UW Torque :E Symbol MC_ReadActualTorque_JEC (Axis, Enable, Valid, Error, ErrorID, Torque) [Structured Text] Labels ■I/O label...
Page 51
Function overview Item Description Applicable hardware and Applicable CPU QnUDVCPU software Applicable engineering tool GX Works2 Language Structured Text Number of basic steps 113 steps Function description This FB reads the current torque of the specified axis. 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.
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 MC_ReadStatus_JEC [Structured Ladder] DUT: Axis Axis :DUT B: Enable Valid :B Error :B ErrorID :UW ErrorStop :B Disabled :B Stopping :B Homing :B...
Page 53
Labels ■I/O label Variable name Name Data type Setting range Description Page 59 AXIS_REF_JEC (Axis information) Axis Axis information AXIS_REF_JEC ■Input labels (Load: П: Always, : Only at start) Variable name Name Data type Import Setting Description range Enable Enable ON, OFF...
Page 54
Function overview Item Description Applicable hardware and Applicable CPU QnUDVCPU software Applicable engineering tool GX Works2 Language Structured Text Number of basic steps 416 steps Function description This FB reads the status of the specified axis. 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.
MC_ReadAxisInfo (Axis Information Read) Name MC_ReadAxisInfo_JEC Overview Item Description Function overview Reads the axis information of the specified axis. Symbol MC_ReadAxisInfo_JEC [Structured Ladder] DUT: Axis Axis :DUT B: Enable Valid :B Error :B ErrorID :UW HomeAbsSwitch :B LimitSwitchPos :B LimitSwitchNeg :B CommunicationReady :B ReadyForPowerOn :B (10)
Page 56
Function overview Item Description Applicable hardware and Applicable CPU QnUDVCPU software Applicable engineering tool GX Works2 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. Read data is always updated while Valid is ON.
MC_ReadAxisError (Axis Error Read) Name MC_ReadAxisError_JEC Overview Item Description Function overview Reads the error number of the specified axis. Symbol MC_ReadAxisError_JEC [Structured Ladder] DUT: Axis Axis :DUT B: Enable Valid :B Error :B ErrorID :UW AxisErrorID :UW Symbol MC_ReadAxisError_JEC (Axis, Enable, Valid, Error, ErrorID, AxisErrorID) [Structured Text] Labels ■I/O label...
Page 58
Function overview Item Description Applicable hardware and Applicable CPU QnUDVCPU software Applicable engineering tool GX Works2 Language Structured Text Number of basic steps 103 steps Function description This FB reads the error number of the specified axis. 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.
MC_Reset (Axis Error Reset) Name MC_Reset_JEC Overview Item Description Function overview Clears the error of the specified axis. Symbol MC_Reset_JEC [Structured Ladder] DUT: Axis Axis :DUT B: Execute Done :B Busy :B Error :B ErrorID :UW Symbol MC_ Reset_JEC (Axis, Execute, Done, Busy, Error, ErrorID) [Structured Text] Labels ■I/O label...
Page 60
Function overview Item Description Applicable hardware and Applicable CPU QnUDVCPU software Applicable engineering tool GX Works2 Language Structured Text Number of basic steps 228 steps Function description This FB clears an error (alarm) of the specified axis. 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.
List of Structures The following table lists the structures used in each library. Structure name Description Version AXIS_REF_JEC Axis information (MotionControl_JEC) 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. [Setting range] 1 to 16 PosTrqLimit...
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 The axis rotates and moves in the address increasing direction regardless of the position data sign.
Troubleshooting List of error codes Error code Description Remedy (Hexadecimal) 1100 A value out of the range is set as an axis number. Correct the axis number. 1 to 16 * Even if the axis number is set within the range, the FB may not operate depending on the system configuration.
Page 67
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.
Page 68
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. ...
Page 70
BCN-B62005-824-B(1806)MEE 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 When exported from Japan, this manual does not require application to the Ministry of Economy, Trade and Industry for service transaction permission. Specifications subject to change without notice.