EtherNet/IP - Keyence PLC Commands¶
This section mainly covers the introduction of Mech-Center standard interface EtherNet/IP, command descriptions, and description of the status codes.
The EtherNet/IP Standard Interface provides the following function blocks:
Introduction¶
Mech-Center standard interface EtherNet/IP¶
Mech-Center supports communication via EtherNet/IP. Functioning as a server, Mech-Center provides a standard interface using EtherNet/IP, and utilizes an EDS device description file to initialize communication with the client, i.e., the EtherNet/IP scanner of the robot controller.
You can configure options related to EtherNet/IP in the deployment settings of Mech-Center.
The following figure shows an example of settings on the Ixxat INpact EtherNet/IP(TM).
Hint
For detailed instructions of the above settings, please refer to EtherNet/IP - KEYENCE PLC Setup Instructions.
Mech-Mind - Keyence KV STUDIO EtherNet/IP Interface¶
PLC routine files:
CameraSignalsMove.mod (used to send signals of the vision system)
CameraTest.mod (used for testing of the vision system)
MM_XXX_XXX.kfb (used to execute commands with different functions of the standard interface)
The files are stored in XXXX/Mech-Center-xxx/Robot_Interface/EthernetIP/Programming Samples/Keyence KV-8000 PLC EthernetIP in the installation directory of Mech-Center. Please copy and paste all files to the computer with KV STUDIO installed.
Command Descriptions¶
Start Mech-Vision Project¶
This function block is used for applications that use Mech-Vision but not Mech-Viz. It runs the corresponding Mech-Vision project to acquire and process data.
Variables
INPUT
Name |
Description |
Vision_Proj_Num |
Mech-Vision Project ID |
Can be checked and adjusted in |
|
Req_Pose_Num |
Number of vision results for Mech-Vision to send, from 0 to 20, where 0 means “send all” |
Robot_Pose_Type |
Set the image-capturing pose for the robot to send, from 0 to 2 |
0: Do not send image-capturing pose (for Eye To Hand) 1: Send image-capturing pose as joint positions 2: Send image-capturing pose as robot flange pose |
|
Robot_Pose |
The image-capturing pose received from the robot. The data type of the pose is Array[0..5] of DINT. |
The floating-point numbers that represent JPs or the robot flange pose need to times 10000 to be converted into 32-bit signed integers before being assigned to the array. |
|
Start_Vision |
Trigger Mech-Vision project to start when a rising edge occurs |
System variable
Name |
Description |
FromCamera.STATUS_CODE |
If the project is started successfully, the status code 1102 will be returned. Otherwise, the corresponding error code will be returned. |
Example
This example starts Mech-Vision project No. 1 when there is a rising edge on the variable Camera_User.Start_Vision, and asks the project to send over 1 vision result, and the PLC will send the joint positions at the moment when the project is started to Mech-Center.
Get Vision Target(s)¶
This function block is for applications that use Mech-Vision but not Mech-Viz. It obtains the vision result from the corresponding Mech-Vision project.
Variables
INPUT
Name |
Description |
Vision_Proj_Num |
Mech-Vision Project ID |
Can be checked and adjusted in |
|
Get_VisData |
Obtain vision results from Mech-Vision project when a rising edge occurs |
Data_Ready |
Indicate that all the pose data is available to read when receiving multiple groups of robot poses |
Send_Pose_Num |
The number of target objects recognized by Mech-Vision, from 0 to 20 |
Start_Empty |
Clear the obtained data stored in Target_Pose and Target_Label. This variable will take effect when it is set to 1. |
OUTPUT
Name |
Description |
Target_Pose |
The pose of the pick point. The data type is Array[0..19, 0..5] of DINT. |
The data from this variable should be divided by 10000 before using |
|
Target_Label |
The label information of the object recognized by Mech-Vision. The data type is Array[0..19] of UDINT. The returned values are integers. |
System variables
Name |
Description |
FromCamera.STATUS_CODE |
If the vision results are obtained successfully, the status code 1100 will be returned. Otherwise, the corresponding error code will be returned. |
FromCamera.SEND_POSE_TYPE |
The returned value is 2, which suggests that the type of poses obtained via MM_Get_VisData is always in TCP. |
Example
When there is a rising edge on the variable Camera_User.Get_VisData, vision results of Mech-Vision project No. 1 will be obtained. When Camera_User.Start_Empty is set to 1, data stored in Camera_User.Target_Pose and Camera_User.Target_Label will be cleared.
Switch Mech-Vision Recipe¶
This function block specifies which parameter recipe of the Mech-Vision project to use. For more information on parameter recipe, please see Parameter Recipe.
Note
This function block must be used BEFORE MM_Start_Vis.
The corresponding Mech-Vision project must have parameter recipes already configured and saved.
Variables
INPUT
Name |
Description |
Vision_Proj_Num |
Mech-Vision Project ID |
Can be checked and adjusted in |
|
Vision_Recipe_Num |
The number of a parameter recipe in the Mech-Vision project |
Switch_Recipe |
Switch the parameter recipe when a rising edge occurs |
System variable
Name |
Description |
FromCamera.STATUS_CODE |
If the parameter recipe is switched successfully, the status code 1107 will be returned. Otherwise, the corresponding error code will be returned. |
Example
When there is a rising edge on the variable Camera_User.Switch_Recipe, the parameter recipe will be switched to No. 2 in Mech-Vision project No. 1.
Start Mech-Viz Project¶
This function block is for applications that use both Mech-Vision and Mech-Viz. It runs the corresponding Mech-Viz project (which triggers the corresponding Mech-Vision project to run), and then plans the path for picking.
Variables
INPUT
Name |
Description |
Robot_Pose_Type |
Set the type of robot pose, from 0 to 1 |
0: The simulated robot in Mech-Viz will start from the position [0,0,0,0,0,0] (in JPs) and then move to the first target 1: The simulated robot in Mech-Viz will start from the current JPs of the real robot and then move to the first target When there is a collision model in the scene which may lead to collision, it is recommended to set the variable to 1 |
|
Robot_Pose |
The current pose in JPs of the robot. The data type of the pose is Array[0..5] of DINT. |
The floating-point numbers that represent JPs or the robot flange pose need to times 10000 to be converted into 32-bit signed integers before being assigned to the array. |
|
Start_Viz |
Trigger Mech-Viz project to start when a rising edge occurs |
System variable
Name |
Description |
FromCamera.STATUS_CODE |
If the project is started successfully, the status code 2103 will be returned. Otherwise, the corresponding error code will be returned. |
Example
When there is a rising edge on the variable Camera_User.Start_Viz, Mech-Viz project will be started and send the current JPs of the robot to Mech-Center.
Stop Mech-Viz Project¶
This function block is used to stop Mech-Viz project. Please use this function block only when there is an infinite loop in the project or the project cannot be stopped properly.
Variables
INPUT
Name |
Description |
Stop_Viz |
Stop Mech-Viz project when a rising edge occurs |
System variable
Name |
Description |
FromCamera.STATUS_CODE |
If the project is stopped successfully, the status code 2104 will be returned. Otherwise, the corresponding error code will be returned. |
Example
When there is a rising edge on the variable Camera_User.Stop_Viz, Mech-Viz project will be stopped.
Select Mech-Viz Branch¶
This function block is used to select along which branch the Mech-Viz project should proceed. Such branching is achieved by adding branch_by_msg Task(s) to the project. This function block specifies which exit port such Task(s) should take.
Note
MM_Start_Viz must be used BEFORE this function block.
When the next Task to be executed in Mech-Viz is a branch_by_msg Task, Mech-Viz will wait for this function block to send the exit port number it should take.
The name of all branch_by_msg Tasks in the Mech-Viz project must be changed to integers between 1 and 99, and the names should be unique among all Tasks in the project.
Variables
INPUT
Name |
Description |
Branch_Name |
Task ID of Task branch_by_msg. The Task ID can be read in the Task’s parameters. |
Branch_Exit_Port |
The selected output port of the branch_by_msg Task |
Please add 1 to the port number displayed in Mech-Viz to get the value here. For example, the port 0 displayed in the interface corresponds to Branch_Exit_Port 1. |
|
Set_Branch |
Specify the port which branch_by_msg Task should take |
Attention
The corresponding relationships of different variables are as shown in the table below. If the values of the variables are not the same, they cannot be effective at the same time.
FB/Struct |
Variable |
|
MM_Set_Branch |
Branch_Name |
Branch_Exit_Port |
MM_Set_Index |
Index_Name |
Index_Counter |
ToCamera |
VIZ_TASK_NAME |
VIZ_TASK_VALUE |
System variable
Name |
Description |
FromCamera.STATUS_CODE |
If the branch is set successfully, the status code 2105 will be returned. Otherwise, the corresponding error code will be returned. |
Example
When there is a rising edge on the variable Camera_User.Set_Branch, Mech-Viz will take exit port 1 for the branch_by_msg Task named 1.
Set Move Index¶
This function block sets the value for the Current Index parameter of Mech-Viz Tasks. Tasks that have this parameter include move_list, move_grid, custom_pallet_pattern, and smart_pallet_pattern.
Note
MM_Start_Viz must be called BEFORE this function block.
The name of all Tasks with index parameters in the Mech-Viz project must be changed to integers between 1 and 99, and the names should be unique among all Tasks in the project.
Variables
INPUT
Index_Name
Task ID of the Task with the index parameter. The Task ID can be read in the Task’s parameters.
Index_Counter
The index value that should be set the next time this Task is executed.
When this command is sent, the current index value in Mech-Viz will become the parameter value minus 1.
When the Mech-Viz project runs to the task specified by this command, the current index value in Mech-Viz will be increased by 1 to become the parameter’s value.
Set_Index
The trigger signal to set the index. The rising edge does the trigger.
Attention
The corresponding relationships of different variables are as shown in the table below. If the values of the variables are not the same, they cannot be effective at the same time.
FB/Struct |
Variable |
|
MM_Set_Branch |
Branch_Name |
Branch_Exit_Port |
MM_Set_Index |
Index_Name |
Index_Counter |
ToCamera |
VIZ_TASK_NAME |
VIZ_TASK_VALUE |
System variable
Name |
Description |
FromCamera.STATUS_CODE |
If the index is set successfully, the status code 2106 will be returned. Otherwise, the corresponding error code will be returned. |
Example
When there is a rising edge on the variable Camera_User.Set_Index, the Current Index value for the Task named 5 will be set to 4. When the Task is executed, the Current Index value will be added 1 and become 5.
Get Planned Path¶
This function block obtains the planned path from Mech-Viz.
Note
If one of the targets in the path is not supposed to be sent to the robot, please clear the parameter “Send Target” checkbox of the corresponding move-type Task.
Variables
INPUT
Name |
Description |
Request_Pose_Type |
Whether Mech-Viz should send targets as joint positions or TCPs, 1 or 2 |
1: Mech-Viz sends joint positions 2: Mech-Viz sends TCPs |
|
Get_VizData |
Obtain planned path from Mech-Viz project when a rising edge occurs |
Data_Ready |
Indicate that all the pose data is available to read when receiving multiple groups of robot poses |
Send_Pose_Num |
The number of targets returned by Mech-Viz, from 0 to 20 |
Start_Empty |
Clear the obtained data stored in Target_Pose, Target_Label, and Speed_Percentage.This variable will take effect when it is set to 1. |
OUTPUT
Name |
Description |
Target_Pose |
The pose of the pick point in TCP. The data type is Array[0..19, 0..5] of DINT. |
The data from this variable should be divided by 10000 before using. |
|
Target_Label |
The label information of the object recognized by Mech-Vision. The data type is Array[0..19] of UDINT. The returned values are integers. |
Target_Speed |
The speed set in the Task related to move, from 1 to 100. |
System variables
Name |
Description |
FromCamera.STATUS_CODE |
If the planned path is obtained successfully, the status code 2100 will be returned. Otherwise, the corresponding error code will be returned. |
FromCamera.SEND_POSE_TYPE |
The data type of the targets, which is the same as the setting on Request_Pose_Type. |
FromCamera.VISUAL_POINT_INDEX |
The position of the vision point, which is generated from the visual_move Task, in the planned path. |
Example
When there is a rising edge on the variable Camera_User.Get_VizData, targets in TCP of Mech-Viz project will be obtained. When Camera_User.Start_Empty is set to 1, data stored in Camera_User.Target_Pose, Camera_User.Target_Label, and Camera_User.Speed_Percentage will be cleared.
Get DO Signal List¶
This function block obtains the planned DO Signal list for controlling multiple sections of a sectioned vacuum gripper.
Note
MM_Get_VizData must be used BEFORE this function block.
Please deploy the Mech-Viz project based on the template project in XXXX\Mech-Center-xxx\tool\viz_project\suction_zone, and set the suction cup configuration file in the Mech-Viz project.
Variables
INPUT
Name |
Description |
Get_DoList |
Obtain the planned DO Signal list when a rising edge occurs |
System variables
Name |
Description |
FromCamera.STATUS_CODE |
If the DO Signal list is obtained successfully, the status code 2102 will be returned. Otherwise, the corresponding error code will be returned. |
FromCamera.DO_LIST |
Return 64 DO port values. |
Example
When there is a rising edge on the variable Camera_User.Get_DoList, the DO signal list planned by Mech-Viz will be stored in DO array.
Input Object Dimensions to Mech-Vision¶
This function block inputs object dimensions to the Mech-Vision project.
Note
This function block must be used BEFORE MM_Start_Vis.
Variables
INPUT
Name |
Description |
Vision_Proj_Num |
Mech-Vision Project ID, from 1 to 99 |
Can be checked and adjusted in |
|
External_Input_Box_Dimention |
Dimensions of the object in mm |
Set_Box_Dimention |
Input the object dimensions in the Mech-Vision project dynamically when a rising edge occurs |
Attention
The corresponding relationships of different variables are as shown in the table below. If the values of the variables are not the same, they cannot be effective at the same time.
FB/Struct |
Variable |
MM_Set_Box_Dimention |
External_Input_Box_Dimention |
MM_Set_Pose |
External_Input_Pose |
ToCamera |
EXT_INPUT_DATA |
System variable
Name |
Description |
FromCamera.STATUS_CODE |
If the object dimensions are set successfully, the status code 1108 will be returned. Otherwise, the corresponding error code will be returned. |
Example
When there is a rising edge on the variable Camera_User.Set_Box_Dimention, the object dimensions in the Step Read Object Dimensions will be set as the values assigned in External_Input_Box_Dimention[0-2].
Input TCP to Mech-Viz¶
This function block inputs TCP data to the outer_move Task.
Note
This function block must be called BEFORE MM_Start_Viz.
Please deploy the Mech-Viz project based on the template project in XXXX\Mech-Center-xxx\tool\viz_project\outer_move, and put the outer_move Task at a proper position in the workflow.
Variables
INPUT
Name |
Description |
External_Input_Pose |
TCP of the robot in mm |
Set_Input_Pose |
Input the poses to Mech-Viz dynamically when a rising edge occurs. |
Attention
The corresponding relationships of different variables are as shown in the table below. If the values of the variables are not the same, they cannot be effective at the same time.
FB/Struct |
Variable |
MM_Set_Box_Dimention |
External_Input_Box_Dimention |
MM_Set_Pose |
External_Input_Pose |
ToCamera |
EXT_INPUT_DATA |
System variable
Name |
Description |
FromCamera.STATUS_CODE |
If the object pose is input successfully, the status code 2107 will be returned. Otherwise, the corresponding error code will be returned. |
Example
When there is a rising edge on the variable Camera_User.Set_Input_Pose, the TCP data stored in External_Input_Pose[0-5] will be sent to the outer_move task in the Mech-Viz project.
Get Software Status¶
This function block is currently capable of checking whether Mech-Vision is ready to run projects. In the future, this function block can be used for obtaining the execution status of Mech-Vision, Mech-Viz and Mech-Center.
Variables
INPUT
Name |
Description |
Get_Status |
Check whether Mech-Vision is ready to run projects when a rising edge occurs. |
System variable
FromCamera.STATUS_CODE
Software status. 1101 means the Mech-Vision project is ready to run. Other codes mean the project is not ready.
Example
When there is a rising edge on the variable Camera_User.Get_Status, the system status code will be returned and stored in the variable FromCamera.STATUS_CODE.
Description of the Status Codes¶
Please refer to Status Codes and Trouble Shooting for detailed information.