2D Robot Vision System Robot Connection Manual (FANUC Edition)
2D Robot Vision System Robot Connection Manual (FANUC Edition)
ROBOT CONNECTION
2 Connecting
Setup to Robots
Procedure
MANUAL
FANUC CORPORATION EDITION 3 Robot Communication
Connecting to Robots Settings
This manual provides support for the necessary robot-side Writing the Communication
settings that must be configured to establish connections and 4 Robot Communication
Program
communication between the XG/CV-X/XG-X Series and a
robot.
Running the Communication
5 Robot Communication
Settings
Program (Only during Setting)
Sample Program
6 Robot
SettingsCommunication
(Only during Operation)
7 Troubleshooting
Settings
English
Japanese(日本語)
Simplified Chinese(简体中文)
・ Secondary damages (such as equipment damage, opportunity loss, and lost profit) and any and all other damages arising from
the settings and programs introduced in this manual are not covered by the warranty.
・ You have to separately create robot movement programs such as those used during actual operations.
・ Proper nouns such as product names included in this manual are trademarks or registered trademarks of their respective
companies. Note that the TM and ® marks are not written in this manual.
・ The contents of this manual may be changed without notice in the interest of improving the manual.
Introduction
The following symbols are used in this manual to enable you The items to prepare before connecting the XG/CV-X/XG-X
to recognize important information at a glance. Be sure to Series controller (hereinafter referred to as "vision controller"
read this section carefully. in this manual) to the robot controller are listed below.
Indicates a hazardous situation which, if not
DANGER □ User Socket Messaging (R648)
avoided, will result in death or serious injury.
Non-free, robot-side option that is required for
Indicates a hazardous situation which, if not connecting to the vision controller
WARNING
avoided, could result in death or serious injury. * You do not need a development environment
such as ROBOGUIDE.
Indicates a hazardous situation which, if not
CAUTION
avoided, could result in minor or moderate injury. □ Ethernet cable
Indicates a situation which, if not avoided, could
Connects the vision controller and the robot
NOTICE result in product damage as well as property
controller
damage.
USB memory device
Used to copy the robot program for
Important Indicates precautions and limitations that must be communication
followed during operation.
1. XG/CV-X/XG-X Installation
↓
2. Robot Communication Settings (explained in this
manual)
↓
3. Adding a Robot Vision Setting
↓
4. Setting and Executing Calibration
↓
5. Setting Robot Vision Tools and Operation Verification
↓
6. Operation Preparation
Startup Flow
2. Program startup preparation
Create and check the operation of the program that will be used to
grip the target at the specified position and place the target at the
specified position.
* The opening and closing of the hand are also required, so the
corresponding wiring and operation checks must also be performed.
[Advance preparation (2)] Attaching the camera and lighting
Attach the camera and wire the devices.
[Advance preparation (3)] Checking the communication
Carry out the work described starting in chapter 2 of this manual.
[Image processing settings] Configure the image processing settings.
Link and configure the settings of the camera and robot, and then verify the operations with the actual
devices.
• Image capturing and lighting settings, calibration, search settings, and master position registration
1-2 Checking operation using the sample program and creating the program for actual operation
Communication (command I/O) can be checked and movement to the acquired position can be checked by starting the
program.
(Caution: The arm moves in a straight line from the current position to the detected position.)
However, the hand operations as well as the preceding and subsequent operations are not written in the program. Therefore,
as shown below, when not using image processing it is necessary to add the sample program instructions to the job program
or to add to the sample program those operations that it does not already include to create the program for operation.
Move P1 (Move to standby position P1.) The difference in the robot program
↓
Apply a trigger to the camera. compared to when not using vision-guided
↓ robotics is the part written in red on the
Write the output coordinates to P3.
left. These details are written in the sample
↓
Move P2 (Move to above the target.) program.
↓
Move P3 (Lower to the height of the target.)
↓ When changing the text of the sample
Hand operation (Grip the target.) program, specify items such as:
↓
Move P4 (Move to above the pick position.) • The preceding and subsequent
↓ operations.
Move P5 (Move to above the place position.)
• The opening and closing operations of
↓
Move P6 (Lower to the place position.) the hand.
↓ • The path when moving to the target's
Hand operation (Release the target.)
↓ position.
Move P7 (Move to above the place position.) Specify these items to ensure the
↓
operations are appropriate for the device.
Move P1 (Return to the standby position.)
Use an Ethernet cable to connect the LAN connectors of the vision controller and the robot controller.
Use the teach pendant to configure the robot controller's communication settings.
1. Press the "Screen Selection" button on the teach pendant (the teaching control console).
2. On the menu that is displayed, select "MENU 1" - "SETUP," and then select "SETUP 2" - "Host
Comm."
3. On the "SETUP Protocols" screen that is displayed, select "TCP/IP," and then press "F3: DETAIL."
Point Ensure that the IP address is not the same as that of another device.
Reference Set the IP address and subnet mask so that the robot controller is within the same network as the vision
controller.
If necessary, set the default gateway.
Example) Subnet mask: 255.255.255.0 (default value)
If the vision controller IP address is 192.168.0.10
Only the fourth octet of the IP address ("10" in the above example) can be changed to a value in the
range of 1 to 254.
5. Press the "Back" button on the teach pendant, press "F4: SHOW," and then select "Clients."
6. On the screen that is displayed, select "C1:," and then press "F3: DETAIL."
Ports other than C1 can also be used. See "6-3 Commmunication Command List".
7
8
9
3
Robot Communication Settings
8. Select "Startup State:," press "F4: CHOICE," and then select "DEFINE."
9. Select "Server IP/Hostname:," press the "Input" button, and then enter the vision controller IP
address.
Point Ensure that the IP address is not the same as that of another device.
11. Press the "Screen Selection" button on the teach pendant. Then, on the menu that is displayed,
select "--NEXT--," "SYSTEM," and then select "Variables."
12. On the screen that is displayed, select "$HOSTC_CFG," and then press "F2: DETAIL."
13. On the screen that is displayed, select "1 [1]," and then press "F2: DETAIL."
Write the robot program “Robot Vision Setup Program” for communication with the vision controller to the robot controller.
1. Download the “Robot Vision Setup Program” for the relevant robot model from the "Vision-Guided
Robotics User Support" page on the KEYENCE website, and then decompress the downloaded file.
2. Copy the decompressed files (such as the robot vision setup program
"keyencerobotvisionsetup.pc") to the root directory (directly under the drive name) of a USB
memory device.
3. Insert the USB memory device to which you have copied the robot vision setup program into the USB
port of the teach pendant or robot controller.
4. Press the "Screen Selection" button on the teach pendant. Then, on the menu that is displayed,
select "FILE," and then select "File."
4 5. On the screen that is displayed, press "F5: UTIL," select "Set Device," and then select "USB on TP
(UT1:)" or "USB Disk(UD1:)."
Writing the Communication Program
6. On the screen that is displayed, press "F2: DIR," and then select "*.PC."
During setting, run the communication robot program “Robot Vision Setup Program.”
Point Be sure to run “Robot Vision Setup Program” before you perform operations on the robot vision setting.
1. Press the "Screen Selection" button on the teach pendant. Then, on the menu that is displayed,
select "--NEXT--," "SYSTEM," and then select "Variables."
2. Select "$KAREL_ENB," press the "Input" button, and then enter "1."
Reference You can quickly move through the items by holding down the "Shift" button while you press the "↓" button.
5. Select "KEYENCESETUP."
7. Set the teach pendant's "teaching control console enabled switch" to "OFF."
8. Press the "Start" button on the robot controller to run the program.
If an error occurs while “Robot Vision Setup Program” is running, the error or an alarm will be displayed on the robot's teach
pendant. Continue operations after using the following method to recover from the error.
5 [CV-X]
2. In the "Robot Connection Settings" field, select the setting that matches the robot to connect to.
4. In the "IP Address Setting" field, change the CV-X controller communication settings.
5. Click "Check Connection" to check that it is possible to communicate with the robot over Ethernet.
On the "Check Connection" screen, you can specify the robot's IP address and click "Ping" to check the connection status.
Point Configure the settings as follows: "Delimiter: CR," "Set Trigger-command Response to CV-compatible
Mode: clear the check box."
7. When enabling robot operations from the CV-X, click "Enable Robot Operation from CV-X" in the
"Robot Operation Setting" field to select the check box.
8. Click "Check Robot Operation Validity" and check that a message asking you to check that "Robot
Vision Setup Program" is running is displayed.
If "Robot Vision Setup Program" is not running on the robot controller, you will not be able to "Check Robot Operation
Validity." For details, contact your KEYENCE sales representative.
9. Click "Close."
1. From the "Global Settings" menu at the top of the setting mode screen, select "I/O Settings" >
"Robot Connection Settings."
The "Robot Connection Settings" screen is displayed.
2. In the "Robot Connection Settings" field, select the setting that matches the robot to connect to.
If you select the "Limit Robot Connection" check box, the display of the "Manufacturer" field is fixed to the set manufacturer
when you display the "Robot Connection Settings" screen by clicking the "Options" menu, pointing to "Robot Settings," and
then clicking "Connection."
3. When enabling robot operations from the XG-X controller, click "Enable Robot Operation from XG-X"
in the "Robot Operation Setting" field to select the check box.
4. Select "Check Robot Operation Validity" and check that a message asking you to check that "Robot
Vision Setup Program" is running is displayed.
This chapter explains the communication commands that can be used with TP programs during operation.
You can use communication commands to send commands directly from the robot controller to the vision controller.
If you are controlling the vision controller from a PLC during setting and operation, do not use communication commands.
Point During operation, "Robot Vision Setup Program (KEYENCESETUP)" will not be run, but this is required in
order to use the communication commands.
Reference * You do not need a development environment such as ROBOGUIDE in order to use the communication
commands.
A sample operation program that runs measurement on the vision controller from the robot side, and then applies the data
output from the vision controller to move the robot to the corresponding position is shown below.
1: !Connect
2: CALL KEY_CONNECT
3: !Send a command
4: CALL KEY_SEND_CMD('T1')
5: !Wait and set reply to R10
6: CALL KEY_WAIT_CMD('T1',10)
7: !Set received values to R20,21,..
8: CALL KEY_RECV_VAL(20)
6 9: !Set position
10: PR[1,1]=R[20]
11: PR[1,2]=R[21]
Sample Program (Only during Operation)
12: PR[1,3]=R[22]
13: PR[1,4]=R[23]
14: PR[1,5]=R[24]
15: PR[1,6]=R[25]
16: !Move
17: J PR[1] 10% FINE
18: !Close
19: CALL KEY_CLOSE
[End]
Use the teach pendant to configure the robot controller's communication settings.
1. Press the "List" button on the teach pendant (the teaching control console).
2. Use the cursor to select the program that you want to edit, and then press the "Input" button.
3. Move the cursor to the position where you want to enter the communication command, and then
press "F1: INST."
4. On the menu that is displayed, select "CALL," and then select "CALL Program."
5. Press "F3: COLLECT," select "KAREL Progs," and then select "KEY_***," the program to use.
Move the cursor to the right of the program name, and then press "F4: CHOICE" to specify the argument type.
The communication commands that you can use are listed below.
(This list also includes commands used with 3D vision-guided robotics.)
For details on the commands, see the CV-X user's manual and the XG-X communication control manual.
Switching program settings (PW)
Use PW, the program setting switch command, to switch to program setting No. 24 in SD1.
1: !Connect
2: CALL KEY_CONNECT
3: !Send a command
4: CALL KEY_SEND_CMD('PW',1,24)
5: !Wait and set reply to R10
6: CALL KEY_WAIT_CMD('PW',10)
7: !Close
8: CALL KEY_CLOSE
[End]
6
6-5 Output Setting Details
Sample Program (Only during Operation)
Precautions regarding using programs saved with the sample program creation function are listed below.
Point Saved files cannot be used as-is on the robot controller. Open the file in a program such as a text editor to
copy the required part.
Do not delete the files writing during setting, from the robot controller.
The error "Running-320 (KEYENCE SETUP, 207) Undefined" occurs when the setup program is run.
The likely cause is that the UserSocketMsg R648 option has not been installed.
You can use the teach pendant to check whether this option is present: "Screen Selection → STATUS → Software Version."
If this option is not installed, you cannot perform Ethernet non-procedural communication with external devices. Contact your
KEYENCE sales representative.
Clear the UOP assignment, or switch from "Remote" to "Local" under "System Settings" → "Remote/Local Setting" to clear the
error.
Troubleshooting
KEYENCE CORPORATION
1-3-14, Higashi-Nakajima, Higashi-Yodogawa-ku, Osaka, 533-8555, Japan PHONE: +81-6-6379-2211
AUSTRIA FRANCE ITALY POLAND TAIWAN
Phone: +43 2236 378266 0 Phone: +33-1-56-37-78-00 Phone: +39-02-6688220 Phone: +48 71 36861 60 Phone: +886-2-2721-8080
BELGIUM GERMANY KOREA ROMANIA THAILAND
Phone: +32 15 281 222 Phone: +49-6102-3689-0 Phone: +82-31-789-4300 Phone: +40 269 232 808 Phone: +66-2-369-2777
BRAZIL HONG KONG MALAYSIA SINGAPORE UK & IRELAND
Phone: +55-11-3045-4011 Phone: +852-3104-1010 Phone: +60-3-7883-2211 Phone: +65-6392-1011 Phone: +44 1908-696-900
CANADA HUNGARY MEXICO SLOVAKIA USA
Phone: +1-905-366-7655 Phone: +36 1 802 7360 Phone: +52-55-8850-0100 Phone: +421 2 5939 6461 Phone: +1-201-930-0100
CHINA INDIA NETHERLANDS SLOVENIA VIETNAM
Phone: +86-21-3357-1001 Phone: +91-44-4963-0900 Phone: +31 40 20 66 100 Phone: +386 1 4701 666 Phone: +84-24-3772-5555
CZECH REPUBLIC INDONESIA PHILIPPINES SWITZERLAND
Phone: +420 220 184 700 Phone: +62-21-2966-0120 Phone: +63-2-8981-5000 Phone: +41 43 455 77 30
A4WW1-MAN-2010
Copyright○
C 2015 KEYENCE CORPORATION. All rights reserved. 124406GB 2070-3 124406