In-Sight Advanced Manual
In-Sight Advanced Manual
Course Description:
Class focuses on advanced In‐Sight spreadsheet use. Spreadsheet users will learn how
spreadsheet functions work and apply their knowledge to complete the class lab exercises. The class
focuses on hands‐on labs to build advanced tool usage scenarios within real‐world applications.
Length: 2 days
Locations: Novi, MI; Natick, MA; Regional Site; Customer Site
Price: $395 (at Cognex facility)
Onsite Available – Call 508 ‐ 650 ‐ 3715 for Details
Registration: Online at http://www.cognex.com/training
Expected Outcomes:
You will benefit from this course by learning to:
Describe and implement advanced vision tools in real world settings
Solve intermediate level application using an In‐Sight spreadsheet
Implement GUI driven calibration for operator access
Track running totals and statistical information related to time
Design and implement an operator interface using GUI best practices
Communicate with external devices using spreadsheet FTP functions
Topic List
1. PatMax
2. Blobs
3. Edges
4. Calibration
5. GUI Design
6. Communication
Prerequisites:
• Completing an In‐Sight training course and experience with In‐Sight spreadsheets.
Cognex Corporation One Vision Drive Natick, MA 01760-2059 (508) 650-3000 fax (508) 650-3333 www.cognex.com
10/28/2009
PatMax
Session 1
Introductions
• Name?
• Where from?
• Company?
• Role?
• Vision Experience?
• Hobbies, family, pets?
1
10/28/2009
Objectives
What is PatMax?
• PatMax is a pattern-based search
technology.
technology
• PatMax differs from other pattern-
location technologies in that it is not
based on pixel grid representations
that cannot be efficiently and
accurately rotated or scaled.
• Instead,, PatMax uses a feature-based
representation that can be transformed
quickly and accurately for pattern
matching.
2
10/28/2009
• FindPatMaxPatterns
• Finds objects in an
image based on a
trained pattern
3
10/28/2009
TrainPatMaxPattern Parameters
Reference to target image cell
Where tool should fixture itself
R i specifying
Region if i ffeatures
t tto train
t i
Allows use of custom region
Location within pattern to report
Specialized settings
Choose from PatQuick or PatMax
Specifies allowed perimeter deviation
Toggles to check for opposite polarity
DISABLED
Granularity used to find large features
Granularity used to find small features
Milliseconds before tool gives up
Graphic options to display
Algorithm
• You’ll choose from two
algorithms:
g
• PatQuick: Optimized for
speed; disables
FindPatMaxPatterns
model graphics; uses
coarse granularity (more
later)
4
10/28/2009
Elasticity
• Degree to which you
allow PatMax to tolerate
nonlinear geometric
changes (changes to the
perimeter outlined by the Image
Pattern
boundary features)
• Range: 0-10
0 10
Ignore Polarity
• The ignore polarity setting instructs PatMax to check
for original
g p
polarity
y identified at training
g and opposite
pp
polarity as well. This may increase execution time for
PatMax.
10
5
10/28/2009
Granularity
Granularity = 6
• Coarse granularity controls the
level of detail used by the
P tQ i k algorithm.
PatQuick l ith
• Fine granularity controls the
level of detail used by the
PatMax algorithm.
• By default, both are set to 0
allowing PatMax to
automatically determine good
values.
l
Granularity = 1 11
6
10/28/2009
Coarse Granularity
32 Boundary Points
• Coarse granularity is used by
the PatQuick algorithm.
• Since PatQuick is optimized for
speed, coarse granularity
should never be set to 1.
• If set to 0, it is automatically set
to the best value for coarse
granularity. GetGrainCoarse returns 6.579
• If set to > 1, coarse granularity
is manually set to that number.
• GetGrainCoarse functions
returns coarse granularity
value.
13
Fine Granularity
104 Boundary Points
• Fine granularity is used by the
PatMax algorithm.
• Since PatMax is optimized for
accuracy, fine granularity
should always be set to 1.
• If set to 0, it is automatically set
to 1.
• If set to > 1, fine granularity is GetGrainFine returns 1
manually set to that number,
and is no longer using the best
accuracy setting.
• GetGrainFine function returns
fine granularity value.
14
7
10/28/2009
15
8
10/28/2009
17
FindPatMaxPatterns Parameters
Reference to target image cell
Where tool should fixture itself
Region specifying searching area
Allows use of custom region
Reference to a TrainPatMaxPattern
Number of match to search for
Minimum score necessary
Specifies lowest contrast necessary
Toggles consideration of extra features
Percentage allowed out of region
Sets rotation, scale & aspect ratio range
Sets allowable overlapping
Milliseconds before tool gives up
Graphic options to display
18
9
10/28/2009
Accept Threshold
0 80 100
Scoring Conflict
• Warning: It is possible to set a high accept threshold
((90 for example)
p ) and not g get any
y results,, then set the
accept threshold to something lower (80 for example)
and then have it find a match that scores above the
original high accept threshold.
• If during the first pass of the image (PatQuick), the
candidate does not score higher than the accept
threshold,, it will not be promoted
p to be inspected
p byy
the PatMax algorithm.
• Lowering the accept threshold is a good way to work
around this tool behavior.
20
10
10/28/2009
Contrast
• Contrast sets the
minimum contrast
required in order to
consider a change in 92 62
grayscale a potential
boundary point.
Clutter
• The model consists of inter-related boundary points.
• Clutter is a term used to describe extra features
present adjacent to the original boundary features of
the image that are not part of the original model.
22
11
10/28/2009
Clutter in Score
• The Clutter in Score
parameter allows yyou to
p
factor or ignore clutter
when the score is
calculated.
• If checked, score is
lowered based on the
amount of clutter.
• If unchecked, score is not Score: 68
affected by the presence
of clutter.
Score: 94
23
Outside Region
• Outside Region allows a percentage of the model to be outside
the search region and still be found.
• Those missing boundary points outside the field of view are not
counted against the score.
24
12
10/28/2009
Find Tolerances
Allowable rotation of
match relative to model
25
Find Overlapping
• XY Overlap
• Angle Overlap
p
• Scale Overlap
• Aspect Overlap
26
13
10/28/2009
2 Found
27
14
10/28/2009
ImportData
• ImportData is found under the Input/Output category
Event required to execute the import
Camera from where file will be imported
Valid username within camera
Valid password within camera
Name of file to be imported
• ImportData
p can also be used within emulators
• File being exported must be of supported type
29
ExportData
• ExportData is found under the Input/Output category
Event required to execute the export
Camera from where file will be exported
Valid username within camera
Valid password within camera
Name of file to be exported
Reference to function or tool to export
• ExportData
p can also be used within emulators
• File being exported must be of supported type
30
15
10/28/2009
Summary
31
16
In‐Sight Advanced Spreadsheets
Objectives
Tasks
Drill Bits
The search area defined by the FindPatMaxPattern tool using the Model from the
TrainPatMaxtPattern tool to give location information (see cross at center of Trained Model)
DIN Alignment
Model taught by TrainPatMaxPattern Tool Search (box) defined in the FindPatMaxPattern tool
Faces
Blobs
Session 2
Objectives
1
10/28/2009
Blobs
• Blob tools play an important role in machine
vision.
• Blob analysis in In-Sight classifies pixels into
blob pixels or background pixels.
• All connected blob pixels are part of an
individual blob.
• The rest are considered the background.
• This strategy helps when you need to:
• Find features that cannot be
traditionally trained and found using
correlation or geometric model
search (parts that change
dramatically)y)
• Speed up identification, location, or
sorting features when model training
and finding take too long
• There are three Blob tools available in the
In-Sight product:
• ExtractBlobs
• SortBlobs
• FindBlobs 3
ExtractBlobs
• ExtractBlobs is the primary Blob vision tool in In-Sight.
• It has a dual role:
• It can count the number of blobs.
2
10/28/2009
*Setting “Number to Sort” to 0 only counts the number of blobs in the region.
No other blob results are reported.
**Setting “Threshold” to -1 performs automatic threshold. 5
3
10/28/2009
SortBlobs
• SortBlobs allows the customized sorting of blobs
alreadyy extracted
0 3 4 1 2
5
6 8 10 11 7 9
X 13 12 15
14 16 17
19 21 22 23 18 20
4
10/28/2009
3 7 11 15 19 23
2 6 10 14 18 22
X 1 17 21
5 9 13
0 4 8 12 16 20
9 16 19 21 22 23
3 6 12 14 18 20
X 1 15 17
4 8 10
0 2 5 7 11 13
10
5
10/28/2009
9 16 19 21 22 23
3 6 12 14 18 20
X 1 15 17
4 8 10
0 2 5 7 11 13
11
0 1 5 8 15 19
2 3 7 12 16 20
X 4 16 22
6 10 13
9 11 14 17 21 23
12
6
10/28/2009
0 1 2 3 4 5
6 7 8 9 10 11
X 12 16 17
13 14 15
18 19 20 21 22 23
13
0 4 8 12 16 20
1 5 9 13 17 21
X 2 18 22
6 10 14
3 7 11 15 19 23
14
7
10/28/2009
SortBlobs Results
• Sort Blobs referencing an ExtractBlob structure
15
16
8
10/28/2009
FindBlobs: Setting It Up
1. Select a blob structure to analyze
2 Set number to find
2.
3. Set results nominal value
a) ideal value the blob must possess
4. Set value range
a) +/- range of the nominal value
5. Set the weight
a) how important this value is
6. Review results focusing on accuracy and score
7. Set “Accept Thresh” value appropriately
17
18
9
10/28/2009
FindBlobs Results
10
10/28/2009
FindBlobs
Blobs are then found by
limiting search parameters
(Too Large)
21
Summary
• There are three blob vision tools:
• ExtractBlobs is used to ppull out all blobs p
present and sort
them from largest to smallest area
• SortBlobs is used to sort based on custom criteria
• FindBlobs is used to pick out blobs matching specific criteria
from a larger result set
• Nominal values, ranges, and weights are used to
score blobs based on how well they match desired
criteria
it i
22
11
4. Verify the FindPatMaxPatterns tool finds the part in every image.
5. Save your job as MyFaces.job.
Model taught by TrainPatMaxPattern Tool Search (box) defined in the FindPatMaxPattern tool
Vials
If Time Permits
Keys
Objectives
• Use ExtractBlobs, SortBlobs, and FindBlobs tools to solve different blob analysis
applications.
Note:
These exercises are to help you understand the tool parameters so you will be able to use
these tools in the Calibration section in building the DrillBits application.
Tasks
T Bar
3. Use an ExtractBlobs tool to define the search area and number of holes
4. Use a FindBlobs tool that will only display results for blobs that match features of the
small holes while ignoring the large holes
5. Use A SortBlobs to order the Location of the small holes from top down, Left to right.
6. Save your job as MyTBar.job.
Tablets
4. Use a FindBlobs tool that will only display results for blobs that match features of the 3
small holes while ignoring the large hole and any blobs resulting from the blemishes on
some gaskets.
4. Use a SortBlobs tool that will sort characters from left to right.
If Time Permits
Edges
Session 3
Edges
1
10/28/2009
Edges
• Edge – Tool Palette
Two Groups
1. Find straight
or curved edges
2. Reference
f
found
d edges
d
Edges
• Edge – FindCircle Structure
• XY center point of found edge
• Distance from XY point to found edge (radius)
2
10/28/2009
Edges
• Edge – FindCircle
• Property sheet
Edges
• Edge – FindCircle Parameter
Smallest to
Largest circle
3
10/28/2009
Edges
• Edge – FindCircle Parameter
• Dependent on Where the Annulus is drawn
Smallest to
Largest circle
Edges
• Edge – FindCircleMinMax
• Denotes the Minimum and Maximum radius of edge points
• Uses one circumference to reference for Min/Max
4
10/28/2009
Edges
• Edge – FindCurve
• Outputs Center point of curved edge circle
• Starting and End coordinates (X,Y)
(X Y) of the Edge points
Center of Curve
(252,327)
Edges
• Edge – Find Line
• Spread sheet cell displays a Structure with end points
(Row Col) of each Line Edge found in the region of
(Row,Col)
interest
End pt.(row,col) 0
End pt.(row,col) 1
- Find First edge
10
5
10/28/2009
Edges
• Edge – Find Line
• Property sheet
11
Edges
• Edge – FindMultiline
• Spread sheet cell displays a Structure with number of edges
found in the region of interest (Index Number)
• Endpoints (Row,Col) of each Line Edge found in the region
of interest are not displayed in the spread sheet, use the
Sort and/or the Get functions
12
6
10/28/2009
Edges
• Edge – FindMultiline
• Property sheet
13
7
10/28/2009
Edges
FindMultiline
• Ch
Change P
Parameters
t
• To find edges
• Note:
Edge width will
affect finding edges
at different Threshold
values
• If Ineffective
try the Caliper tool
(more on this later)
15
Edges
• Edge – Use FindMultiline with PairDistance tool
• Find Multiline – Edge tool
– 7 Drill bits b
butt 28 edges fo
found
nd
8
10/28/2009
Edges
• Edge – Use FindMultiline with PairEdges tool
• Find Multiline – Edge tool
– 7 Drill bits b
butt 28 edges fo
found
nd
17
Edges
• Edge – Use FindMultiline with PairToEdges tool
• Find Multiline – Edge tool
– 7 Drill bits b
butt 28 edges fo
found
nd
18
9
10/28/2009
Edges
• Edge – SortEdges
• References a cell with an Edge Structure
– Sort by: five different parameters
Note: B2W = Black to White pixel transition
19
Edges
• Edge – SortEdges
• Displays the Get Row/Column for endpoints from the
Edge Structure for each edge found
found, Index # ( 0 - X )
• Number to Sort = 14 - default, lists 0-9
20
10
10/28/2009
Edges
• Edge – FindMultiline
• Best used for varying distance
edge pairs
21
Edges
22
11
10/28/2009
Edges - Caliper
• Find by Dynamic Scoring Methods ( 4 total )
• When using Single Edge versus Edge Pair - in Edge mode
Contrast and Position Scoring are used
1. Contrast – (Default) uses highest contrast value to find edge
24
12
10/28/2009
Edges - Caliper
• Find by Dynamic Scoring Methods ( 4 total )
• When using Edge Pair versus Single Edge - in Edge mode
Size and Straddle Scoring methods are added
3. Size – user defines the number of pixels wide of each edge pair
Edges - Caliper
26
13
10/28/2009
Edges - Caliper
• Once edges have been found, scores are used to
determine placement of “found” edges and order of labels
(0,1,2…etc:)
(Edge pair order derived from Score and “Y” position if all scores are equal)
27
Edges - Caliper
14
10/28/2009
Edges - Caliper
Add a different
Scoringg Function
- Size
Note:
From the General Tab –
Threshold Accept and
Edge (Pair) Distance
values apply to Scoring
Methods
29
Edges - Caliper
• Delete ineffective Scoring Functions
Note: Each Edge Mode is used (added) to derive a
“Geometric
Geometric mean
mean” score for the resultant edge pair(s) found
30
15
10/28/2009
Edges - Caliper
X axes = tolerance
derived From ‘General” tab -
Edge Distance
Edges - Caliper
• Verify results
32
16
In‐Sight Advanced Spreadsheets
Objectives
• Use a CalibrateAdvance tool with the correct Calibration Image to convert pixels to real
world units and remove distortion.
• Use the Calibrate Image structure as the reference image for the Edge tool to output its
results in real world units.
• Use an ExtractBlobs and SortBlobs tool to find the dots used for calibration.
Tasks
Drill Bits
6. Create a table to identify the correct dot pairs with their respective X and Y pixel
location. These will be used for the Calibrate Advance syntax
a. Copy and paste the Index, Row and Col of the sorted 9 dots
d. This completes the procedure to order the calibration dots to real world
coordinates.
7. Insert the Calibrate advance tool structure in the row above were you started the rows
for the calibration procedure. (see example ‐ last page of lab)
8. Click and drag from the table you created the XY to Real World unit cells into the
Calibrate Advance tool syntax.
Note: Do Not include the index numbers or the Header labels
Another way to do this would be to put in the values in individually…. Your choice
10. Create an “Enable” check box for when there is a calibration image to calibrate with.
a. Use the cell state function to enable / disable the calibrate structure.
Make sure the calibrate structure is disabled before completing the next step
Note: The 0.5 inch Dot pattern (half inch scale) should only be used when
the enable calibration check box is checked
13. Insert the CalibrateImage tool structure In the row above were you placed the
Calibration structure
14. Open the property sheet for the Find Multiline tool and instead of referencing AO
reference the Calibrated Image cell.
EXPECTED OUTCOMES:
You will convert pixel values to real world values by using a preprinted calibration
(Dots) grid and the Calibration Advance transform.
Adv_Edges_2 Lab 1
GB 07/24/08
4. Use the “Sort Blob” tool to maintain an order to the nine points
5. From the Sort blobs cells, Copy- Paste the Index, Row and Col info to a new row:
add an X and Y column to put real world distance info:
Note: the dot pitch is 0.50 inch
A B C D E F G
Dot
pitch
Adv_Edges_2 Lab 2
GB 07/24/08
6. Select the CalibrateAdvance under the Functions Tab in the toolbox Palette
Double Click on the CalibrateAdvance, to open the cell for inputting cell referencing
a.
Input the references from the “Dot Order to Real World Distance” cells
(see step 5)
Calibrate Advance ( Index 0--{ Row, Col pixel reference},{ X,Y Origin distance -- 0,0},
Index 1--{Row,Col pixel reference},{ X,Y real word distance --0,0.5}, Index 2--etc;…)
9. Create a cell with the CalibrateImage Structure to be used by the Edges Tool in the
Edges _2 lab.
10. Save the job as CalibrateImage_Lab_01 onto the In-Sight camera’s Flash ROM.
Adv_Edges_2 Lab 3
GB 07/24/08
Edges_2_CalibrateImage Lab
Drill Bit Edges
EXPECTED OUTCOMES:
Obtain a live image or use the images provided.(Drill Bits and Dots)
Demonstrate the ability to place the appropriate tools to count the specific object (s) as
stated in the procedures.
Demonstrate the ability to use nine (9) points to convert pixels to real world values
2. Use PairDistance tool to match the drill bit “size” with the appropriate pair
3. Use another Pair Distance tool but reference an Edges tool that references the
Calibrate Image to output real world units.
B26 is the Edge Structure (Find Multiline) to be referenced by the Pair distance tool.
Adv_Edges_2 Lab 4
GB 07/24/08
4. Save the job as Edges_2.job onto the In-Sight camera’s Flash ROM.
Adv_Edges_2 Lab 5
GB 07/24/08
In‐Sight Advanced Spreadsheets
Objectives
• Use FindMultiLine and PaireDistance tools to determine drill bit widths in pixels to be
used later in the Calibration and User Interface Labs.
Tasks
Drill Bits
5. Use the PairDistance tool to determine the drill bits widths (in pixels)
Note: place a Label with the “size” above the respective PairDistance cell
Objectives
• The student will correctly implement and describe what
features make for a successful operator interface
1
qqqqq
10/28/2009
EditCompositeRegion
EditCompositeRegion - Graphics
• “Plain” space
is part of the
region
• “Hashed”
area is space
that is being
removed from
the
h region
i
¾ Great for
Masking
4
2
qqqqq
10/28/2009
EditCompositeRegion - General
• Fixturing
• Adjustment abilities allowed
to user at runtime
• Title for the button
• Ability to show graphics
EditCompositeRegion - Regions
• Order counts
• Use Interactive Graphics
to set region
• Properties change
depending on region
3
qqqqq
10/28/2009
Using EditCompositeRegion
• Supported tools:
– PatMax (train and find)
– PatFind
– Blobs
– Histogram 7
Adding Subregion
Subregion Operation
4
qqqqq
10/28/2009
Event Tool
• An Event function monitors conditions to create a software
trigger (1) from within the spreadsheet when OnLine
– This
Thi iis iindependent
d d t ffrom th
the cellll AO
AO-Image
I Acquisition
A i iti / IInspection
ti
Event
• For Example:
– Operators
p Utilizing
g Up/Down
p buttons to adjust
j the tolerance for
part while online
10
5
qqqqq
10/28/2009
Event tool
• To update the Event cell, a Soft 0 (80) is needed
– The Software will register an 80 in the Event cell when:
• The Event cell is active from the trigger source (Button)
– This is used in the Event tools Trigger parameter
11
12
6
qqqqq
10/28/2009
13
Events Summary
for Logic
see next slide
14
7
qqqqq
10/28/2009
Events Summary
• M25 = 0.002
• E16 = Up button
• E17 = Latch tool referencing the Event Structure (L25)
and the cell with the logic M25 (tolerance value)
• M26 = Increment Value ( 0.001, or your choice)
• E18 = Down button
E16 L M
E17 25
E18 26
15
“ClockedSum”
ClockedSum a Clocked Data Storage function, is used
to perform as if using an Event and a Latched cell to
increment a tolerance setting
Found in Palette, Function Tab,
Clocked Data Storage – ClockedSum
8
qqqqq
10/28/2009
17
Accumulate ClockedSum
Minimum ClockedMin
Maximum ClockedMax
9
qqqqq
10/28/2009
Dialog Boxes
• A Dialog Box is a pop-up window that overlays the spreadsheet
• Consists of cells above row 399 in the spreadsheet (A400 & higher)
19
Dialog Boxes
• Able to use several tool functions
in rows 400 and above, but not
Vision functions
20
10
qqqqq
10/28/2009
Dialog
boxes
Wizard
21
Returns to spreadsheet
Dialog Boxes & Wizards provide easy-to-use Graphical User Interface (GUI)
22
11
qqqqq
10/28/2009
Best Practices
23
Easy to Find
• When viewing an operator interface, the user should
know where to press just by looking at the interface
– A control
t l should
h ld exude
d click
li k ability
bilit ((stand
t d out,
t be
b noticed)
ti d)
24
12
qqqqq
10/28/2009
• The user should know right way what the control will do
jjust by
y looking
g at it
– A control should communicate functionality
25
26
13
qqqqq
10/28/2009
27
28
14
qqqqq
10/28/2009
How - Controls
• Change
g Cell Color
29
How - Controls
• Customize - Operator Interface controls:
• Add Picture/Graphics
Right Click on “Button”
Button
– Format - Format Cell
• Picture tab
(Open/Browse for graphic)
– User designed / copied graphics
» Scale will affect cell graphic
30
15
qqqqq
10/28/2009
How - Controls
31
How - Controls
16
qqqqq
10/28/2009
How - Display
• Remove Panes
View – In-Sight
g – ((Network, Files and Palette)) Unselect
33
How - Display
• Remove toolbars
View – Toolbars ---Uncheck toolbars
17
qqqqq
10/28/2009
How - Display
18
qqqqq
In‐Sight Advanced Spreadsheets & Intro to ToolBuilder Class
Objectives
• Implement in a Job File / Spreadsheet the Edit region, Color Labels, Input/output
functions using the Event tool and the Clocked Data Storage Latch function to develop a
User Interface
• From the presentation, utilize the techniques learned for an easy to use Interface with
the use of Buttons, Dialog boxes / Wizards and customized interface controls.
Tasks
Edit Region
5. Use an EditRegion tool to resize and move the Find region parameter of the Find PatMax
tool used to locate the Trained Model of the drill bit sizes.
Note: The Edit Region box will be used in a dialog box/ Wizard in the Operator Interface
a. if not, then:
‐ Select the Calibration structure and use the “Cell State” parameter to
conditionally enable it from the check box you create in the spread sheet
Note: This check box will be used in a dialog box/ Wizard in the Operator Interface
5. Create a block of cells underneath the PairedDistance structure for each drill bit :
For simplicity I am changing a Label from Determine to Measure for the rest of the labs
b. Use the ClockedDataSum function to output a Maximum and Minimum sum for
each of the Drill Bit sizes.
i. Change the Value parameter for the maximum to a (plus) +0.001 and
for the minimum value to (minus) ‐ 0.001
ii. Reference the Preset parameter to the cell containing the mathematical
or calculated drill bit size for each of the Drill bits.
Note: The output of the cell will add or subtract the preset number only after it has
been Reset, otherwise it will increment by + or ‐ 0.001 with each Inspection.
Select the Reset check box then Ok to set the value in the cell to the drill bit size.
Remember to go back and unselect the Reset check box to have it increment by the plus
or minus 0.001 values
6. Create an InRange function to form the Pass/Fail Logic for each Drill bit size underneath
the ClockedSum structures for each drill bit
7. This group of cells will be used as references for a group of cells (Results Table) that will
be used in a dialog/Wizard for the Operator interface
Note: Clocked Data Storage (ClockedSum) and Edges (PairDistance) functions will not
work in a dialog box (rows 400 and above).
8. For error checking, create an ErrFree cell for each of the InRange Logic cells
Color Labels
5. Create a Logic function to output a value underneath the ErrFree function to be used by
the Color Label for each Drill bit size. This will be used in the next exercise (step 5).
The Minimum/Maximum and reset buttons will reference the ClockedSum function
built in the previous exercise.
Remember to reference all values from the functions you built in the spread sheet,
This group of cells will be used in a dialog box later in the exercise.
The Event references the Maximum button or for minus 0.001 the Minimum button
The reset references the Reset button created in the group of cells (Result Table)
5. Create a Color Label at the bottom of each Drill Bit size, in‐between the minimum
button and the reset button
7. If Time permits
Select the Foreground color to White and have the text written in the cell change
dynamically to PASS / FAIL respectively.
Dialog Boxes
a. In the upper section of the spread sheet, below the Results Table you just
created place a comment for future reference in column A
Results Table
Search Box
Enable Calibration
Click ok
f. Open the dialog “Results Table” you just created and Paste it into the Dialog
box.
2. Create a Dialog box with instructions on how to use the Edit Region button.
a. In the upper section of the spread sheet next to its reference in column A
f. Open the Dialog “Search box” you just created and Paste it into the Dialog box.
Add instructions as needed.
3. Create a Dialog box with instructions on how to use the Enable Calibrate check box.
a. In the upper section of the spread sheet next to its reference in column A
Click one cell above/below or next to it and drag OVER the button, Donot
includes the Calibration structure.
f. Open the Dialog “Calibration” you just created and Paste it into the Dialog box.
Add instructions as needed.
g. Only Test if you have a calibrated Dot grid in the FOV to make sure the
references work
Wizard Creation
a. In the upper section of the spread sheet, below the Dialog boxes
Place the Wizard Function in column B next to its comment
2. Use the Menu mode (0) for the Wizard and have three (3) choices
A. Drill Bit Results and buttons
B. Adjust Search Region (Edit Region)
C. Calibration (Enable)
Type in the word Setup between the quotes the 0 mode and references
c. Select F6 to toggle/ switch between the custom view and the spread sheet
1. Use the custom graphics in the Custom_View_Drills folder to add graphics to the ‘Set
up” button to the Wizard
a. Right Click on the “Set Up” button to open the Format – Format Cells property
Note: the original button word “setup will bleed through, open the wizard cell
and remove the word setup between the quotes and increase the height of the
row.
2. Use the same folder to add graphics to the Search Area button and the Calibrate check
box.
Communications FTP
Session 6
Objectives
•The student will correctly identify and implement the
client/server protocol of TCP/IP using the TCPDevice
structure as well as auto-inserted structures
1
10/28/2009
2
10/28/2009
Device Functions
• WriteDevice – Sends one or more cell values to another
device over the network using TCP/IP
• TCPDevice
- Used with both WriteDevice and ReadDevice
- Establishes
E t bli h TCP/IP connection
ti
Client/Server
Client Server
(sender) (receiver)
Event
TCPDevice TCPDevice
WriteDevice ReadDevice
Data
3
10/28/2009
TCPDevice
TCPDevice – Establishes TCP/IP connection
• O
One host
h t actst as Client
Cli t (initiates
(i iti t transfer),
t f ) the
th other
th as
Server (waits for request)
Client/Server
Client Server
(sender) (receiver)
Event
TCPDevice
(“is5400_00731e”, TCPDevice(“”,3000,0,0,1000)
3000,0,0,1000)
WriteDevice ReadDevice
Data
TCPDevice TCPDevice
4
10/28/2009
WriteDevice
WriteDevice (Event, TCPDevice, Data1, [Data2, …])
A2=TCPDevice …. A6=“Accepted”
9
ReadDevice
• Imports data from another host using TCP/IP
Reference to cell
containing TCPDevice
5
10/28/2009
Client/Server
Client Server
(sender) (receiver)
Event
TCPDevice TCPDevice
WriteDevice ReadDevice
Data
Acquire an
Image
11
Change C2 reference to
cell containing number or string
12
6
10/28/2009
Client / Server
• For In-Sight to In-Sight, both sender and receiver must
go Online before doing a WriteDevice or ReadDevice
Token(String,delimiter,index)
13
14
7
10/28/2009
Master
trigger network
trigger
15
• All Master or
Network
triggering is
configured in the
Acquire Image
P
Propertyt sheet
h t
16
8
10/28/2009
Master/Slave Configuration
Master Slaves
17
18
9
10/28/2009
Master
network trigger
trigger
ReadResult WriteResult
ReadResult
WriteResult
19
20
10
10/28/2009
ReadResult
C ll mustt d
Cell depend
d on AcquireImage
A i I
Choose the Host Name of broadcaster
Timeout of -1 means wait until data arrives
GetResult
GetResult extracts the transmitted data from the
ReadResult structure
Receiver
22
11
10/28/2009
GetResult(ReadResult, Index)
Multiple Receivers
Only one ReadResult may connect to a given WriteResult
• First ReadResult which goes online and matches a WriteResult
establishes a connection bet
between
een those 2 hosts
• If another host subsequently tries a ReadResult from the same
broadcaster, the ReadResult cell will show #ERR
ReadResult
WriteResult
X
ReadResult
#ERR
24
12
10/28/2009
Result Functions
• Only one WriteResult can be used in a given job
• Receiver may have more than one ReadResult (one per broadcaster)
B
Broadcasters
d t
WriteResult
Receiver
ReadResult
R dR
ReadResult
lt
WriteResult
25
• If more Writes than Reads, the extra values are stored in a buffer
on receiving end
26
13
10/28/2009
Number of Connections
General guidelines
12 connections available per job MAXIMUM
Examples:
- 12 TCPDevice functions in a job
- 12 ReadResult
R dR lt functions
f ti iin a jjob
b
27
Additional Info
• Date and Time
• Resource for Date and
Time to add to
files/Images :
1. Time server
(SNTP) on the
network
2. Internal clock of
the sensor
14
10/28/2009
Additional Info
• You’ve got Mail
• “SMTP” function
• Spread Sheet cell
contains a Structure
• Timer Function
• At 6PM sends a “1” (soft 2) to
the Event cell ($D$53)
referenced in the Write SMPT
property sheet to send an email
29
Additional Info
• Date and Time
• Accessing Date and Time in the
Spread Sheet
• “Now” function
Spread Sheet cell contains a
Structure and reference cell
15
10/28/2009
32
16
10/28/2009
Summary
Peer-to-Peer Client/Server
¾In-Sight to In-Sight ¾In-Sight to any TCP/IP device
• Common trigger
• Data sent every cycle
¾WriteResult: ¾WriteDevice:
- One per job - Can have multiple per job
- Depends on AcquireImage - Depends on event
33
Summary
Peer-to-Peer Client/Server
¾ReadResult: ¾ReadDevice:
- Returns same info as - Returns
R t last
l t string
t i received
i d
broadcast (number, string,#ERR)
- Will timeout with #ERR - No timeout
unless timeout = –1
- Depends on event - Activated by receipt of data
- Use multiple GetResults for - Must
M t parse multiple
lti l values
l
multiple values
¾No other functions needed ¾TCPDevice needed at both ends
¾No port specified by user (uses ¾User specifies port in TCPDevice
34
1069)
17
10/28/2009
Summary
• Time and Date information can be accessed as well as
formatted in order to use the string in something such
as a file name
35
18
NETWORK COMMUNICATION LAB
EXPECTED OUTCOMES:
If there is more than one setup, you will send data from one In-Sight to another In-Sight.
First, you will do this using WriteDevice and ReadDevice. Then, you will use Network
triggering to enable a master camera to trigger slave cameras over the network. Finally,
you will send the similar data using WriteResult and ReadResult.
If there are only Emulators in the network, you will be able to send results
using a Master / Slave configuration
Emulator to Emulator
-----------------------------------------------------------------------------------------------------
EXPECTED OUTCOMES:
This lab will be done as a group exercise. Partner up with the table closest to you. You
will take turns being the Master and the Slave. Each slave should use WriteResult to
send the results. Each master should receive that value using ReadResult.
In-Sight To InSight
-----------------------------------------------------------------------------------------------------
This lab will be done as a group exercise. Partner up with the table closest to you. You
will take turns being the send and the receiver. Each Sender should use TCPDevice and
WriteDevice to send the results for the measurement from the drill bits. Each Receiver
should receive those values using TCPDevice and ReadDevice Details follow.
Sender setup (on In-Sight system): Receiver setup (on In-Sight system):
Use existing drill bit job Use existing drill bit job
Set Trigger to Manual (cell A0) Set Trigger to Manual (cell A0)
Insert TCPDevice setup for Insert TCPDevice setup for
Client (I.P. address to send to) Server (No I.P address)
Trigger camera to send each of the Use Token statements to parse data
results from the drill bit
measurements through a
WriteDevice function
Remember to go OnLine
Swap roles.
In-Sight To In-Sight
EXPECTED OUTCOMES:
This lab will be done as a group exercise. Partner up with the table closest to you. You
will take turns being the Master and the Slave. Each slave should use WriteResult to
send the results from the drill bit. Each master should receive those values using
ReadResult.
PROCEDURE
Use existing drill bit job Use existing drill bit job
Set trigger to Manual Set trigger to Network
Enable Master camera mode DO NOT enable Master camera mode
Designate a Master trigger name Use the Master trigger name in the
Networked cameras
Swap roles
IF TIME PERMITS:
• Add a time stamp to the Image file
Note: Ensure time is current with Sensor or Time Server
2. Find the length of the date time stamp - use the Len function
3. Find and replace illegal characters from the time stamp - use the Find and Replace
functions
Course
Did the course fulfill the learning outcomes and objectives listed at the beginning of the course notes?
Completely Partially Not at all
If not, please explain:_______________________________________________________________________
Were the learning outcomes and objectives appropriate?
Completely Partially Not at all
If not, please explain:_______________________________________________________________________
Which topics were most relevant to your job?_________________________________________________
________________________________________________________________________________________
Are there other topics not covered you would like to see included in the course?
Yes No
If yes, please list: _____________________________________________________________________
Speed of presentation
Much too fast Too fast Just right Too slow Much too slow
Knowledge of material
Excellent Very good Good Fair Poor
-over-
Cognex Course Evaluation Form
Materials
Slides
Excellent Very good Good Fair Poor N/A
Handouts
Excellent Very good Good Fair Poor N/A
Technical documentation
Excellent Very good Good Fair Poor N/A
Videos
Excellent Very good Good Fair Poor N/A
Lab Exercises
Quality and availability of assistance during lab sessions
Excellent Very good Good Fair Poor
Were the lab exercises helpful in reinforcing your understanding of the course material?
Yes No
If not, please explain:_______________________________________________________________________
________________________________________________________________________________________
Overall Rating
Overall rating of the course
Excellent Very good Good Fair Poor
Thank you very much for your input! We look forward to working with you in the future.
COGNEX
Customer Education Center 10/14/04
COGNEX
Cognex Corporation
1 Vision Drive, Natick, MA 01760, USA
508-650-3000
Website: http://www.cognex.com/
7. Try altering the data again, but this time only change the format in the result cell –
GetClock. Do not use any additional functions.