Vision Sensor FH series Vision Sensor FH series Conveyor Tracking

Vision Sensor FH series Vision Sensor FH series Conveyor Tracking
Roboti cs packagi ng l ine soluti on
Vision Sensor FH series
Conveyor Tracking Application
Programming Guide
FH-1□□□
FH-3□□□
SYSMAC-SE20□□
SYSMAC-RA401L
NJ501-4□□□
R88D-KN□-ECT
Z368-E1-01
NOTE
• All rights reserved. No part of this publication may be reproduced, stored in
a retrieval system, or transmitted, in any form, or by any means, mechanical,
Xelectronic, photocopying, recording, or otherwise, without the prior written
permission of OMRON.
• No patent liability is assumed with respect to the use of the information
contained herein. Moreover, because OMRON is constantly striving to improve
its high-quality products, the information contained in this manual is subject
to change without notice. Every precaution has been taken in the preparation of
this manual. Nevertheless, OMRON assumes no responsibility for errors or omis
sions. Neither is any liability assumed for damages resulting from the use of
the information contained in this publication.
Trademarks
• Sysmac and SYSMAC are trademarks or registered trademarks of OMRON Corporation
in Japan and other countries for OMRON factory automation products.
• This software is based in part on the work of the Independent JPEG Group.
• Microsoft, Windows, Windows Vista, Excel, and Visual Basic are either registered trade-
marks or trademarks of Microsoft Corporation in the United States and other countries.
• Intel, Core and Pentium are trademarks of Intel Corporation in the U.S. and/or other
countries.
• EtherCAT® is registered trademark and patented technology, licensed by Beckhoff
Automation GmbH, Germany.
• ODVA, CIP, CompoNet, DeviceNet, and EtherNet/IP are trademarks of ODVA.
• The SD and SDHC logos are trademarks of SD-3C, LLC.
• QR Code is a registered trademark of DENSO WAVE INCORPORATED.
• MELSEC is a registered trademarks of Mitsubishi Electric Corporation.
Other company names and product names in this document are the trademarks
or registered trademarks of their respective companies.
Copyrights
Microsoft product screen shots reprinted with permission from Microsoft Corporation.
Index
1.
Revision History........................................................................................................... 6
2.
Introduction .................................................................................................................. 7
2.1. Introduction .................................................................................................................... 7
2.2. Provided Materials ......................................................................................................... 7
2.3. Conventions Used in This Manual ................................................................................. 7
2.4. Terms and Conditions Agreement.................................................................................. 8
2.4.1.Warranty, Limatations of Liability ................................................................................. 8
2.4.2.Application Considerations .......................................................................................... 9
2.4.3.Disclaimers ................................................................................................................... 9
2.5. Precautions for Use of This Software .......................................................................... 10
2.6. Meanings of Signal Words ........................................................................................... 11
2.7. Precausions for Safe Use ............................................................................................ 11
2.8. Precausions for Correct Use........................................................................................ 11
2.9. Regulations and Standards ......................................................................................... 11
2.10. Related Manuals .......................................................................................................... 11
3.
About Sample Scene and Sample Macro ................................................................ 14
3.1. Overview ...................................................................................................................... 14
3.2. Target Readers and Expected Skill Level .................................................................... 15
3.3. Terminology .................................................................................................................. 15
3.4. Hardware Configuration ............................................................................................... 17
3.5. Supported Devices....................................................................................................... 18
3.6. Restrictions .................................................................................................................. 19
4.
About Conveyor Tracking Calibration ..................................................................... 20
4.1. Function Overview ....................................................................................................... 20
4.2. About the Sample Scene ............................................................................................. 21
4.3. Function Details ........................................................................................................... 21
4.4. Hints for Adjustment ..................................................................................................... 22
5.
About Detection and Duplicate Duplication Capability ......................................... 24
5.1. Function Overview ....................................................................................................... 24
5.2. Sample Scene Overview.............................................................................................. 24
5.3. Function Detail ............................................................................................................. 26
5.3.1.Data Flow Diagram .................................................................................................... 26
5.3.2.Unit Labels Used in This Sample Scene ................................................................... 26
5.4. Restrictions .................................................................................................................. 27
6.
Generating and Outputting Data for the Pick Operation ....................................... 28
6.1. Function Overview ....................................................................................................... 28
6.2. Sample Scene Overview.............................................................................................. 28
6.3. Function Detail ............................................................................................................. 30
6.3.1.Data Flow Diagram .................................................................................................... 30
6.3.2.Unit Labels Used in Sample Scenes ......................................................................... 31
6.3.3.Output Data Format ................................................................................................... 31
6.4. Restrictions .................................................................................................................. 34
7.
Hints for Adjustment.................................................................................................. 35
7.1. Workflow for Startup and Setting Adjustment .............................................................. 35
7.2. Sample Macro Errors ................................................................................................... 39
7.2.1.List of Error Codes ..................................................................................................... 40
7.2.2.Error code details ....................................................................................................... 40
7.2.3.Error Sub Code .......................................................................................................... 43
8.
Sample Macro for Obtaining Encoder Value ........................................................... 44
8.1. When to Use This Sample Macro ................................................................................ 44
8.2
Flow Chart of Sample Macro ....................................................................................... 45
8.3. Required Settings List .................................................................................................. 45
3
8.4.
8.5.
8.6.
8.7.
Setting Input Arguments............................................................................................... 45
Returned value ............................................................................................................. 46
Processing of Display and Drawing ............................................................................. 46
Troubleshooting ........................................................................................................... 48
9.
Sample Macro for Duplicate Duplication................................................................. 49
9.1. When to Use This Sample Macro ................................................................................ 49
9.2. Flow Chart of Sample Macro ....................................................................................... 49
9.3. Required Settings List .................................................................................................. 50
9.4. Unit Label Setting......................................................................................................... 50
9.5. Setting Input Arguments............................................................................................... 51
9.6. Returned Value ............................................................................................................ 52
9.7. Processing of Display and Drawing ............................................................................. 53
9.8. Troubleshooting ........................................................................................................... 55
10.
Sample Macro for Grip Interference Check ............................................................ 56
10.1. When to Use This Sample Macro ................................................................................ 56
10.2. Flow Chart of Sample Macro ....................................................................................... 56
10.3. Required Settings List .................................................................................................. 57
10.4. Unit Label Setting......................................................................................................... 57
10.5. Setting Input Arguments............................................................................................... 58
10.6. Returned Value ............................................................................................................ 60
10.7. Processing of Display and Drawing ............................................................................. 60
10.8. Folders of GrapInterferenceCheck Processing Item ................................................... 62
10.9. Troubleshooting ........................................................................................................... 63
11.
Classification Sample Macro .................................................................................... 64
11.1. When to Use This Sample Macro ................................................................................ 64
11.2. Flow Chart of Sample Macro ....................................................................................... 64
11.3. Required Settings List .................................................................................................. 65
11.4. Unit Label Setting......................................................................................................... 65
11.5. Setting Input Arguments............................................................................................... 66
11.6. Returned Value ............................................................................................................ 68
11.7. Processing of Display and Drawing ............................................................................. 68
11.8. Folders for Classification.............................................................................................. 70
11.9. Troubleshooting ........................................................................................................... 71
12.
Sample Macro for Data Output ................................................................................. 72
12.1. When to Use This Sample Macro ................................................................................ 72
12.2. Flow Chart of Sample Macro ....................................................................................... 72
12.3. Required Settings List .................................................................................................. 73
12.4. Unit Label Setting......................................................................................................... 73
12.5. Setting Input Arguments............................................................................................... 74
12.6. Returned Value ............................................................................................................ 76
12.7. Processing of Display and Drawing ............................................................................. 76
12.8. Troubleshooting ........................................................................................................... 78
13.
Sample Macro for Debug........................................................................................... 79
13.1. When to Use This Sample Macro ................................................................................ 79
13.2. Required Settings List .................................................................................................. 79
13.3. Setting Input Arguments............................................................................................... 79
14.
Sample Macro for Error Processing ........................................................................ 80
14.1. When to Use This Sample Macro ................................................................................ 80
15.
Sample Macro for Communication Command ....................................................... 82
15.1. When to Use This Sample Macro ................................................................................ 82
15.2. Calibration Command for the Vision and Robot Integration Simulator ....................... 83
15.2.1.Prerequisites and Restrictions ................................................................................. 83
15.2.2.Details of Each Function .......................................................................................... 83
15.3. Command for the Calibration Wizard .......................................................................... 90
4
15.3.1.Prerequisites and Restrictions ................................................................................. 90
15.3.2.Details of Each Function .......................................................................................... 91
15.4. Command for the Non-Wizard Calibration................................................................... 93
15.4.1.Prerequisites and Restrictions ................................................................................. 93
15.4.2.Details of Each Function .......................................................................................... 93
16.
Conveyor Panorama Display Tool............................................................................ 96
17.
Conveyor Tracking Calibration Wizard Tool ........................................................... 97
18.
Calibration Without Using the Wizard ..................................................................... 98
18.1. Command Sequence ................................................................................................... 98
18.2. Command Specifications ........................................................................................... 100
18.2.1.Scene Number Fetch Command (①) .................................................................... 100
18.2.2.Scene Switch Command (②)................................................................................. 100
18.2.3.Image Display State Fetch Command (③) ............................................................ 101
18.2.4.Image Display State Setting Command (④) .......................................................... 101
18.2.5.Non-Wizard Calibration Command (⑤) ................................................................. 102
18.2.6.Processing Unit Data Setting/Fetch Command (⑥) .............................................. 102
18.2.7.Save-to-Unit Command (⑦) .................................................................................. 109
18.2.8.Image Display State Setting Command (⑧) .......................................................... 109
18.2.9.Scene Switch Command (⑨)................................................................................. 110
5
1. Revision History
Revision Symbol
Revision Date
01
December 1, 2015
Reason for Revision and Revised Page
First edition
6
2. Introduction
2.1. Introduction
Thank you for purchasing FH/FZ5 Series product.
This manual provides information regarding functions, performance and operating methods
that are required for using FH/FZ5 Series product. When using FH/FZ5 Series product, be
sure to observe the following:
• FH/FZ5 Series product must be operated by personnel knowledgeable in electrical engineering.
• To ensure correct use, please read this manual thoroughly to deepen your understanding of
the product.
• Please keep this manual in a safe place so that it can be referred to whenever necessary.
This Manual does not contain safety information and other details that are required for actual
use of a FH/FZ5 Series Controller. Thoroughly read and understand the manuals for all of the
devices that are used in this Manual to ensure that the system is used safely. Review the entire contents of these materials, including all safety precautions, precautions for safe use, and
precautions for correct use.
Any part or whole of this operation manual may not be copied, reproduced, or reprinted
without permission.
The contents of this manual, including product specifications, are subject to change based on
improvements of the product without prior notice. Your understanding is appreciated
We are committed to providing precise information. Should you have any questions or concerns regarding the contents of this document, please do not hesitate to contact us. When you
contact us, please be sure to provide us with the Catalog number printed on the back cover.
2.2. Provided Materials
The following materials are provided from OMRON:
・Sample Scenes
・Sample macros
・User's guide (this document)
2.3. Conventions Used in This Manual
Symbols in this manual are used as follows:
Safety Information
Things that should be done or avoided to safely use the product.
7
Precautions for Use
Things that should be done or avoided to prevent malfunction, false operation, or other negative effects to the product.
Useful Information
Things that may apply to certain situations. Information and tips that help you use the product
seamlessly. This information is provided to increase understanding or make operation easier.
Reference
Location of detailed or related information.
2.4. Terms and Conditions Agreement
2.4.1.

Warranty, Limatations of Liability
Warranties
● Exclusive Warranty
Omron’s exclusive warranty is that the Products will be free from defects in materials and
workmanship for a period of twelve months from the date of sale by Omron (or such other period expressed in writing by Omron). Omron disclaims all other warranties, express or implied.
● Limitations
OMRON MAKES NO WARRANTY OR REPRESENTATION, EXPRESS OR IMPLIED,
ABOUT NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR
PURPOSE OF THE PRODUCTS. BUYER ACKNOWLEDGES THAT IT ALONE HAS DETERMINED THAT THE PRODUCTS WILL SUITABLY MEET THE REQUIREMENTS OF
THEIR INTENDED USE.
Omron further disclaims all warranties and responsibility of any type for claims or expenses
based on infringement by the Products or otherwise of any intellectual property right.
● Buyer Remedy
Omron’s sole obligation hereunder shall be, at Omron’s election, to (i) replace (in the form
originally shipped with Buyer responsible for labor charges for removal or replacement thereof) the non-complying Product, (ii) repair the non-complying Product, or (iii) repay or credit
Buyer an amount equal to the purchase price of the non-complying Product; provided that in
no event shall Omron be responsible for warranty, repair, indemnity or any other claims or
expenses regarding the Products unless Omron’s analysis confirms that the Products were
properly handled, stored, installed and maintained and not subject to contamination, abuse,
misuse or inappropriate modification. Return of any Products by Buyer must be approved in
writing by Omron before shipment. Omron Companies shall not be liable for the suitability or
8
unsuitability or the results from the use of Products in combination with any electrical or electronic components, circuits, system assemblies or any other materials or substances or environments. Any advice, recommendations or information given orally or in writing, are not to be
construed as an amendment or addition to the above warranty.
See http://www.omron.com/global/ or contact your Omron representative for published information.

Limitation on Liability; Etc
OMRON COMPANIES SHALL NOT BE LIABLE FOR SPECIAL, INDIRECT, INCIDENTAL,
OR CONSEQUENTIAL DAMAGES, LOSS OF PROFITS OR PRODUCTION OR COMMERCIAL LOSS IN ANY WAY CONNECTED WITH THE PRODUCTS, WHETHER SUCH CLAIM
IS BASED IN CONTRACT, WARRANTY, NEGLIGENCE OR STRICT LIABILITY.
Further, in no event shall liability of Omron Companies exceed the individual price of the
Product on which liability is asserted.
2.4.2.

Application Considerations
Suitability of Use
Omron Companies shall not be responsible for conformity with any standards, codes or regulations which apply to the combination of the Product in the Buyer’s application or use of the
Product. At Buyer’s request, Omron will provide applicable third party certification documents
identifying ratings and limitations of use which apply to the Product. This information by itself
is not sufficient for a complete determination of the suitability of the Product in combination
with the end product, machine, system, or other application or use. Buyer shall be solely responsible for determining appropriateness of the particular Product with respect to Buyer’s
application, product or system. Buyer shall take application responsibility in all cases.
NEVER USE THE PRODUCT FOR AN APPLICATION INVOLVING SERIOUS RISK TO LIFE
OR PROPERTY WITHOUT ENSURING THAT THE SYSTEM AS A WHOLE HAS BEEN DESIGNED TO ADDRESS THE RISKS, AND THAT THE OMRON PRODUCT(S) IS PROPERLY
RATED AND INSTALLED FOR THE INTENDED USE WITHIN THE OVERALL EQUIPMENT
OR SYSTEM.

Programmable Products
Omron Companies shall not be responsible for the user’s programming of a programmable
Product, or any consequence thereof.
2.4.3.

Disclaimers
Performance Data
9
Data presented in Omron Company websites, catalogs and other materials is provided as a
guide for the user in determining suitability and does not constitute a warranty. It may represent the result of Omron’s test conditions, and the user must correlate it to actual application
requirements. Actual performance is subject to the Omron’s Warranty and Limitations of Liability.
 Change in Specifications
Product specifications and accessories may be changed at any time based on improvements
and other reasons. It is our practice to change part numbers when published ratings or features are changed, or when significant construction changes are made. However, some
specifications of the Product may be changed without any notice. When in doubt, special part
numbers may be assigned to fix or establish key specifications for your application. Please
consult with your Omron’s representative at any time to confirm actual specifications of purchased Product.
 Error and Omissions
Information presented by Omron Companies has been checked and is believed to be accurate; however, no responsibility is assumed for clerical, typographical or proofreading errors or
omissions.
2.5. Precautions for Use of This Software
Read this section carefully prior to using this software.
By use of this software, you agree with the terms of the software license agreement. If you do not
agree with the software license agreement, please return this software without using them along
with attached documentations including the user’s manuals.
Software License Agreement
OMRON Corporation, hereafter referred to as OMRON, hereby grants permission to the customer to
use this software on the following conditions.
1.
In this agreement, "this software" includes sample scene data, sample macro programs and all
the related documentation, including user's manuals. OMRON holds the copyright of this software, and it does not transfer to the user based on this agreement.
2.
OMRON grants the user non-exclusive rights to copy this software, alter and copy software
programs, and use them with OMRON products within Japan. Further, OMRON grants the user
non-exclusive rights to give permission to customers of the user to use such copies within Japan on condition that the user will entirely be responsible for dealing with any inquiries and
10
claims in regard to the software and altered programs. This Software License Agreement as
well applies to altered programs.
3.
The customer is not permitted to mortgage or transfer ownership of the software, to give use of
the software to third parties without written permission from OMRON except when doing so by
following the preceding article.
4.
The customer is not permitted to perform decompilation, disassembly, or any other sort of reverse engineering of this software.
5.
The customer is obliged to keep all information of this software confidential from third parties
except when giving them permission for use of this software by following the article 2.
6.
Under no circumstance does OMRON guarantee software to be free of defects, or guarantee
the non-infringement of intellectual property rights of third parties, and therefore OMRON is not
liable for repairing defects, dealing with infringement, and any damages that such defects, infringement, or use of this software may cause. Additionally, under no circumstance shall OMRON be held liable for software or programs that are developed by the user or third parties
using this software, and any result of using such software and programs.
2.6. Meanings of Signal Words
For details on Meanings of Signal Words, refer to Meanings of Signal Words in Vision System
FH/FZ5 Series User's Manual (Cat. No. Z340-E1-08 or later).
2.7. Precausions for Safe Use
For details on Precautions for Safe Use, refer to Precautions for Safe Use in Vision System
FH/FZ5 Series User's Manual (Cat. No. Z340-E1-08 or later).
2.8. Precausions for Correct Use
For details on Precautions for Correct Use, refer to Precautions for Correct Use in Vision
System FH/FZ5 Series User's Manual (Cat. No. Z340-E1-08 or later).
2.9. Regulations and Standards
For details on Regulations and Standards, refer to Regulations and Standarrds in Vision
System FH/FZ5 Series User's Manual (Cat. No. Z340-E1-08 or later).
2.10. Related Manuals
The following manuals are also helpful when using Conveyor Tracking Calibration Wizard.
Use these manuals for reference.
11
Cat. No.
Z340-E1
Manual name
Summary
Application
Vision System
Describes how to configure
To learn how to config-
FH/FZ5 Series
settings on the sensor con-
ure FH/FZ5 Series Vi-
User's Manual
troller of FH/FZ5 Series Vi-
sion Sensors.
sion Sensors.
Z341-E1
Vision System
Describes how to configure
To learn how to config-
FH/FZ5 Series
settings for processing items
ure settings for pro-
Processing Item Function
for FH/FZ5 Series Vision
cessing
Reference Manual
Sensors.
FH/FZ5 Series Vision
items
for
Sensors.
Z342-E1
Vision System
Describes how to configure
To learn how to config-
FH/FZ5 Series
communication settings on
ure
User's Manual
the
settings
(Communications Settings)
FH/FZ5 Series Vision Sen-
sensor
controller
of
communication
for
FH/FZ5
Series Vision Sensors.
sors.
Z343-E1
Vision System
Describes how to configure
To learn how to config-
FH Series
FH Series Sensor Controllers
ure FH Series Sensor
Operation Manual
on Sysmac Studio.
Controllers.
Sysmac Studio
Describes the operation of
To learn the operation
Version 1
Sysmac Studio.
and
Sysmac Studio
W504-E1
of
Sysmac Studio.
Operation Manual
Z369-E1
functions
Vision Sensor
Describes how to configure
To
FH Series
and operate Calibration Plate
procedure for printing
Operation Manual
Print Tool on Sysmac Studio
the Pattern on a Cali-
Sysmac Studio
on FH Sensor Controllers.
bration Plate used for
Calibration Plate Print Tool
learn
the
setup
calibration for cameras
and robots on Sysmac
Studio.
Z370-E1
Vision Sensor
Describes how to configure
To
FH Series
and operate the Conveyor
procedure of the wiz-
Operation Manual
Tracking Calibration Wizard
ard style calibration for
Sysmac Studio
tool on Sysmac Studio on FH
cameras,
Conveyor Tracking Calibra-
Sensor Controllers.
conveyors.
Vision Sensor
Describes how to configure
To
FH Series
and operate the Conveyor
procedure of panorama
Operation Manual
Panorama Display tool on
display for image cap-
Sysmac Studio
Sysmac Studio on FH Sen-
ture of targets on con-
Conveyor Panorama Dis-
sor Controllers.
veyors.
learn
the
setup
robots,
or
tion Wizard Tool
Z371-E1
learn
the
setup
play Tool
12
Z368-E1
Vision Sensor
Describes the setting proce-
To learn the setting
FH Series
dure of sample scenes or
procedure of sample
Conveyor Tracking Applica-
sample macros used for ap-
macros for conveyor
tion
plications of conveyor track-
tracking.
Programming
(this document)
Guide
ing on FH Sensor Controllers.
13
3. About Sample Scene and Sample Macro
3.1. Overview
The conveyor tracking application consists of the combination of Machine Automation Controllers (NJ/NX Series), a vision sensor of FH Sensor Controller, robots, conveyors, and other
devices.
FH Sensor Controller has the Pick and Place capability to accommodate to conveyor tracking
application.
The Pick and Place capability consists of the following three functions.
1. Function to perform conveyor tracking calibration to reciprocally convert coordinate
systems of FH Sensor Controller, conveyor, and robots.
2. Function to detect target objects on a conveyor and exclude ones captured by camera
more than one time from detection.
3. Function to have a robot create and output data to pick target objects.
These three functions are achieved by combining a variety of processing and the macro
customization function of FH Sensor Controller.
These combinations of processing items and the macro customization function are provided
as Sample Scenes and sample macros.
The Sample Scenes, sample macros, and programs for Machine Automation Controllers
(NJ/NX Series) can be customized to suit your system.
This document describes how to use the Sample Scenes and macros to perform each one of
the three functions.
For more information about processing items used for Pick and Place, refer to the Vision
System Processing Item Function Reference Manual (Cat. No. Z341-E1).
For more information about Scenes and macros, refer to the FH/FZ5 Series Vision System
User’s Manual (Cat. No. Z340-E1).
14
3.2. Target Readers and Expected Skill Level
Target readers of this manual include developers of visual conveyor tracking systems, and
engineers and programmers who support end users of visual conveyor tracking systems,
especially those who are responsible for the following tasks.
・Configuration of conveyor tracking system using the Sample Scenes and sample macros.
・Measurement flow adjustment
Additionally, the following skills are required since sample Scenes are adjusted using processing items of FH Sensor Controller and the macro customization function.
・Skill to adjust processing items of FH sensor controller
・Skill to edit macro related processing items.
3.3. Terminology
Term
Explanation
A function that enables a robot to track targets moving on
a conveyor.
Conveyor tracking
Transfer of targets from/to moving conveyors is enabled
by combining the Conveyor Tracking function and the Pick
& Place function.
Visual Conveyor Tracking
A conveyor tracking system for production lines that use
vision sensors.
A process that generates parameters to reciprocally con-
Calibration
vert coordinates that differ from the camera coordinate
system.
Conveyor Calibration
Collective term for calibrations for conveyor tracking operation. Conveyor tracking calibration includes camera
calibration such as lens distortion correction, camera-robot
calibration, and robot-conveyor calibration.
Calibration Plate
A plate-shaped reference jig with a calibration pattern
printed that is used with Conveyor Tracking Calibration
Wizard.
Pick-side Conveyor
Conveyor on which target objects of Pick and Place move.
A 2D coordinate system used by vision sensors.
Its origin point is the upper left corner of the captured im-
Camera Coordinate System
age. From there, the horizontal line is determined to be the
x axis, and the vertical line is determined to be the y axis.
The unit of measure: pixel.
15
A coordinate system for conveyors.
The user-defined conveyor coordinate system is set per
Conveyor Coordinate
tracking area, and is used to adjust the angle of the con-
System
veyor with respect to the robot's Machine Coordinate System (MCS).
It is set as User Coordinate System (UCS).
A coordinate system used by robots controlled by FH
Machine Coordinate System
(MCS)
Sensor Controller.
It is set as Machine Coordinate System (MCS). The unit of
measure: mm.
Robot
Robot which picks and places target objects for conveyor
tracking.
Operations to have a robot touch the target object to make
the robot learn and input its position information.
Set Point
During conveyor tracking calibration between the camera
and robot, the Calibration Plate is moved into the tracking
area, and a robot performs Set Point to specified Marks.
An area where robots can pick and place target objects.
It is the overlapped area of the conveyor and the workspace of the robot. The entry border of the area is called
Track Start Line, and the exit border is called Track Finish
Line, and the tracking area is the space in between two
lines.
Tracking area
It is a virtual entry border to the tracking area, over which
Track Start Line
objects will be targets of the robot's Pick and Place operation.
It is a virtual exit border from the tracking area, over which
Track Finish Line
objects will no longer be targets of the robot's Pick and
Place operation.
Vision and Robot Integration
When you consider installing new equipment for conveyor
Simulation
tracking application, the test verification based on the real
Vision and Robot Integration
environment is required. This verification can be performed
Simulator
by the simulation of Sysmac Studio.
This simulation is referred to as "Vision and Robot Integration Simulation" and its tool as "Vision and Robot Integration Simulator".
16
3.4. Hardware Configuration
The following figure is an example of the system configuration and a conceptual diagram of
the supplied Sample scene and sample macro.
17
Sends the Scene 0 and Scene 1 as Sample Scene.
These two Sample Scenes are included to the NJ-sample program.
Scene 0: P&P_CalibScene
Scene 1: P&P_SampleScene
Sample macro sends seven sample macros.
These seven macros are included to the P&P_SampleScene of Scene 1.
Macro processing for Debug mode settings: DEBUG_SetGlobalData.
Macro processing for Acquisition of Encoder value: GetEncValue.
Macro processing for Remove Duplication: RemoveDuplication.
Macro processing for Classification: Classification.
Macro processing for Grip Interference Check: GripInterferenceCheck.
Macro processing for Data Output: DataOutput.
Macro processing for Error processing: DEBUG_GetMacroError.
The communication command sample macro is included in
FH_ConveyorTrackingApplication_SAMPLE_IO_MACRO_Rev*.mcr, where * represents the
revision number. This macro provides the following three functions:
3DSimCalib (No.128) as a calibration command for the vision and robot integration simulator;
OutputConvDist (No.254) as a command for the calibration wizard; and
GetUnitNo (No.255) as a command for the non-wizard calibration.
Useful Information
The Sample Scene, sample macro, communication command macro, and system setting
data are provided together with a single BKD file, and included in
FH_ConveyorTrackingApplication_SAMPLEScene_Rev*.bkd, where * represents the revision number.
3.5. Supported Devices
Devices
NJ-R CPU unit
Supported product
NJ501-4300/4310/4400/4500
(Unit: Ver.1.09, Robot Ver.1.02 or later)
Servomotors/Servo
・R88D-KN04H-ECT
Drive G5 series
・R88D-KN02H-ECT
・R88D-KN01H-ECT
Delta robot
Vision sensor
Sysmac Studio
(Ver.2.1)
Yamaha Motor Delta Robot: YD06-A4A
FH-3050□□ / 1050 □□ (Ver.5.50 or later)
Ver,1,14,1 or later
18
3.6. Restrictions
Keep the following points in mind when using this sample Scene and related sample macros.
Item
Sample Scene
Restriction
Created on the assumption that the number of cameras is
1. For the use of multiple lines random-trigger mode of the
FH Sensor Controller, create the Scene assuming that the
number of cameras is 1 for each line.
Sample Scene
Only Camera Image Input FH function supported
(Scene 1: P&P_SampleScene)
Regarding Camera image input
function
Sample Scene
To obtain correct encoder values, the multi-input function
(Scene 1: P&P_SampleScene)
is unavailable.
Regarding Encoder value
Restrictions for encoder value:
・The value shall be from 0 to 2147483647
・On reaching the maximum value, 214783647, the value
shall return to 0 and then perform counting up, which is
the ring counting method.
Sample Scene
To use the conveyor tracking calibration wizard, use the
(Scene 1: P&P_CalibScene)
User area for the current encoder value and the robot
Regarding the use of User areas
position data (X, Y) in touch-up operation.
Sample Scene
For the data of an encoder value when the trigger is ac-
(Scene 1: P&P_SampleScene)
tivated, use the User area.
Regarding the use of User areas
Sample Macro
Do not edit the macro except the part in between
"'Start//////..." and "...///End".
Sample Scene
(Scene 1:
Do not use Sample Scene (Scene 1: P&P_SampleScene)
for Parallel Processing.
P&P_SampleScene)
For details, refer to Parallel Processing section in the
Parallel Processing function
Vision System FH/FZ5 Series User’s Manual.
Communication command
When performing calibration or using the vision and robot
macro
integration simulator, use the provided communication
command macro.
Re-measurement using the log-
Use the logging images in IFZ format (Omron-specific
ging images
image format).
The BMP format cannot be used.
For the BMP format, use the BitmapToIfz tool to convert it
to IFZ format before use. For how to access the tool,
consult your local representative.
19
4. About Conveyor Tracking Calibration
4.1. Function Overview
Conveyor Tracking Calibration can perform the calibration to reciprocally convert different
coordinate systems between vision sensors, conveyors, and robots by combining processing
items of FH Sensor Controller.
The chapter 4 describes a sample Scene provided for Conveyor Tracking Calibration function.
There are two ways to perform conveyor tracking calibration using this sample Scene.
Method1: Use the Conveyor Tracking Calibration Wizard tool. For more information, refer to
the Operation Manual Sysmac Studio Conveyor Tracking Calibration Wizard Tool.
Method 2: Use a command/response scheme in the NJ program. For more information, refer
to the section of Calibration Without Using the Wizard in this manual.
20
4.2. About the Sample Scene
This chapter describes a Sample Scene: 0.P&P_CalibScene provided for
Conveyor Tracking Calibration function,
This sample Scene can be applied to both the Method 1 and Method 2 introduced earlier.
For more information about each processing item, refer to the Vision System Processing
Item Function Reference Manual (Cat. No. Z341-E1).
This table describes the sample Scene following the arrangement of the Scene contents.
Scene content
Available
Description
processing items
Camera Image Input
Camera Image Input FH
Select the camera number of the
type processing
Camera Image Input HDR
camera to calibrate with.
Precise Calibration
Load the Calibration Plate in the
↓
Calibration
type processing
camera FOV, and then perform
the calibration.
↓
Conveyor
Conveyor Tracking
Performs the calibration using
Tracking Calibration
Calibration
plate position, machine coordi-
processing
nate, and Encoder values with
loaded in the Precise Calibration
function.
4.3. Function Details
Conveyor Tracking Calibration is a process to reciprocally convert coordinate systems of the
conveyor, robot MCS and camera.
21
1. Calibration the Robot 1 and UCS1.
Robot 1: Machine coordinate system
UCS 1: Conveyor coordinate system
2. Calibration Robot 2 and USC 2.
Robot 2: Machine coordinate system
UCS 2: Conveyor coordinate system
3. Calibration Robot 1 and MCS 1.
Describes about this calibration.
For more information about 1 and 2, refer to the NJ program.
Perform 3 after completing 1 and 2.
To calibrate MCS1 and the camera coordinate system, the coordinates of the four corners of
the Calibration Plate on MCS1 and on the camera coordinate system are matched in the
camera FOV.
For more information about the procedure of calibration, refer to the Conveyor Tracking
Calibration Wizard Tool section in this manual.
4.4. Hints for Adjustment
Situation
Where to adjust
Adjustment
Cannot load
Camera Image Input FH
Adjust the brightness as needed to have uni-
the Calibration Plate
function
form brightness across the calibration plate.
Camera
Image
Input
HDR function
Adjust the focus to Marks on the Calibration
Plate.
Do not include objects other than the Pattern
in camera the FOV.
Increase the contrast of the black area and
white area on the Calibration Plate by using
the Camera Image Input HDR function.
For the Camera Image Input HDR function,
refer to FH/FZ5 Processing Item Function
Reference Manual.
Position of the Calibra-
Adjust the Plate position, or calibration region
tion Plate
to not include objects other than the calibration pattern.
Calibration Plate
Make sure the Marks do not overlap and that
the diameter of the Marks is 20 pixels or larger.
Adjust the Calibration Plate size to the camera
FOV.
22
Sample Scenes
If the contrast of the black area and white area
(Scene:
of the Calibration Plate is uneven, correct the
0.P&P_CalibScene)
image. To do so, you can set image correction
type processing items after the image capture
type processing items and before the calibration type processing items.
23
5. About Detection and Duplicate Duplication Capability
5.1. Function Overview
By combining multiple processing items and the macro customization function of the FH
Sensor Controller, you can exclude objects that have already been in the camera FOV and
captured by the camera from the next detection.
5.2. Sample Scene Overview
This chapter explains the Sample Scene (Scene: 1. P&P_SampleScene) when the detection
and duplicate exclusion function are used.
Although this Sample Scene includes processing items described in 6. Generating and Outputting Data for the Pick Operation in this manual.
For more information about each processing item, refer to the Vision System Processing Item
Function Reference Manual (Cat. No. Z341-E1).
For more information about Scenes and macros, refer to the FH/FZ5 Series Vision System
User’s Manual (Cat. No. Z340-E1).
This table describes the Sample Scene following the arrangement of the Scene contents.
Scene content
Image capture processing
Available
Explanation
processing items
Camera Image Input FH
Select the camera used for Conveyor
function
Tracking.
Select the camera number for measurement.
↓
24
Macro processing for
Unit Macro
Is used to change the startup mode or
Debug mode
(Sample macro:
debug mode.
DEBUG_SetGlobalData)
For details of this function, refer to Sample
Macro for Debug in this manual.
↓
Reference calibration data
Reference Calib Data
processing
References the calibration data created
through conveyor calibration.
↓
Unit Macro
Obtains the encoder value saved in the NJ
Sample Macro for Acquisi-
(Sample macro:
For more detail of this function, refer to
tion Encoder Value
GetEncValue)
GetEncValue macro section in this manual.
Get Unit Data
Obtains the value of the conveyor move-
↓
Processing unit data acquisition
ment per encoder value set through conveyor calibration.
↓
Detection processing
Search
Detects target objects for Pick and Place.
Shape Search II
Select processing items which can detect
Shape Search III
multiple work pieces.
EC Circle Search
When you use the Labeling function, Label
Labeling
Data function is used simultaneously.
Camera switching
Camera Switching
This processing item returns an image of
processing
function
filter processing items used detection pro-
↓
cessing to an image of Image capture
processing.
If you do not use the filter processing
items, turn to OFF the processing units at
the same time of calibration reference
processing.
↓
Calibration reference pro-
Calibration data
Retry to reference the reset calibration
cessing
reference
data when the Camera Switching function
is performed.
↓
Macro(RemoveDuplication)
Unit Macro:
For details of this function, refer to Sample
processing
RemoveDuplication
Macro for Duplicate Exclusion in this
manual.
25
5.3. Function Detail
5.3.1.
Data Flow Diagram
Describes the data flow dialog in the Sample Scene.
For more details, refer to Data Flow Dialog within Processing Time in this manual.
5.3.2.
Unit Labels Used in This Sample Scene
In Sample Scenes, the unit labels are used to reference the result of each processing.
For more information about unit labels, refer to the FH/FZ5 Series Vision System User’s
Manual (Cat. No. Z340-E1).
Unit type
Unit label
Calibration data reference
REF_CALIB_DATA
Processing unit data acquisition
GET_CONVEYOR_DIST
Macro (GetEncValue)
GET_ENC_VALUE
Detection
DETECT_UNIT
Label Data
LABEL_DATA
(only using Labelling function)
Macro (RemoveDuplication)
REMOVE_DUPLICATION
26
5.4. Restrictions
Keep the following points in mind when using this Sample Scene and related sample macros.
Subject
Explanation
Regarding Camera Image Input
For image capture, only the Camera Image Input
FH processing item is available since you are
capturing moving objects.
Only Camera Image Input FH function supported.
Regarding the Encoder value
Multiple Input not supported.
Restrictions for encoder value:
・The value shall be from 0 to 2147483647
・On reaching the maximum value (2147483647),
the value shall return to 0 and then perform
counting up, which is the ring counting method.
Sample Macro
Programs except User change area
“'Start/////////// ・・・
Parallelize function
///////////////End” are applied.
Do not use the Parallelize processing items:
Parallelize and Parallelize Task.
System setting (Communication)
Only EtherCAT communication is supported Sample Scene and Sample Macro.
For the restrictions of EtherCAT communication,
as below.
・Output control: None
・Line N (N is the number used Line).
Data output counts: Result Data Format 7
(LREAL 32 counts)
User area: Enable
When you use Multi-line random-trigger mode,
set the communication of each Lines to EtherCAT.
27
6. Generating and Outputting Data for the Pick Operation
6.1. Function Overview
After the FH Sensor Controller detects a workpiece on the conveyor, it does the following:
1. Sorts the work pieces by type.
2. Extracts the work pieces that the robot can grip.
3. Outputs the information data for 1 and 2 above.
6.2. Sample Scene Overview
Describes about Sample Scene: P&P_SampleScene when generates the information for Set
Point, and performs the output function.
The Sample Scene: P&P_SampleScene includes functions described in About Detection
and Duplicate Exclusion Capability in this manual.
For more information about each processing item, refer to the Vision System Processing Item
Function Reference Manual (Cat. No. Z341-E1).
For more information about Scenes and macros, refer to the FH/FZ5 Series Vision System
User’s Manual (Cat. No. Z340-E1).
This table describes the sample Scene following the arrangement of the Scene contents.
Scene content
Available processing items
Explanation
This macro sorts the detected work
Classification macro
Unit Macro
processing
(Sample macro: Classifica-
pieces according to the user-defined
tion)
conditional expression.
For details of this function, refer to
Classification Sample Macro in this
manual.
↓
GripInterfer-
Unit macro
This macro determines the capability
enceCheck macro
(Sample macro: GripInter-
of the robot tool to grip the detected
processing
ferenceCheck)
work piece.
For details of this function, refer to
Sample Macro for Grip Interference
Check in this manual.
↓
28
DataOutput
Unit macro
macro processing
(Sample macro: DataOutput)
This macro outputs the detected work
pieces information (measured data).
It integrates data from each processing
items and Sample Macros, and then
generates the data array for outputting.
For details of this function, refer to
Data Output Sample Macro in this
manual.
↓
Macro
Unit Macro
(DBUG_
(Sample Macro:
GetMacroError)
DEBUG_GetMacroError)
For details of this macro, refer to DEBUG Get Macro Error in this manual.
This macro references and displays
errors for sample macros.
For more details, refer to Error processes in this manual.
↓
Measurement completion
↓
Folder
Gravity and Area
(Processing items
for Classification)
Processing items using for classifica-
Search
tion are stored in this folder.
Shape Search II
For details of this function refer to
Shape Search III
11.Error: Cannot find reference location
Labeling
in this manual.
Barcode
2D Code
OCR
Character Inspection
↓
Folder
(Processing items for
the grip interference
check)
Gravity and Area
Holds processing items used for the
grip interference check processing.
For details of this function, refer to
Sample Macro for Grip Interference
Check in this manual.
Processing items using for Grip Interference Check are stored in this
folder.
29
6.3. Function Detail
6.3.1.
Data Flow Diagram
The data flow diagram is presented below.
30
6.3.2.
Unit Labels Used in Sample Scenes
In Sample Scenes, unit labels are used to reference the result of each processing.
For more information about unit labels, refer to the FH/FZ5 Series Vision System User’s
Manual (Cat. No. Z340-E1).
Processing unit
Unit label
Classification macro
CLASSIFICATION
GripInterferenceCheck macro
GLIP_INTERFERENCE_CHECK
DataOutput macro
DATA_OUTPUT
Folder (Processing items for the grip interference check)
Reset Scroll (Classification):
SCROLL_RESET_UNIT_00
Scroll (GripInterferenceCheck)
SCROLL_UNIT_01
Inspection Unit 0
INSPECTION_UNIT_00
Inspection Unit 1
INSPECTION_UNIT_01
Inspection Unit 2
INSPECTION_UNIT_02
Inspection Unit 3
INSPECTION_UNIT_03
Folder (for Classification processing item)
6.3.3.
Reset Scroll (GripInterferenceCheck)
SCROLL_RESET_UNIT_01
Scroll (GripInterferenceCheck)
SCROLL_UNIT_01
Grip interference check processing unit
COLOR_AREA
Output Data Format
Data is output in following formats.
Data that are defined as external reference table on existing models and versions of FH
Sensor Controller can be output. Although up to 100 pieces of target position information can
be sent to the NJ-Robotic CPU, if the number of information exceeds the number of the Result Data objects, output cannot be complete at once. Send the information separately in that
case.
If data output is split up, a zero data package will be output so that the data for each work
piece (position, angle, ID) is not split up. The header for each data output package must include the encoder value and the number of work pieces.
Data
Data type
Explanation
Encoder value when
DINT
Return output of the encoder value at NJ
outputs Trigger
(At data output time
trigger generation time is sent.
the data is converted
The setting range of encoder value is 0 to
to LREAL type and
2147483647, and the value goes back to 0
outputted.)
after reaching 2147483647.
31
Work position and
DINT
The maximum number of work pieces per 1
rotation
(At data output time
time data output will vary between 3 to 7 de-
for each Line
the data is converted
pending on data type/number.
Number of work
to LREAL type and
pieces sent per data
outputted.)
information
output.
Sysmac Error Status
LREAL
Position and angle of
* Available on ver.5.20 FH Sensor Controller
Outputs the output data: Mark position X, Y,
output work pieces
and angle TH.
If the Mark does not have angle information,
always outputs zero as angle information.
User-defined processing result
LREAL
* Available on ver.5.20 FH Sensor Controller
Outputs the User-defined processing result,
When you use this data, you can combine
the processing results of multiple Sample
Macros and output these as one processing
result (ID).
32
Data output (PDO assignment image) is as follows.
The detection result is divided into several outputs when it
exceeds Result Data[32].
33
6.4. Restrictions
Keep the following points in mind when using this sample Scene and related sample macros.
Setting
Sample Scene:
Description
To obtain correct encoder values, the multi-input func-
Scene: 1 P&P_SampleScene
tion is unavailable.
Regarding Encoder value
Restrictions for encoder value:
・Encoder value must be set 0-2147483647
・Once reaching its maximum value (2147483647), the
encoder value must return to 0.
Sample Macro
Do not edit the macro except the part in between
"'Start//////..." and "...///End".
Data Output
In this Sample Macro, you cannot carry out the following processes:
・Using the Sample Macro having data for data output
process.
・Data output processes when the measurement is NG
(judgment is failed). In this case, re-adjustment is
required until the judgment of related Sample Macro
is OK.
34
7. Hints for Adjustment
7.1. Workflow for Startup and Setting Adjustment
Follow the steps described in the table on this page to launch or adjust the FH Sensor Controller. You can skip steps for functions that are unnecessary, or are already adjusted.
For more information about each processing item, refer to the Vision System Processing Item
Function Reference Manual (Cat. No. Z341-E1).
For more information about Scenes and macros, refer to the FH/FZ5 Series Vision System
User’s Manual (Cat. No. Z340-E1).
No
1.
Overview
Camera
Where to adjust
Image capture
Adjustment
Adjusts the Camera Image Input function.
2.
Unit label setting
All Sample Macros
Sets the Unit label for all of the applicable processing items. For the target
object, refer to 5.3.2 and 6.3.2 Unit Labels Used in This Sample Scene in this
manual.
3.
Calibration data
Calibration data
Disable measurement on unit macros
processing item
processing item
since measuring without setting up unit
macros may cause errors.
Using the Edit flow button in the
Toolbox Pane, measurement processing is disabled.
Macro (GetEncValue)
Macro (RemoveDuplication)
Macro (GripInterferenceCheck)
Macro (Classification)
Macro (DataOutput)
4.
Setting of where
Calibration
Set the Scenes and units to reference
to reference the
data reference
calibration data
for calibration data.
Target Scene: 0.P&P_CalibScene
Target Unit: Conveyor Calibration
5.
Setting of where
Processing
items
Set the Scene, unit, and data number
to obtain the
for processing unit
from which to obtain the conveyor
value of move-
data acquisition
movement value per encoder value.
ment per Encoder value from.
Target Scene: 0.P&P_CalibScene
Target unit: Conveyor Calibration
Target data number: 127 (movement
amount X per one encoder value.)
Target data number: 128 (movement
amout Y per one Encoder value.)
35
6.
Setting of en-
GetEncValue
Set the user input area number of the
coder value
macro
encoder value data source. Default
source and the
value: 1.
maximum En-
Also set the maximum encoder value.
coder value
7.
Setting of detec-
Processing
tion
for detection
processing
items
Set processing items for detection.
Adjust model settings, color specification, and measurement parameters.
items
Set the calibration to ON.
Set the Overall judgment to Enable.
Note: If an angle information is include
the measurement result of your using
processing items, output angle data
may be changed according to the reference coordinate angle when Model is
registered even the detected position of
Mark is same.
8.
Initialize image
Camera switching
after executing
processing item
filter processing.
If you use the processing items of, this
macro replace an image proceeded by
Camera Input Image function with an
image after Filter processing items.
9.
Setting of where
Calibration
This macro re-references the calibration
to reference the
data reference
data from Camera Switching. The set-
calibration data
tings from No.4 above will be used as
the reference settings.
10
Setting of
Processing of
For this macro to work correctly, the
Remove Duplica-
RemoveDuplica-
work piece position coordinates along
tion
tion
with the following settings are required:
・From Num. 5 above:
Setting for where to obtain the value
of movement per encoder value from.
・From Num. 6 above:
The encoder value source setting and
the maximum encoder value setting.
Set variables included in the user
specified area.
36
To use Sample Macro of Remove Duplication, set to ON.
The following settings described in
preceding sections of this table must be
complete: "5. Setting of where to obtain
the value of movement per encoder
value from", and "6. Setting of encoder
value source and the maximum encoder
value".
Set variables included in the user
specified area.
For details of each parameters settings, refer to Sample Macro for Duplicate Exclusion in this manual.
11.
Settings for
SCROLL
Macro
(Classification)
This macro sets the Classification
macro to ON for adjustment.
(GripInterfer-
Sets the target area of SCROLL.
enceCheck)
The target area is used for SCROLL
which is set the Reference position of
Detected units to X and Y.
E.g.
12
Processing of
Sets parameters for Measurement re-
Settings for
Classification
gion and/or Model registration.
Classification
0 to 3
Image capture and adjustment will be
performed one by one for each work
piece object for classification.
Work pieces judged as NG by the
Classification Processing item will be
separated from the target work piece
output data. At the same time, set the
Judgment conditions in the Measurement parameters.
37
13
Settings for
Processing of
This macro set the GripInterfer-
SCROLL of
SCROLL of
enceCheck macro to ON for adjustment
GripInterfer-
GripInterfer-
(Using the Edit flow button in the
enceCheck
enceCheck
Toolbox Pane).
Set the target region of SCROLL of
GripInterferenceCheck.
The target area is used for SCROLL
which is set the Standard position of
Detected units to X and Y.
14
Settings for Mac-
Processing items
Set a region for the grip interference
Mac-
for the grip inter-
check.
ro(GripInterferen
ference check
ceCheck)
(Gravity and Area)
15
Settings for
Processing of
This macro sets the GripInterfer-
Center of gravity
GripInterfer-
enceCheck settings and its background
of GripInterfer-
enceCheck
color.
enceCheck
Removes the work piece what is judged
Gravity and Area
as NG (failed) in the GripInterferenceCheck
Make sure to set the judgment condition
of measurement parameters simultaneously.
16
Settings for
GripInterfer-
References the Center of gravity area
Standard area
enceCheck
values set in Step 15 above and uses
value of GripIn-
them to set the Standard area value:
terferenceCheck
Gravity and Area
IN_STANDARD_AREA#
17
Settings for Mac-
Classification
Set variables included in the user speci-
Mac-
macro
fied area. For detail of each parameter,
ro(Classification)
refer to Classification Sample Macro
(user-defined
section in this manual.
area)
18
Settings of Data
Output macro
DataOutput macro
This macro set the GripInterferenceCheck macro to ON for adjustment
(Using the Edit flow button in the
Toolbox Pane).
Sets a variable including the User-defined area.
38
For detail of each parameter settings,
refer to Output Data Sample Macro
section in this manual.
19
Data output
Confirm on
Confirm that the measurement result of
confirmation
Sysmac Studio
the FH Sensor Controller is output to NJ
series. There should be data for more
than one target as described in 6.3.3.
Output Data Format.
7.2. Sample Macro Errors
There are errors uniquely defined in the sample macros other than Error Message described
in the FH/FZ5 Series Vision System User’s Manual (Cat. No. Z340-E1), and Sysmac Error
Status (described in the FH/FZ5 Series Vision System User’s Manual for Communications
Settings (Z342-E1).
When sample errors occur, stop measurement until the issue is solved to prevent false
measurements.
“Error codes and error sub-codes are defined for each Sample Macro. The Error code shows
the type of error. The Error sub-code shows the location of the error in the Sample Macro. Use
the Error codes and Error sub-codes to resolve errors.
In the image below, ERR CODE and SUB CODE are displayed on the upper-left of the image.
39
7.2.1.
List of Error Codes
Errors defined for the sample macros are described in the following table.
Error
Code name
Summary
Possible cause
Setting Data is Out Of
Data is set outside
A value outside the available setting
Range
the available range
range is specified.
Setting Data is Out Of
Obtained data is out
Data obtained from other units has value
Range
of the available range.
set outside the measurable range.
code
-10
-11
Wrong data is obtained.
-12
Set wrong label name
Unit label issue
Wrong unit label is set.
-13
Sorting Error
Sorting error
There is an issue during sorting.
-14
Set wrong string
Character string set-
Character string is changed to unsup-
ting error
ported form.
Set wrong System
System data setting
Required system data is not setup.
Data
error
Exceptional error
Other type of Error
-15
-16
・Confirm the displayed number as
ERR_SUB_CODE, see the Error List in
the Vision System FH/FZ5 Series User’s
Manual.
-17
Relating Sample-
Related Sample
・The judgment of Sample Macro related
Macro Unit Judge-
Macro Unit Judgment
to the measurement processing is
ment is 'JUDGE_NG'
is NG (FAIL) Judge-
Judgement is NG (FAIL).
ment.
7.2.2.
Error code details
Detailed information for error codes is described in the following table.
Error name
Setting Data is Out Of Range
Error code
Summary
Data is set outside the available range
Problem area
Sample Macro
Solution
Macro code revision
Cause and
Possible cause
Corrective action
Prevention
remedy
A value outside the available
Adjust the value within
Confirm that the value
setting range is specified.
the
does not exceed the set-
available
range.
-10
setting
ting range when changing a setting.
Note/ comment
None
40
Error name
Setting Data is Out Of Range
Error code
-11
Summary
Obtained data is out of the available range.
Problem area
Sample Macro
Solution
Macro code revision
Cause and
Possible cause
Corrective action
Prevention
remedy
Data obtained from other
Check the target data.
When
changing
data,
units has value set outside
consider how it affect to
the measurable range.
other macros.
Wrong data is obtained.
Confirm the name of
Pay close attention to the
variables and units to
name of variables, etc.
obtain the data from.
Note/ comment
None
Error name
Set wrong label name
Summary
Unit label issue
Problem area
Error code
-12
Sample Macro
Solution
Macro code revision
Cause and
Possible cause
Corrective action
Prevention
remedy
Incorrect unit label is set.
Correct the unit label.
Pay close attention when
labeling units.
Note/ comment
None
Error name
Sorting Error
Summary
Sorting error
Problem area
Error code
-13
Sample Macro
Solution
Macro code revision
Cause and
Possible cause
Corrective action
Prevention
remedy
There is an issue during
Confirm
and
correct
When
sorting.
user-specified
varia-
bles such as data type
changing
data,
consider how it affect to
other macros.
count as needed.
Note/ comment
If the error cannot be solved even you try to the corrective action, confirm Errno
(error number) in the Data Output Sample Macro, and then retry the corrective action.
The error list in the Macro Reference section on page 320-323 in the FH/FZ5 Series
Vision System User’s Manual (Cat. No. Z340-E1).
Error name
Set wrong string
Error code
-14
Summary
Character string setting error
Problem area
Sample Macro
Solution
Macro code revision
Cause and
Possible cause
Corrective action
Prevention
remedy
Character string is changed
Confirm and correct the
Make
to unsupported form.
character string.
string is correct.
Note/ comment
sure
character
None
41
Error name
Set wrong System Data
Error code
-15
Summary
System data setting error
Problem area
Sample Macro
Solution
System setting change
Cause and
Possible cause
Corrective action
Prevention
remedy
Required system data is not
Set the communication
Pay extra attention when
setup.
module
changing
fieldbus
to
EtherCAT, and enable
the
system
setting.
the user input area.
Note/ comment
None
Error name
Exceptional error
Summary
Other Error
Problem area
Error code
-16
Sample Macro
Solution
Corrects Macro code
Cause and
Possible cause
Corrective action
Prevention
remedy
Confirm the displayed num-
Same as the left de-
Same as the left descrip-
ber as ERR_SUB_CODE,
scription.
tion.
Error code
-17
see the Error List in the Vision
System FH/FZ5 Series User’s
Manual.
Note/ comment
None
Error name
Relating
SampleMacroUnit
Judgement is 'JUDGE_NG'
Summary
Related Sample Macro Unit Judgment is NG (FAIL) judgement.
Problem area
Sample Macro where the
Solution
data is referenced
Cause and
Possible cause
remedy
The
Note/ comment
Change the System settings
Corrective action
Prevention
Readjust the judge-
When you restart meas-
Macro referenced data is
ment of Sample Macro
urement, the judgement
Judgement is NG (FAIL).
to be from NG (FAIL) to
status for all the sample
OK.
macro units must be OK.
judgment
of
Sample
None
42
7.2.3.
Error Sub Code
Error sub-codes are defined for the Sample Macro. The Error codes and Error sub-codes
can be used to help solve errors. How to use the Error sub-codes differs depending on the
Error code.
ERR CODE
Corrective action for the displayed Error sub-code (SUB CODE)
-10
Error sub-codes are defined for the Sample Macro. The Error codes and Error
-12
sub-codes can be used to help solve errors. How to use the Error sub-codes
-14
differs depending on the Error code.
-11
-17
Error sub-codes are defined for the Sample Macro. The Error codes and Error
sub-codes can be used to help solve errors. How to use the Error sub-codes
differs depending on the Error code.
-13
-16
The displayed Error sub-code is a 7 digit number comprised of the Macro Error
number and the Error sub-code defined in the Sample macro.
The contents are as below:
Error sub-codes are defined for the Sample Macro. The Error codes and Error
sub-codes can be used to help solve errors. How to use the Error sub-codes
differs depending on the Error code.
-15
Confirm the settings of 5.4 Restriction System settings in this manual.
43
8. Sample Macro for Obtaining Encoder Value
This Sample Macro (GetEncValue) aquires the encoder values used for the measurement of FH
Sensor Controller.
8.1. When to Use This Sample Macro
This sample macro is used when obtaining the conveyor encoder value via NJ series.
Precautions for Use
Only encoder values in an integer (DINT) can be obtained using this sample macro.
To be able to obtain the encoder value in LREAL, changing the NJ program and sample
macro itself is necessary.
44
8.2 Flow Chart of Sample Macro
The flow chart of the GetEncValue Sample Macro is as below.
8.3. Required Settings List
The following settings need to be adjusted when using the sample macro for encoder value
acquisition.
Setting
Input argument
Overview
Set the Input argument. You can adjust the encoder value acquisition process by changing the Input argument.
8.4. Setting Input Arguments
Specify the User Input Area number of the Encoder value source area and set the maximum
Encoder value.
Precautions for Use
If the encoder value acquisition is not performed correctly, the following cases may occur:
・The Remove Duplication process will not be performed correctly.
・The NJ-Robotics may malfunction due to Mark position shift.
Confirm the encoder value acquisition is performed correctly at start time, or when adjusted.
45
The format and parameters of arguments are listed below.
Name
IN_AREA_NO&
Type
Integer type
Description
Sets the user input area number to write the encoder value during image capture. For more about
how to use the user input area, refer to User’s
Manual for Communications Settings.
IN_MAX_ENC_VALUE&
Integer type
Sets the maximum encoder value that FH Sensor
Controller obtains.
8.5.
Returned value
Name
OUT_ENC_VALUE&
Type
Integer type
Descriptions
Stores the encoder value acquired by this
Sample Macro.
When the IN_AREA_NO& is set to 4 or 5, convert the type LREAL to DINT, and then stores its
encoder value.
OUT_MAX_ENC_VAL
Integer type
UE&
Saves the maximum encoder value used for the
measurement.
Useful Information
The returned value of sample macro is obtained using the macro function "GetUnitData".
The formats will be as follows: GetUnitData <unitNo>, <dataIdent>, <data>. The argument
applies as follows:
・<unitNo>:
The unit number assigned to the Sample Macro unit used to obtain the encoder value.
・<dataIdent>:
The name of the variable of the returned value to be referenced (OUT_ENC_VALUE&,
etc.). It should be enclosed in double quotes since it will be treated as a character string.
・<data>:
Prepare variable in the same data type as the reference data.
For more information about macro functions, refer to the FH/FZ5 Series Vision System User’s Manual (Cat. No. Z340-E1).
8.6.
Processing of Display and Drawing
Displaying and Drawing Processing can be used in the Sample Macro.
With the GetEncValue function for acquiring encoder values, the following information can be
displayed in the Graphic display window and the Detailed result display window,
When Sysmac Studio is on-line status, is not applied to display on the Detailed result window.
46
・Acquired Encoder Values.
・Debugging mode and Off-line mode (Does not display in the release mode).
47
・Error Code and Error Sub Code (Only when the Error occurs.)
8.7.
Troubleshooting
When
Cannot acquire
What to adjust
EtherCAT
Confirm:
・Is the EtherCAT available for communication?
the Encoder value.
・Isn't EtherCAT enabled?
・Is the PDO mapping different from NJ?
・Is the User Input Area enabled?
Encoder value is not
updated.
Sysmac Studio
・NJ series is not Error status?
・Is the Encoder value written in a different
User input area?
48
9. Sample Macro for Duplicate Duplication
This macro performs RemoveDuplication function.
When detecting objects moving on the conveyor, you can exclude objects that already have
been measured from detection using the encoder value.
9.1. When to Use This Sample Macro
Use this sample macro when you want to exclude objects that are previously detected from
the current detection.
Precautions for Use
・To use this Sample Macro, the Encoder value and the conveyor movement value per Encoder value are required.
・To enable duplicate exclusion, the trigger needs to be set in a pace where images overlap
by the width of one target object.
9.2. Flow Chart of Sample Macro
The flow chart of the RemoveDuplication Sample Macro is as below.
49
9.3. Required Settings List
Setting
Unit label setting
Overview
Set the unit label to save data to be used for Remove Duplication.
Input argument setting
Set the Input argument.
You can adjust the Remove Duplication process by changing the
Input argument.
9.4.
Unit Label Setting
Sets the Unit label having data used in the GripInterferenceCheck.
Target of Unit label settings are the following:
・GET_CONVEYOR_DIST
・GetEncValue
・DETECT_UNIT
For more information, refer to 5.3.2. Unit Labels Used in Sample Scenes.
50
Precautions for Use
・Unit labels can be set and changed only by using the Scene control macro.
・Setting a unit label is required when using the duplicate exclusion sample macro.
・To change or add name of unit labels listed in 5.3.2. Unit Labels Used in Sample Scenes,
editing of sample macro is required.
Useful Information
・By assigning unit labels, processing units can be specified by the unit label instead of the
processing unit number.
・By doing this, you can avoid editing macro program when the processing unit number
changes due to a change of the measurement flow.
Reference
5. Optimizing Scenes (Measurement Flows) (Macro Customize Functions) in the FH/FZ5
Series Vision System User’s Manual (Cat. No. Z340-E1).
9.5.
Setting Input Arguments
This chapter describes the Input argument used for the duplicate exclusion processing.
You can adjust settings for duplicate exclusion or data destination by changing the Input argument.
Precautions for Use
To use this sample macro, the values of movement per encoder value and measurement data
are required.
The format and parameters of arguments are listed below.
Name
IN_ENC_UNIT$
IN_CONVEYOR_DIST_UNIT$
Type
Description
Character
Sets a Unit Label for the GetEncValue
string type
macro.
Character
Sets a unit label for
string type
IN_CONVEYOR_DIST_UNIT which is
used to obtain the conveyor movement
value per encoder value.
IN_DETECT_UNIT$
IN_CNT_DATA$
IN_DATA_IDENT_X$
Character
Sets a unit label for Detection processing
string type
items.
Character
Sets an identifier for detection count data
string type
on Detection processing items.
Character
Sets an identifier for the X coordinate on
string type
Detection processing items.
51
IN_DATA_IDENT_Y$
IN_DATA_IDENT_Y$
IN_LABELING_FLG&
Character
Sets an identifier for the Y coordinate on
string type
Detection processing items.
Character
Sets an identifier for the angle data on
string type
Detection processing items.
Integer type
Sets to True: Enable when the Detection
processing items is Labeling.
IN_LABEL_DATA_UNIT$
Character
This macro sets the Unit Label of Label data.
string type
If the Detection processing item is not Labeling, set the non-whitespace character:
(“”).
IN_THRESHOLD_NUM#
IN_DELETE_ID&
Double pre-
Sets the threshold value of duplication de-
cision type
termination in mm.
Integer type
An ID assigned to duplicates. By setting a
value between -90 to -99, it is excluded from
data output.
Precautions for Use
Data will not be obtained if the unit label that is set preliminary is not used.
9.6.
Returned Value
Name
OUT_DATA_NUM&
Type
Integer type
Description
Saves the count of data used for duplicate
exclusion.
OUT_DATA#(,)
OUT_ENC_VALUE&
Double-
Saves the assigned ID and the data used for
precision type
duplicate exclusion.
Integer type
Saves the encoder value used for duplicate
exclusion.
Useful Information
The returned value of sample macro is obtained using the macro function "GetUnitData".
The formats will be as follows: GetUnitData <unitNo>, <dataIdent>, <data>. The argument
applies as follows:
・<unitNo>:
The unit number assigned to the Sample Macro unit used to obtain the encoder value.
・<dataIdent>:
The name of the variable of the returned value to be referenced (OUT_ENC_VALUE&,
etc.). It should be enclosed in double quotes since it will be treated as a character string.
・<data>:
52
Prepare variable in the same data type as the reference data.
For more information about macro functions, refer to the FH/FZ5 Series Vision System
User’s Manual (Cat. No. Z340-E1).
9.7. Processing of Display and Drawing
Displaying and Drawing Processing can be used in the Sample Macro. With the GetEncValue
function for acquiring encoder values, the following information can be displayed in the Graphic
display window and the Detailed result display window,
・A graphic display of the processing unit model used for detecting the work piece objects, with
cross-hair display (when there is no angle information available from the Processing item used to
detect the target work pieces, only the cross-hairs pointer will be displayed.
・No-duplication work pieces: Green
・Duplicated work pieces: Red
53
・Debug mode: Does not display in Release mode.
・Error Code and Error Sub Code (Only when the Error occurs.)
54
9.8.
Troubleshooting
When
What to adjust
Confirm:
Duplicates are not recog-
Macro
Is the value of
nized
(RemoveDuplication)
IN_THRESHOLD_NUM# too
small?
All detections are recog-
Macro
Is the value of
nized as duplicates
(RemoveDuplication)
IN_THRESHOLD_NUM# too large?
Duplicate exclusion is not
Macro
Is the maximum encoder value set
performed when the en-
(GetEncValue)
in the Macro (GetEncValue) unit
coder value strides the
different from the actual maximum
maximum value and 0.
encoder value?
Does not remove the du-
・Calibration data ref-
・Calibration data reference macro
plicated work piece.
erence
refers the accurate data?
・Processing unit data
・Processing unit data acquisition
acquisition
macro acquires the accurate data?
・Detection processing
・Did you set the calibration of the
・RemoveDuplication
Detection processing macro to ON?
・Can you acquire the CONVEYOR_DIST#()?
55
10. Sample Macro for Grip Interference Check
Sample macro "Macro (GripInterferenceCheck)" is used to evaluate whether or not there
is enough space for a robot to grip the target object moving on the conveyor. The space
evaluation is performed by measuring the surface area of the back ground. If there is not
enough space, the target object is excluded from the detection.
10.1. When to Use This Sample Macro
Use this sample macro to evaluate if there is enough space for the robot to grip the target
object within a specified region.
Precautions for Use
The grip capability is determined by the area ratio (%) of the detected surface area against
the reference surface area of the background surface area.
The reference area needs to be adjusted again when the grip region or the specified color is
changed.
10.2. Flow Chart of Sample Macro
The flow chart of the GripInterferenceCheck Sample Macro is as below.
56
10.3. Required Settings List
Setting
Overview
Unit label setting
Set a unit label to a processing item that has data for sorting.
Input Argument Setting
Set the Input argument. You can adjust the classification process
by changing the Input argument.
10.4. Unit Label Setting
Set the Unit Labels for processing items that has data for grip interference check.
Precautions for Use
・Unit Labels can be set and changed only by using the Scene control macro.
・The Unit Label setting is required when using the GripInterferenceCheck macro unit.
・To change or add the Unit Labels listed in 6.3.2. Unit Labels Used in Sample Scenes, editing of sample macro is required.
57
Useful Information
・By assigning Unit Labels, you will be able to specify processing units by the Unit Label
instead of the processing unit number.
・By doing this, you can avoid editing macro program when the processing unit number
changes due to a change of the measurement flow.
Reference
5. Optimizing Scenes (Measurement Flows) (Macro Customize Functions) in the FH/FZ5
Series Vision System User’s Manual (Cat. No. Z340-E1).
10.5. Setting Input Arguments
This chapter describes the Input argument used for the grip interference check processing.
You can adjust settings for duplicate exclusion or data destination by changing the Input argument.
Name
IN_DETECT_UNIT$
Type
Character
string type
IN_CNT_DATA$
IN_DATA_IDENT_X$
IN_DATA_IDENT_Y$
IN_DATA_IDENT_TH$
Character
Description
Set unit labels for detection type processing
units.
Sets a detection count identifier data for detect
string type
units of target work piece.
Character
Set an identifier for the X coordinate in the de-
string type
tection processing items.
Character
Set an identifier for the Y coordinate in the de-
string type
tection processing items.
Character
Sets an angle identifier of detect units.
string type
If the detection unit processing items does not
have any angle information, set the disable
strings: ””.
IN_LABELING_FLG&
Integer type
Sets to True: Enable when the Detection processing items is Labeling.
IN_LABEL_DATA_UNIT$
Character
This macro sets the Unit Label of Label data.
string type
If the Detection processing item is not Labeling,
set the non-whitespace character: (“ ”).
IN_SCROLL_NAME_X$
IN_SCROLL_NAME_Y$
IN_SCROLL_NAME_TH$
Character
Sets an identifier for the X coordinate on target
string type
object of SCROLL.
Character
Sets an identifier for the Y coordinate on target
string type
object of SCROLL.
Character
Sets an angle identifier for target object of
string type
SCROLL.
If the detection unit processing items does not
58
have any angle information, set the disable
strings: ””.
IN_SCROLL_UNIT $
Character
Sets the Unit Label of SCROLL.
string type
IN_INSPECTION_UNIT$
Character
Sets the Unit Label of GripInterferenceCheck.
string type
IN_INSPECTION_DATA$
IN_SCROLL_RESET_UNIT$
Character
Sets a data identifier using for GripInterfer-
string type
enceCheck.
Character
Sets the Unit Label name of Camera Switching.
string type
IN_DELETE_ID&
Integer type
Sets the delete ID which is assigned when the
GripInterferenceCheck is judged impossible.
IN_THRESHOLD_NUM#
Double pre-
Sets the threshold (%) of the area ratio where is
cision type
detected to the reference area of background
area.
IN_STANDARD_AREA#
Double pre-
Sets the reference area value of background of
cision type
GripInterferenceCheck.
Precautions for Use
Data will not be obtained if the unit label that is set preliminary is not used.
59
10.6. Returned Value
Name
OUT_DATA_NUM&
Type
Integer type
Description
Sets the reference area value of background of
GripInterferenceCheck.
OUT_DATA#(,)
Real type
Stores the assigned ID and the data used in
GripInterferenceCheck.
Useful Information
The returned value of sample macro is obtained using the macro function "GetUnitData".
The formats will be as follows: GetUnitData <unitNo>, <dataIdent>, <data>. The argument
applies as follows:
・<unitNo>:
The unit number assigned to the Sample Macro unit used to obtain the encoder value.
・<dataIdent>:
The name of the variable of the returned value to be referenced (OUT_ENC_VALUE&, etc.).
It should be enclosed in double quotes since it will be treated as a character string.
・<data>:
Prepare variable in the same data type as the reference data.
For more information about macro functions, refer to the FH/FZ5 Series Vision System User’s Manual (Cat. No. Z340-E1).
10.7. Processing of Display and Drawing
Displaying and Drawing Processing can be used in the Sample Macro. With the GetEncValue
function for acquiring encoder values, the following information can be displayed in the Graphic
display window and the Detailed result display window,
The Detailed result window is not displayed when Sysmac Studio is in the On-line status.
・A graphic display of the processing unit model used for detecting the work piece objects, with
cross-hair display (when there is no angle information available from the Processing item used
to detect the target work pieces, only the cross-hairs pointer will be displayed.
60
・No- GripInterferenceCheck work pieces: Green
・GripInterferenceChecked work pieces: Red
Debug mode: Does not display in Release mode.
61
Error Code and Error Sub Code (Only when the Error occurs.)
10.8. Folders of GrapInterferenceCheck Processing Item
Processing item
Reset SCROLL
Usable function
SCROLL
Description
Resets the SCROLL which is executed
measurement.
SCROLL
SCROLL
Moves the detected work piece in Detection
processing unit to Standard position.
Processing units of
GripInterferenceCheck
Gravity and Area
Measure the necessary region for GripInterferenceCheck to the detected work pieces
one-by-one.
62
10.9. Troubleshooting
When
What to adjust
Duplicates
GripInterferenceCheck
are not recognized
Sample Macro
Confirm:
・Is the value
of IN_THRESHOLD_NUM# too small?
・Is the value
of IN_STANDARD_AREA#?
All detections are
GripInterferenceCheck
recognized as
Sample Macro
duplicates
・Is the value
of IN_THRESHOLD_NUM# too large?
・Is the value
of IN_STANDARD_AREA# too small?
・Is the judgment of
GripInterferenceCheck as NG (failed)?
63
11. Classification Sample Macro
When there are various types of work pieces moving on the conveyor, this macro can classify
them according to User-defined conditions and assign IDs.
11.1. When to Use This Sample Macro
.This macro classifies or discriminates the various work pieces on the conveyor.
Precautions for Use
Changing the configuration or setting of Classification processing items, this macro can carry
out the Classification of the various patterns.
The work pieces can be sorted into a maximum of eight types (by default, four types).
11.2. Flow Chart of Sample Macro
Classification Sample Macro performs the processes as the following flow chart.
64
11.3. Required Settings List
Setting
Unit label setting
Overview
Set a unit label to a processing item that has data for sorting.
Set a unit label having processing item data used for classification.
Input argument setting
Set the Input argument. You can adjust the classification process by changing the Input argument.
Changing the Input argument, Classification processing can be
changed also.
11.4. Unit Label Setting
Set a unit label having processing item data used for classification.
Precautions for Use
・Unit labels can be set and changed only by using the Scene control macro.
65
・Setting a unit label is required when using the duplicate exclusion sample macro.
・When you change or add new Unit labels described in 5.3.2 Unit Labels Used in Sample
Scenes, the written data is required to change.
Useful Information
・By assigning unit labels, you will be able to specify processing units by the unit label instead of the processing unit number.
・By doing this, you can avoid editing macro program when the processing unit number
changes due to a change of the measurement flow.
Reference
5. Optimizing Scenes (Measurement Flows) (Macro Customize Functions) in the FH/FZ5
Series Vision System User’s Manual (Cat. No. Z340-E1).
11.5. Setting Input Arguments
This describes the Input argument used for measurement.
You can adjust the classification process by changing the Input argument.
Name
IN_DATA_KIND_NUM&
Type
Integer type
Description
Sets the number of Classification, which
can be up to 8 types. The default value is
4 types.
When you change the settings, changing
of IN_DATA_INFO$(, ) is also required.
IN_DATA_INFO$(, )
Character string
Sets the Unit Label and data identifier of
type
Classification processings.
Need to change only the number of
Classification kinds which set in
IN_DATA_KIND_NUM&.
IN_DETECT_UNIT$
IN_CNT_DATA$
IN_DATA_IDENT_X$
IN_DATA_IDENT_Y$
Character string
Sets a unit label for Detection processing
type
item.
Character string
Sets an identifier for detection count data
type
on Detection processing item.
Character string
Sets an identifier for the X coordinate on
type
Detection processing item,
Character string
Sets an identifier for the Y coordinate on
type
Detection processing item,
66
IN_DATA_IDENT_TH$
Character string
Sets an angle identifier of detect units.
type
If the detection unit processing items
does not have any angle information, set
the disable strings:””.
IN_LABELING_FLG&
Integer type
Sets to True: Enable when the Detection
processing items is Labeling.
IN_LABEL_DATA_UNIT$
Character string
This macro sets the Unit Label of Label
type
data.
If the Detection processing item is not
Labeling, set the non-whitespace character: (“”).
IN_SCROLL_NAME_X$
Character string
Sets the X coordinate identifier for
type
IN_SCROLL_NAME_Y$
IN_SCROLL_NAME_TH$
Character string
Sets the Y coordinate identifier for
type
SCROLL.
Character string
Sets the angle identifier of SCROLL.
type
If the detection unit processing items
does not have any angle information, set
the disable strings:””.
IN_SCROLL_UNIT $
Character string
Sets the Unit Label of SCROLL.
type
IN_SCROLL_RESET_UNIT$
Character string
Sets the Unit Label of Camera Switching.
type
IN_THRESHOLD_NUM#()
Double precision
Sets the threshold for judgment of Classi-
type
fication condition.
This parameter can set the threshold of
each unit judged each kind.
When the threshold is larger than Classification condition data, assigns the Classification ID.
IN_DELETE_ID&
Integer type
This ID is possible to assign when the
Classification is impossible.
Values of -99 to 99 are excluded from
output data
IN_ID&(0)
Integer type
Sets the assigned ID when the judgment
parameters of Classification reach the
threshold.
Precautions for Use
Data will not be obtained if the Unit Label that is set preliminary is not used.
67
11.6. Returned Value
Name
OUT_DATA_NUM&
Type
Integer type
Description
Saves the count of data used for duplicate exclusion.
OUT_DATA#(,)
Real number
Saves the assigned ID and the data used for du-
type
plicate exclusion.
Useful Information
Return value of Sample Macro perform to acquire using macro function GetUnitData.
Arguments for the GetUnitData function
・<unitNo>:
The unit number assigned to the Sample Macro unit used to obtain the encoder value.
・<dataIdent>:
The name of the variable of the returned value to be referenced (OUT_ENC_VALUE&, etc.).
It should be enclosed in double quotes since it will be treated as a character string.
・<data>:
Prepare variable in the same data type as the reference data.
For detail of macro function, refer to Vision System FH/FZ5 Series User’s Manual.
11.7. Processing of Display and Drawing
Displaying and Drawing Processing can be used in the Sample Macro.
With the GetEncValue function for acquiring encoder values, the following information can be
displayed in the Graphic display window and the Detailed result display window,
The Detailed result window is not displayed when Sysmac Studio is in the On-line status.
・A graphic display of the processing unit model used for detecting the work piece objects, with
cross-hair display (when there is no angle information available from the Processing item used
to detect the target work pieces, only the cross-hairs pointer will be displayed.
68
・No- Classification work pieces: Green
・Classified work pieces: Red
Debug mode: Does not display in Release mode.
69
Error Code and Error Sub Code (Only when the Error occurs.)
11.8. Folders for Classification
Processing item
Usable function
Description
Reset SCROLL
SCROLL
SCROLL executed at measurement time.”
SCROLL
SCROLL
Moves the detected work piece of Detection
processing unit to Standard position.
Classification pro-
Search type pro-
Executes the detail measurement to work
cessing unit
cessing items
pieces detected in Detection processing unit
Edge type pro-
one-by-one.
cessing items
Using the multiple Classification processing
Barcord and 2D
items, confirms the followings:
Barcord
・Which measurement result of processing
OCR, etc.
unit exceeds the threshold
・Which judgment is OK,
Then executes the Classification.
70
11.9. Troubleshooting
When
What to adjust
Confirm:
Incorrect ID is as-
・Classification
・Is the value of IN_THRESHOLD_NUM#()
signed.
Sample Macro
too small?
・Processing items for
・The judgment condition of Sorting pro-
Sorting
cessing items is set correctly?
Classification Sample
・Is the value of IN_THRESHOLD_NUM#()
Macro
too large?
Delete ID is assigned.
・Is the judgment of Sorting processing item
NG (failed) ?
71
12. Sample Macro for Data Output
DataOutput Sample Macro executes the data output.
This macro gets the data from the target processing unit and outputs the detected work piece
information (measured data) to NJ-Robotics.
This macro can combine the ID which each Sample Macro has and rearrange the acquired data.
12.1. When to Use This Sample Macro
Use this sample macro to evaluate if there is enough space for the robot to grip the target
object within a specified region.
Precautions for Use
The grip capability is determined by the area ratio (%) of the detected surface area against
the reference surface area of the background surface area.
The reference area needs to be adjusted again when the grip region or the specified color is
changed.
Changing the DataOutput Sample Macro, the format, contains, or data order can be
changed.
12.2. Flow Chart of Sample Macro
The flow chart of the DataOutput Sample Macro is as below.
72
12.3. Required Settings List
Setting
Overview
Unit label setting
Set a unit label to a processing item that has data for sorting.
Input argument setting
Set the Input argument. You can adjust the classification process
by changing the Input argument.
12.4. Unit Label Setting
Sets the Unit label having processing item data for classification.
Precautions for Use
・Unit labels can be set and changed only by using the Scene control macro.
・Setting a unit label is required when using the duplicate exclusion sample macro.
・When you change or add newly the Unit labels described in 5.3.2 Unit Labels Used in
Sample Scenes, the written data is required to change.
73
Useful Information
・By assigning unit labels, you will be able to specify processing units by the unit label instead of the processing unit number.
・By doing this, you can avoid editing macro program when the processing unit number
changes due to a change of the measurement flow.
Reference
Optimizing Scenes (Measurement Flows) in the Vision System FH/FZ5 Series User’s Manual.
12.5. Setting Input Arguments
The format and parameters of arguments are listed below.
Name
IN_KEY_DATA_NO&
Type
Description
Integer
Sets the data of Sorting processing.
type
Need to set the parameters relate to
IN_DATA_KIND_NUM&.
IN_SORT_TYPE&
IN_ENC_UNIT$
IN_DETECT_UNIT$
IN_CNT_DATA$
IN_DATA_KIND_NUM&
Integer
Sets the sort processing order: descend-
type
ing and ascending order.
Character
Sets the Unit Label of GetEncValue
string type
Sample Macro.
Character
Sets the Unit Label of Detection pro-
string type
cessing items.
Character
Sets the data identifier of detected count
string type
in Detection processing items.
Integer
Sets the data counts for Data Output.
type
Need to change the setting of
IN_TARGET_INFO$(, ).
74
IN_TARGET_INFO$(, )
Character
For the first argument, set the unit label of
string type
the processing unit that holds the data for
data output, the data identifier, and the
count data identifier.
For the second argument, the settings
must be made for each data count set in
IN_DATA_KIND_NUM&. The second
argument is fixed in the order below. If
you add data, therefore, use 4 or later.
0: X coordinate
1: Y coordinate
2: θ
3: ID
IN_LABELING_FLG&
IN_LABEL_DATA_UNIT$
Integer
Sets to True: Enable when the Detection
type
processing items is Labeling.
Character
This macro sets the Unit Label of Label
string type
data.
If the Detection processing item is not
Labeling, set the non-whitespace character: (“”).
IN_ID_MACRO_KIND_NUM&
Integer
Sets the count of Sample Macro execut-
type
ed to acquire ID.
If you change the settings, need to
change IN_ID_MACRO_INFO$(, ).
IN_ID_MACRO_INFO$(, )
Character
Sets the following:
string type
・Unit Label having the data of Data
Output.
・Data identifier
・Count data identifier
Need to change only the count set in
I N_ID_MACRO_KIND_NUM&.
IN_PRIMARY_TASK_PERIOD#
Double
Sets the executed cycle of primary task
precision
which set in NJ series.
type
IN_DATA_LOGGING_FLG&
IN_DATA_LOGGING_FILE_NAME$
Integer
Selects the existence or nonexistence of
type
Data Logging execution.
Character
Sets the file name written the Data Log-
string type
ging.
Precautions for Use
・If the preset Unit label is not used, data acquirement cannot be allowed.
・If the same data is include in the data of target object of sorting, the sorted order may be
75
indefinite.
12.6. Returned Value
Name
Type
Description
OUT_DATA_NUM&
Integer type
Saves the count of data used for duplicate exclusion.
OUT_DATA_KIND_NU
Integer type
Stores the counts of data type used Data Output.
Dou-
Saves the assigned ID and the data used for dupli-
ble-precision
cate exclusion.
M&
OUT_DATA#(,)
type
Useful Information
Arguments for the GetUnitData macro.
・<unitNo>:
The unit number assigned to the Sample Macro unit used to obtain the encoder value.
・<dataIdent>:
The name of the variable of the returned value to be referenced (OUT_ENC_VALUE&, etc.).
It should be enclosed in double quotes since it will be treated as a character string.
・<data>:
Prepare variable in the same data type as the reference data.
For detail of macro function, refer to Vision System FH/FZ5 Series User’s Manual.
12.7. Processing of Display and Drawing
Displaying and Drawing Processing can be used in the Sample Macro. With the GetEncValue
function for acquiring encoder values, the following information can be displayed in the Graphic
display window and the Detailed result display window,
The Detailed result window is not displayed when Sysmac Studio is in the On-line status.
・A graphic display of the processing unit model used for detecting the work piece objects, with
cross-hair display (when there is no angle information available from the Processing item used
to detect the target work pieces, only the cross-hairs pointer will be displayed.
76
・No- Outputed work pieces: Green
・Outputed work pieces: Red
Debug mode: Does not display in Release mode.
77
Error Code and Error Sub Code (Only when the Error occurs.)
12.8. Troubleshooting
When
Does not output data.
What to adjust
Confirm:
Other Sample
・Is the Delete ID assigned to other Sample
Macro
Macro?
・Is the related Sample Macro judgment NG
(failed)?
78
13. Sample Macro for Debug
This macro is for debugging (DEBUG_SetGlobalData).
When you want this Sample Macro to perform virtually in the status where you cannot use
under the real environment.
This macro carries out the describes for debug efficiency when the
13.1. When to Use This Sample Macro
This macro is used when executes the changing of debug mode to display the detection condition or Error condition.
Precautions for Use
Make sure to place this DEBUG Sample Macro before other Sample Macro.
13.2. Required Settings List
Setting
Overview
Unit label setting
Sets the Unit Label having data for Sorting.
Input argument setting
Set the Input argument. You can adjust the classification process
by changing the Input argument.
13.3. Setting Input Arguments
Sets the Input argument used measurement.
Changing the Input argument, GetEncValue method or Debug mode are possible to be
changed.
This chapter describes the Input argument used for measurement.
Name
Type
IN_DEBUG_MODE&
Integer type
Description
Sets the Debug mode.
For details of Debug mode, refer to the Vision System
FH/FZ5 Series User’s Manual.
79
14. Sample Macro for Error Processing
This macro; DEBUG_GetMacroError displays the Error defined Sample Macro.
This macro can acquire the Error defined in each Sample Macro and control to display the
judgment of each Macro unit or display and integer these Error information.
14.1. When to Use This Sample Macro
Since this macro can specify the Unit and parameter position which Error occurred, the Debug
processing can be more efficient.
When an Error occurs, this macro displays the Error code and Error Sub code on the Image
window and detail result display window.
In this case, the above image describes as below.
Error code 14 is occurs on the Unit 13 processing unit when the 9 Error processing is performed,
Normal status.
80
When an Error occurs
81
15. Sample Macro for Communication Command
This sample macro is for communication commands to exchange data with the NJ program:
FH_ConveyorTrackingApplication_SAMPLE_IO_MACRO_Rev*.mcr, where * represents the
revision number.
Create the NJ program based on the interface specifications described in the following pages.
The communication command sample macro includes the following three functions:
3DSimCalib (No.128) as a calibration command for the vision and robot integration simulator;
OutputConvDist (No.254) as a command for the calibration wizard; and
GetUnitNo (No.255) as a command for the non-wizard calibration.
Useful Information
・For the communication commands of the FH Sensor Controller, refer to the FH/FZ5 Series
Vision System User’s Manual (Communications Settings) (Z342-E1-05).
・For the macro customization feature and reference of the FH Sensor Controller, refer to the
FH/FZ5 Series Vision System User’s Manual (Z340-E1-08).
15.1. When to Use This Sample Macro
(1) Calibration Command for the Vision and Robot Integration Simulator
This sample macro serves as a communication command for the calibration by FH using parameters relating to a camera set up in the vision and robot integration simulator (these parameters are referred to as vision and robot integration simulator camera parameters hereafter).
This macro is required only for the use of the vision and robot integration simulator.
Useful Information
For details of the vision and robot integration simulator, refer to The Vision and Robot Integration Simulation Startup Guide (****-****).
(2) Command for the Calibration Wizard
This sample macro serves as a communication command for reflecting "Conveyor travel distance per encoder", which is created by using the NJ program after calibration performed with
the conveyor tracking calibration wizard, to NJ.
This macro is required only for the use of the conveyor tracking calibration wizard.
Useful Information
For details of the conveyor tracking calibration wizard, refer to the Conveyor tracking calibration wizard described in the FH Series Vision System Operation Manual for Sysmac Studio.
82
(3) Command for the Non-Wizard Calibration
This sample macro serves as a communication command for obtaining the number of a unit
that performs high-precision calibration and conveyor calibration, both of which are set up in
the Sample Scene for conveyor tracking calibration (Scene: 0.P&P_CalibScene).
This macro is required only when the conveyor tracking calibration wizard is not used.
Useful Information
For details of the conveyor tracking calibration, refer to Processing Unit Number Fetch
Command (⑤) described in 18 Calibration Without Using the Wizard.
15.2. Calibration Command for the Vision and Robot Integration Simulator
15.2.1.
Prerequisites and Restrictions
The use of the calibration command for vision and robot integration simulator is subject to the
following prerequisites and restrictions:
Item
Overview
Vision and robot integra- Use the simulator with the vision and robot integration simulator
tion simulator
camera parameters already set.
Modification to the cali- The calibration command for vision and robot integration simubration command for vi-
lator does not need to be changed. This command is enabled
sion and robot integration automatically when the vision and robot integration simulator is
used.
simulator
Relationship among the Use the command with the Sample Scene (P&P_CalibScene as
Sample Scene, sample
Scene 0 and P&P_SampleScene as Scene 1) in 4.4 Hardware
macro, and communica- Configuration, sample macro, and communication command
tion
command
sample
sample macro loaded.
macro
Status after the execu- After the calibration, the image mode of all the image windows is
tion of the calibration
changed to [Image data Freeze].
command for vision and
robot integration simulator
15.2.2.
Details of Each Function
The calibration command for vision and robot integration simulator has two functions, the
details of which are as follows:
① Setting up the following vision and robot integration simulator camera parameters, created
in the vision and robot integration simulator, to the FH sensor controller:
For the origin coordinate (X, Y) on the camera coordinate system of the machine coordinate
83
system (MCS1): (0x, 0y)
For the unit vectors (X, Y) of conveyor travel distance of the machine coordinate system
(MCS1): (Dx, Dy)
For the camera’s field of view (Length, Distance) in the machine coordinate system
(MCS1): (L, D)
For the slope of X-axis of the camera’s field of view with respect to the conveyor coordinate
system (UCS): TH
The following is the case of TH = 90°:
② Calculating the calibration parameters based on the data set up in ① and updating the
calibration parameters of the Sample Scene (0.P&P_CalibScene).
(1) Command sequence
This section shows a schematic of the command sequence to perform the calibration of FH.
The blue-colored areas indicate the calibration command for vision and robot integration simulator.
84
sd Command sequence chart
FH
NJ
1. Scene number fetch ()
Response code, response data (current Scene number)
2. Scene switch (calibration Scene number)
Response code
3. Image mode change command ()
3.1 Changes the
image mode ()
4. Performing measurement trigger ()
Response code
4.1 Reads the
image file ()
5. Calibration start ()
Response code
5.1 Initializes the
internal variables ()
6. FOV origin position setting (origin position X, Y)
Response code
6.1 Sets the data to the
internal variables ()
7. Conveyor travel distance setting (travel distance X, Y)
Response code
7.1 Sets the data to the
internal variables ()
8. FOV magnitude setting (length, distance)
Response code
8.1 Sets the data to the
internal variables ()
9. FOV slope setting (angle)
Response code
9.1 Sets the data to the
internal variables ()
10. Performing calibration ()
Response code, response data (error code)
10.1 Calculates the
calibration parameters
to reflect them ()
11. Scene switch (obtained Scene number)
Response code
85
(2) Command specifications
● I/O port for instruction areas (NJ Controller → FH Sensor Controller)
PDO signal
Command Code
(DWORD)
Name
Functional description
Sets the command code defined in the com-
Command code
munication command macro.
The setting value is fixed to 00000080 Hex.
Sets the type of this command. The setting
range is 0 to 6.
For each value, how the command works is
shown below:
0: Image mode change command
The image mode of all the image windows is
changed to [Image data Freeze].
1: Starting calibration
The internal variables for a communication
command macro are zeroed. These variables
include the original coordinates of camera’s
field of view (X, Y), the conveyor traffic distance (X, Y), the range of camera’s field of
view (Length, Distance), and the slope of
camera’s field of view.
Command Parameter 0
(DINT)
Command type
2: Setting the original coordinate of camera’s
field of view
Assigns the original coordinate of camera’s
field of view, (X, Y), to the internal variables of
a communication command macro.
3: Setting the conveyor traffic distance
Assigns the conveyor traffic distance, (X, Y),
to the internal variables of a communication
command macro.
4: Setting the range of camera’s field of view
Assigns the range of camera’s field of view,
(Length, Distance), to the internal variables of
a communication command macro.
5: Setting the slope of camera’s field of view
Assigns the slope of camera’s field of view to
the internal variables of a communication
86
command macro.
6: Performing calibration
Calculates the calibration parameters based
on the internal variables of a communication
command macro. The obtained results are
set to the conveyor calibration processing
unit registered in the specified calibration
scene.
According to the command type set in Command Parameter 0, set the following I/F parameters:
For the "Image mode change command"
(Command Parameter0=0)
: None
For the "Starting calibration" (Command Parameter0=1)
: None
For the "Setting the original coordinate of
camera’s field of view" (Command Parameter0=2)
: Set the original coordinate X of camera’s
field of view on the MCS1 coordinate system.
User Input Area 4
(LREAL)
Adjust the setting range to be the same as
User input area 4
that of the vision and robot integration simulator.
For the "Setting the conveyor traffic distance"
(Command Parameter0=3)
: Set the conveyor traffic distance X on the
MCS1 coordinate system. The setting range is
-1 to 1.
For the "Setting the range of camera’s field of
view" (Command Parameter0=4)
: Set the extent of camera’s field of view. Adjust the setting range to be the same as that of
the vision and robot integration simulator.
For the "Setting the slope of camera’s field of
view" (Command Parameter0=5)
: Set the slope of camera’s field of view with
87
respect to the conveyor coordinate system
(UCS). The following settings are allowed:
0: 0°
1: 90°
2: 180°
3: -90°
For the "Performing calibration" (Command
Parameter0=6)
: None
According to the command type set in Command Parameter 0, set the following I/F parameters:。
For the "Image mode change command"
(Command Parameter0=0)
: None
For the "Starting calibration" (Command Parameter0=1)
: None
For the "Setting the original coordinate of
camera’s field of view" (Command Parameter0=2)
: Set the original coordinate Y of camera’s
field of view on the MCS1 coordinate system.
User Input Area 5
(LREAL)
User input area 5
Adjust the setting range to be the same as
that of the vision and robot integration simulator.
For the "Setting the conveyor traffic distance"
(Command Parameter0=3)
: Set the conveyor traffic distance Y on the
MCS1 coordinate system. The setting range is
-1 to 1.
For the "Setting the range of camera’s field of
view" (Command Parameter0=4)
: Set the extent of camera’s field of view. Adjust the setting range to be the same as that of
the vision and robot integration simulator.
For the "Setting the slope of camera’s field of
view" (Command Parameter0=5)
88
: None
For the "Performing calibration" (Command
Parameter0=6)
: None
● I/O port for response areas (FH Sensor Controller → NJ Controller)
PDO signal
Response Code
(DWORD)
Name
Response code
Functional description
The result of command execution is stored.
(OK: 00000000 Hex, NG: FFFFFFFF Hex)
Response data other than the result of command execution is stored.
The response data varies depending on the
command type set in Command Parameter 0.
For the "Image mode change command"
(Command Parameter0=0)
: None
For the "Starting calibration" (Command Parameter0=1)
: None
For the "Setting the original coordinate of
camera’s field of view" (Command Parame-
Response Data
(DINT)
Response data
ter0=2)
: None
For the "Setting the conveyor traffic distance"
(Command Parameter0=3)
: None
For the "Setting the range of camera’s field of
view" (Command Parameter0=4)
: None
For the "Setting the slope of camera’s field of
view" (Command Parameter0=5)
: None
For the "Performing calibration" (Command
Parameter0=6)
89
: Error code*
* For each bit of response data, the code and definition of error is given as follows:
Corresponding bit
0 bit position
1 bit position
2 bit position
3 bit position
Error type
Description
Command type 2 not
With the command type 2, 3, 4, or 5 not
transmitted
transmitted, sending the command type 6
Command type 3 not
causes this error.
transmitted
The transmission status of each command,
Command type 4 not
the internal parameters of which include the
transmitted
execution flag (0: Not executed, 1: Executed),
Command type 5 not
transmitted
changes from 0 to 1 when the command is
executed; is zeroed when the command type
1 is executed.
If any of the following conditions applies, this
error occurs:
・If the extent of FOV (Length/Distance) is set
to 0 or less, the four corner points cannot be
calculated, and the error occurs.
・If the slope of FOV is set out of range (other
than 0 to 3), the error occurs.
・If an image file is not selected in the operation window, a failure to obtain the image size
occurs, which causes the error.
4 bit position
Calibration
parameter
calculation failure
・If the conveyor calibration processing unit is
not registered in the current Scene, a failure to
reflect the parameters occurs, which causes
the error.
・If the original coordinate X/Y of FOV or the
extent of FOV(Length/Distance) is set to an
out-of range value that the FH Sensor Controller cannot handle, or if any of the four
corner points on the MCS1 coordinate system
is out of the range of - 99999.9999 to
99999.9999, the parameters cannot be calculated, which causes the error.
15.3. Command for the Calibration Wizard
15.3.1.
Prerequisites and Restrictions
The use of the command for calibration wizard is subject to the following prerequisites and
restrictions:
90
Item
Overview
Command for calibration
The execution of this command is permitted only in the Sample
wizard
Scene (P&P_CalibScene as Scene 0) described in 4.4 Hardware
Configuration.
Command for calibration
After the completion of the calibration from the conveyor tracking
wizard
calibration wizard, use the command for calibration wizard.
Modification
to
the
Command for calibration
The command for calibration wizard does not need to be
changed.
wizard
Relationship between the
Use the command with the Sample Scene (P&P_CalibScene as
Sample Scene, sample
Scene 0 and P&P_SampleScene as Scene 1) in 4.4 Hardware
macro, and communica- Configuration, sample macro, and communication command
tion
command
sample
sample macro loaded.
macro
Unit label
Do not change the unit label set in the Sample Scene. (Refer to
the following.)
Processing unit: Conveyor calibration
Unit label name: CALIBRATION_UNIT
15.3.2.
Details of Each Function
(1) Command sequence
FH
Performs the conveyor
tracking calibration wizard
NJ
Request to obtain the conveyor traffic
distance per encoder value
(parameter 0 = 1)
Obtains the value from
User output area 4/5
Request to clear the conveyor traffic
distance per encoder value
(parameter 0 = 2)
(2) Command specifications
The user output areas 4 and 5 are used.
91
● I/O port for instruction areas (NJ Controller → FH Sensor Controller)
PDO signal
Command Code
(DWORD)
Name
Functional description
Sets the command code defined in the com-
Command code
munication command macro.
The setting value is fixed to 000000FE Hex.
Sets the type of this command. The setting
range is 1 or 2.
For each value, how the command works is
shown below:
1: Outputting the conveyor travel distance per
encoder value
Command Parameter 0
(DINT)
Command type
Requests the conveyor travel distance per
encoder value (unit: mm) calculated in the FH
Sensor Controller to be output to the user
output areas 4 and 5.
2: Performing zero clear
Requests the user output areas 4 and 5 to be
zeroed.
● I/O port for response areas (FH Sensor Controller → NJ Controller)
PDO signal
Response Code
(DWORD)
Response Data
(DINT)
Name
Response code
Response data
Functional description
The result of command execution is stored.
(OK: 00000000 Hex, NG: FFFFFFFF Hex)
None
● I/O port for user output areas (FH Sensor Controller → NJ Controller)
PDO signal
Name
Functional description
According to the command type set in Command Parameter 0, the behavior changes.
For the "Outputting the conveyor travel dis-
User Output Area 4
User output area
(LREAL)
4
tance per encoder value" (Command Parameter0=1)
: The conveyor travel distance per encoder
value, X (unit: mm), calculated in the FH
Sensor Controller is output.
For the "Performing zero clear" (Command
92
Parameter0=2)
: The user output area 4 is zeroed.
According to the command type set in Command Parameter 0, the behavior changes.
For the "Outputting the conveyor travel distance per encoder value" (Command ParamUser Output Area 5
User output area
(LREAL)
5
eter0=1)
: The conveyor travel distance per encoder
value, Y (unit: mm), calculated in the FH
Sensor Controller is output.
For the "Performing zero clear" (Command
Parameter0=2)
: The user output area 5 is zeroed.
15.4. Command for the Non-Wizard Calibration
15.4.1.
Prerequisites and Restrictions
The use of the command for non-wizard calibration is subject to the following prerequisites
and restrictions:
Item
Overview
Command for non-wizard
The execution of this command is permitted only in the Sample
calibration
Scene (P&P_CalibScene as Scene 0) described in 4.4 Hardware
Configuration.
Relationship between the
Use the command with the Sample Scene (P&P_CalibScene as
Sample Scene, sample
Scene 0 and P&P_SampleScene as Scene 1) in 4.4 Hardware
macro, and communica- Configuration, sample macro, and communication command
tion
command
sample
sample macro loaded.
macro
Unit label
Do not change the unit label set in the Sample Scene. (Refer to
the following.)
Processing unit: High-precision calibration
Unit label name: SAMPLING_UNIT
Processing unit: Conveyor calibration
Unit label name: CALIBRATION_UNIT
15.4.2.
Details of Each Function
(1) Command sequence
For details of the command sequence, refer to 18.2.5 Non-Wizard Calibration Command (⑤)
described in18 Calibration Without Using the Wizard.
93
FH
NJ
Obtains the number of the processing unit
of high-precision calibration
Response
Obtains the number of the processing unit
of conveyor calibration
Response
(2) Command specifications
● I/O port for instruction areas (NJ Controller → FH Sensor Controller)
PDO signal
Command Code
(DWORD)
Name
Functional description
Sets the command code defined in the com-
Command code
munication command macro.
The setting value is fixed to 000000FF Hex.
Sets the type of this command. The setting
range is 1 or 2.
For each value, how the command works is
shown below:
1: Obtaining the processing unit number of
high-precision calibration
Obtains the number of a processing unit that
Command Parameter 0
(DINT)
performs high-precision calibration (Unit label
Command type
name: SAMPLING_UNIT) set in the FH Sensor Controller.
2: Obtaining the processing unit number of
conveyor calibration
Obtains the number of a processing unit that
performs conveyor calibration (Unit label
name: CALIBRATION_UNIT) set in the FH
Sensor Controller.
94
● I/O port for response areas (FH Sensor Controller → NJ Controller)
PDO signal
Response Code
(DWORD)
Name
Response code
Functional description
The result of command execution is stored.
(OK: 00000000 Hex, NG: FFFFFFFF Hex)
The response data varies according to the
command type set in Command Parameter 0.
For the "Obtaining the processing unit number
of high-precision calibration" (Command Parameter 0=1)
: The number of a processing unit that performs high-precision calibration (Unit label
name: SAMPLING_UNIT) set in FH Sensor
Controller is output.
Response Data
(DINT)
Response data
For the "Obtaining the processing unit number
of conveyor calibration" (Command Parameter 0=2)
: The number of a processing unit that performs conveyor calibration (Unit label name:
CALIBRATION_UNIT) set in FH Sensor Controller is output.
For the cases other than Command Parameter 0=1 and 2
: 0 is output.
95
16. Conveyor Panorama Display Tool
Conveyor Panorama Display is a tool to display the outline of the model registered region and
of each image capture that constitutes a panoramic image over the panoramic image so that
you can estimate how targets move on the conveyor, using Sysmac Studio as a platform.
For more information, refer to the Vision Sensor FH Series Operation Manual Sysmac Studio
Conveyor Panorama Display Tool.
Useful Information
Regarding the Image Logging method used for Off-line measurement.
・In the Conveyor Panorama Display Tool, the file name of Logging Image used for Off-line
measurement cannot be created the Image Logging function in FH Sensor Controller.
・The file names of Logging image used for Off-line measurement are the following:
・measurementID_Encoder value at image capture.btm
・measurementID_Encoder value at image capture.ifz
・The above file name of image Logging are created by using GetEncValue Sample Macro.
・Examples of code are the following:
In the subroutine of GetEncValue Sample Macro, *MEASUREPROC, saves the measurement images which named measurement ID_ Encoder value at the image shotted.bmp.
Make sure to add this code to the after *MEASUREPROC subroutine: before Return.
--------------------------------------------------------------------------------------*MEASUREPROC
:
:
Rem Acquire the measurement ID and the Encoder value at the capture time and calculate
the character strings of file name
FILENAME$ = MeasureId$ + "_" + Str$(OUT_ENC_VALUE&(0)) + ".bmp"
Rem Outputs the measurement image 0 to the default path of data save destination as the
bmp format.
SaveMeasureImage 0, ApplicationPath$(2) + FILENAME$, 0
Return
--------------------------------------------------------------------------------------For details of Macro, refer to Vision System FH/FZ5 Series User’s Manual.
96
17. Conveyor Tracking Calibration Wizard Tool
Conveyor Tracking Calibration Wizard is a wizard-style calibration tool for reciprocally converting different coordinate systems between vision sensors, conveyors, and robots using
Sysmac Studio as a platform.
For more information, refer to the Operation Manual Sysmac Studio Conveyor Tracking Calibration Wizard Tool.
97
18. Calibration Without Using the Wizard
Creating the NJ program that follows the sequence below allows conveyor calibration without
the conveyor tracking calibration wizard.
18.1. Command Sequence
The command sequence is processed as follows:
98
Conveyor calibration sequence
FH
NJ
User
Start of camera calibration preparation
Scene number fetch command
①
When the
obtained
Scene
number is
other than 0
Response
Scene switch command
②
Response
Image display state fetch command
③
When the
image
mode is
other than
Through (0)
Response
Image display state setting command
④
Response
Camera calibration
preparation complete
Control the conveyor to allow the
entire calibration plate to be in FH's
field of view
Perform camera calibration
Non-wizard calibration command
(communication command macro)
⑤
Response
Processing unit data setting/fetch
⑥
Response
Save to unit
⑦
Response
Perform camera calibration
Return to the state prior to
calibration start
⑧
Image display state setting command
Response
⑨
Scene switch command
Response
Completion of the return to the
state prior to calibration start
99
18.2. Command Specifications
The numbers ① to ⑨ in this section correspond to those in the command sequence.
18.2.1.
Scene Number Fetch Command (①)
The current Scene number is obtained.
● I/O port for instruction areas (NJ Controller → FH Sensor Controller)
PDO signal
Command Code
(DWORD)
Command Parameter 0
(DINT)
Name
Command code
Command type
Functional description
Sets the command code.
The setting value is fixed to 00201000 Hex.
None
● I/O port for response areas (FH Sensor Controller → NJ Controller)
PDO signal
Response Code
(DWORD)
Response Data
(DINT)
18.2.2.
Name
Response code
Response data
Functional description
The result of command execution is stored.
(OK: 00000000 Hex, NG: FFFFFFFF Hex)
The current Scene number is stored.
Scene Switch Command (②)
The Scene to be used is switched.
● I/O port for instruction areas (NJ Controller → FH Sensor Controller)
PDO signal
Command Code
(DWORD)
Command Parameter 0
(DINT)
Name
Command code
Command type
Functional description
Sets the command code.
The setting value is fixed to 00301000 Hex.
Sets the Scene number to be used.
● I/O port for response areas (FH Sensor Controller → NJ Controller)
PDO signal
Response Code
(DWORD)
Name
Response code
Functional description
The result of command execution is stored.
(OK: 00000000 Hex, NG: FFFFFFFF Hex)
For the response data, the result of command
Response Data
(DINT)
Response data
execution is stored.
0: OK
Other than 0: NG
100
18.2.3.
Image Display State Fetch Command (③)
The state of image mode set in the specified image display window is obtained.
● I/O port for instruction areas (NJ Controller → FH Sensor Controller)
PDO signal
Command Code
(DWORD)
Command Parameter 0
(DINT)
Name
Command code
Command type
Functional description
Sets the command code.
The setting value is fixed to 00205030 Hex.
Sets the number of the intended image display window.
● I/O port for response areas (FH Sensor Controller → NJ Controller)
PDO signal
Response Code
(DWORD)
Name
Response code
Functional description
The result of command execution is stored.
(OK: 00000000 Hex, NG: FFFFFFFF Hex)
For the response data, the obtained status of
the image mode is stored.
Response Data
(DINT)
Response data
0: Camera image Through
1: Camera image Freeze, or the camera image and last NG image mixed
2: Last NG image
18.2.4.
Image Display State Setting Command (④)
The image mode of a specified image display window is set.
● I/O port for instruction areas (NJ Controller → FH Sensor Controller)
PDO signal
Command Code
(DWORD)
Command Parameter 0
(DINT)
Command Parameter 1
(DINT)
Name
Command code
Command type
Command type
Functional description
Set the command code.
The setting value is fixed to 00305030 Hex.
Set the number of the intended image display
window.
Set the status of the image mode.
0: Camera image Through
● I/O port for response areas (FH Sensor Controller → NJ Controller)
PDO signal
Response Code
(DWORD)
Response Data
Name
Response code
Response data
Functional description
The result of command execution is stored.
(OK: 00000000 Hex, NG: FFFFFFFF Hex)
For the response data, the result of command
101
(DINT)
execution is stored.
0: OK
Other than 0: NG
18.2.5.
Non-Wizard Calibration Command (⑤)
The processing unit number is obtained when the wizard is not used for calibration.
This command is intended for the case where the wizard of the communication command
macro is not used. (Reference: 15.4 Command for the Non-Wizard Calibration described in 15
Sample Macro for Communication Command)
● I/O port for instruction areas (NJ Controller → FH Sensor Controller)
PDO signal
Command Code
(DWORD)
Name
Command code
Functional description
Set the command code.
The setting value is fixed to 000000FF Hex.
Set the type of this command. The setting
range is 1 or 2.
Command Parameter 0
(DINT)
Command type
1: Obtaining the number of the sampling processing unit
2: Obtaining the number of the calibration
processing unit
● I/O port for response areas (FH Sensor Controller → NJ Controller)
PDO signal
Response Code
(DWORD)
Name
Response code
Functional description
The result of command execution is stored.
(OK: 00000000 Hex, NG: FFFFFFFF Hex)
The response data varies according to the
command type set in Command Parameter 0.
For the "Obtaining the number of the sampling
processing unit" (Command Parameter 0=1)
: The number of the sampling processing unit
Response Data
(DINT)
Response data
is stored.
For the "Obtaining the number of the calibration processing unit" (Command Parameter
0=2)
: The number of the calibration processing unit
is stored.
18.2.6.
Processing Unit Data Setting/Fetch Command (⑥)
The parameters of the processing unit are set.
102
● I/O port for instruction areas (NJ Controller → FH Sensor Controller)
PDO signal
Name
Functional description
Set the command code.
Command Code
(DWORD)
Command code
For the setting range, refer to Command Code
described in Details of the Processing Unit
Data Setting/Fetch Command.
Set the type of this command.
Command Parameter 0
(DINT)
Command type
For the setting range, refer to Command Parameter 0 described in Details of the Processing Unit Data Setting/Fetch Command.
Set the type of this command.
Command Parameter 1
(DINT)
Command type
For the setting range, refer to Command Parameter 1 described in Details of the Processing Unit Data Setting/Fetch Command.
Set the type of this command.
Command Parameter 2
(DINT)
Command type
For the setting range, refer to Command Parameter 2 described in Details of the Processing Unit Data Setting/Fetch Command.
● I/O port for response areas (FH Sensor Controller → NJ Controller)
PDO signal
Name
Response Code
(DWORD)
Response code
Functional description
The result of command execution is stored.
(OK: 00000000 Hex, NG: FFFFFFFF Hex)
The response data varies according to the
Response Data
(DINT)
command type set in Command Parameter.
Response data
For details, refer to Response data described
in Details of the Processing Unit Data Setting/Fetch Command.
● Details of the Processing Unit Data Setting/Fetch Command
Command
Command
Command
Command
Command
Response
Code
Parameter 0
Parameter 1
Parameter 2
description
data
Set the value
Sets the
obtained by
number of
multiplying
rows of sam-
the number of
pling points.
Set the
00501000
Hex
number of
the sampling
processing
unit.
180
rows of sam-
None
pling points
(only an odd
number from
103
5 to 19) by
1000.
181
Set the value
Sets the
obtained by
number of
multiplying
columns of
the number of
sampling
columns of
points.
sampling
None
points (only
an odd number from 5 to
19) by 1000.
Set the value
Sets the in-
obtained by
terval of sam-
multiplying
pling points.
the interval of
182
sampling
None
points (1 to
1000 and mm
as the unit) by
1000.
120
Set the value
Sets the
obtained by
number of
multiplying
touch-up
the number of
times of the
touch-up
robot.
None
times of the
robot (fixed at
4 times) by
1000.
Set the
Set the value
Sets the
number of
obtained by
number of the
the calibra-
multiplying
sampling
the number of
processing
the sampling
unit.
tion pro-
122
cessing unit.
None
processing
unit by 1000.
126
Set the value
Sets the input
obtained by
method for
multiplying
traffic dis-
the input
tance per en-
method for
coder value.
None
traffic distance per
104
encoder value
(fixed at 1) by
1000.
5003
None
Clears the
The result of
buffered data
command
of the camera
execution is
coordinate
stored.
system.
0: OK
-1000: NG
00401000
Hex
5002
None
Performs
The result of
sampling
command
measurement
execution is
on the camera
stored.
coordinate
0: OK
system.
-1000: NG
Obtains the
5
None
pattern num-
The number of
ber detected
detected pat-
in sampling
terns
measurement.
Set the value
Sets the
obtained by
X-axis (upper
multiplying
left) of the
the X-axis
machine co-
(upper left) of
ordinate sys-
the machine
tem where the
coordinate
robot is in
system by
touch-up op-
1000.
eration.
Set the value
Sets the
obtained by
X-axis (upper
00501000
multiplying
right) of the
Hex
the X-axis
machine co-
(upper right)
ordinate sys-
of the ma-
tem where the
chine coordi-
robot is in
nate system
touch-up op-
by 1000.
eration.
Set the value
Sets the
obtained by
X-axis (lower
multiplying
left) of the
the X-axis
machine co-
(lower left) of
ordinate sys-
the machine
tem where the
400
401
402
None
None
None
105
403
500
501
502
503
coordinate
robot is in
system by
touch-up op-
1000.
eration.
Set the value
Sets the
obtained by
X-axis (lower
multiplying
right) of the
the X-axis
machine co-
(lower right)
ordinate sys-
of the ma-
tem where the
chine coordi-
robot is in
nate system
touch-up op-
by 1000.
eration.
Set the value
Sets the
obtained by
Y-axis (upper
multiplying
left) of the
the Y-axis
machine co-
(upper left) of
ordinate sys-
the machine
tem where the
coordinate
robot is in
system by
touch-up op-
1000.
eration.
Set the value
Sets the
obtained by
Y-axis (upper
multiplying
right) of the
the Y-axis
machine co-
(upper right)
ordinate sys-
of the ma-
tem where the
chine coordi-
robot is in
nate system
touch-up op-
by 1000.
eration.
Set the value
Sets the
obtained by
Y-axis (lower
multiplying
left) of the
the Y-axis
machine co-
(lower left) of
ordinate sys-
the machine
tem where the
coordinate
robot is in
system by
touch-up op-
1000.
eration.
Set the value
Sets the
obtained by
Y-axis (lower
multiplying
right) of the
the Y-axis
machine co-
(lower right)
ordinate sys-
None
None
None
None
None
106
of the ma-
tem where the
chine coordi-
robot is in
nate system
touch-up op-
by 1000.
eration.
Sets the encoder value of
the meas-
602
0
urement position of the
None
camera coordinate system
(fixed at 0).
Sets the encoder value of
the obtained
position (upper) of the
603
0
machine coordinate sys-
None
tem where the
robot is in
touch-up operation (fixed
at 0).
Sets the encoder value of
the obtained
position (lower) of the
604
None
machine coordinate sys-
None
tem where the
robot is in
touch-up operation (fixed
at 0).
00401000
Hex
5000
None
Calculates the
The result of
calibration
command
parameters.
execution is
stored.
0: OK
-1000: NG
00501000
Hex
127
Sets the value
Sets the
obtained by
magnitude of
None
107
multiplying
the vector in
the magni-
the X-axis
tude of the
direction of
vector in the
UCS calcu-
X-axis direc-
lated by NJ.
tion by 1000.
128
Sets the value
Sets the
obtained by
magnitude of
multiplying
the vector in
the magni-
the Y-axis
tude of the
direction of
vector in the
UCS calcu-
Y-axis direc-
lated by NJ.
None
tion by 1000.
Stores the
Obtains the
171
None
calibration
parameter A.
value obtained
by multiplying
the calibration
parameter A
by 1000.
Stores the
Obtains the
172
None
calibration
parameter B.
value obtained
by multiplying
the calibration
parameter B
by 1000.
Stores the
00401000
Hex
Obtains the
173
None
calibration
parameter C.
value obtained
by multiplying
the calibration
parameter C
by 1000.
Stores the
Obtains the
174
None
calibration
parameter D.
value obtained
by multiplying
the calibration
parameter D
by 1000.
Stores the
Obtains the
175
None
calibration
parameter E.
value obtained
by multiplying
the calibration
parameter E
by 1000.
108
Stores the
Obtains the
176
None
calibration
parameter F.
value obtained
by multiplying
the calibration
parameter F
by 1000.
18.2.7.
Save-to-Unit Command (⑦)
The current system data and Scene group data are saved in the FH Sensor Controller.
● I/O port for instruction areas (NJ Controller → FH Sensor Controller)
PDO signal
Command Code
(DWORD)
Command Parameter 0
(DINT)
Name
Command code
Command type
Functional description
Sets the command code.
The setting value is fixed to 00103010 Hex.
None
● I/O port for response areas (FH Sensor Controller → NJ Controller)
PDO signal
Response Code
(DWORD)
Name
Response code
Functional description
The result of command execution is stored.
(OK: 00000000 Hex, NG: FFFFFFFF Hex)
For the response data, the result of command
Response Data
(DINT)
Response data
execution is stored.
0: OK
Other than 0: NG
18.2.8.
Image Display State Setting Command (⑧)
The image mode of a specified image display window is set.
● I/O port for instruction areas (NJ Controller → FH Sensor Controller)
PDO signal
Command Code
(DWORD)
Command Parameter 0
(DINT)
Command Parameter 1
(DINT)
Name
Command code
Command type
Command type
Functional description
Sets the command code.
The setting value is fixed to 00305030 Hex.
Sets the number of an intended image display
window.
Sets the state of the image mode.
0: Camera image Through
● I/O port for response areas (FH Sensor Controller → NJ Controller)
109
PDO signal
Response Code
(DWORD)
Name
Response code
Functional description
The result of command execution is stored.
(OK: 00000000 Hex, NG: FFFFFFFF Hex)
For the response data, the result of command
Response Data
(DINT)
Response data
execution is stored.
0: OK
Other than 0: NG
18.2.9.
Scene Switch Command (⑨)
The Scene to be used is switched.
● I/O port for instruction areas (NJ Controller → FH Sensor Controller)
PDO signal
Command Code
(DWORD)
Command Parameter 0
(DINT)
Name
Command code
Command type
Functional description
Sets the command code.
The setting value is fixed to 00301000 Hex.
Sets the Scene number to be used.
● I/O port for response areas (FH Sensor Controller → NJ Controller)
PDO signal
Response Code
(DWORD)
Name
Response code
Functional description
The result of command execution is stored.
(OK: 00000000 Hex, NG: FFFFFFFF Hex)
For the response data, the result of command
Response Data
(DINT)
Response data
execution is stored.
0: OK
Other than 0: NG
110
OMRON Corporation
Industrial Automation Company
Authorized Distributor:
Kyoto, JAPAN
Contact: www.ia.omron.com
Regional Headquarters
OMRON EUROPE B.V.
Wegalaan 67-69, 2132 JD Hoofddorp
The Netherlands
Tel: (31)2356-81-300/Fax: (31)2356-81-388
OMRON ELECTRONICS LLC
2895 Greenspoint Parkway, Suite 200
Hoffman Estates, IL 60169 U.S.A.
Tel: (1) 847-843-7900/Fax: (1) 847-843-7787
OMRON ASIA PACIFIC PTE. LTD.
No. 438A Alexandra Road # 05-05/08 (Lobby 2),
Alexandra Technopark,
Singapore 119967
Tel: (65) 6835-3011/Fax: (65) 6835-2711
OMRON (CHINA) CO., LTD.
Room 2211, Bank of China Tower,
200 Yin Cheng Zhong Road,
PuDong New Area, Shanghai, 200120, China
Tel: (86) 21-5037-2222/Fax: (86) 21-5037-2200
© OMRON Corporation 2015 All Rights Reserved.
In the interest of product improvement,
specifications are subject to change without notice.
Cat. No. Z368-E1-01
1015
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertisement