Warning:Class A equipment is intended for use in an industrial environment. There may be potential difficulties in
ensuring electromagnetic compatibility in other environments, due to conducted as well as radiated disturbances.
Explanations:
Group1 – ISM equipment (ISM = Industrial, Scientific and Medical)
Group 1 contains all ISM equipment in which there is intentionally generated and/or used conductively coupled
radio-frequency energy which is necessary for the internal functioning of the equipment itself.
Class A equipment
connected to a low voltage power supply network which supplies buildings used for domestic purposes.
Class A equipment
Note:
may allow, with whatever additional measures are necessary, the installation and use of class A ISM equipment in
a domestic establishment or in an establishment connected directly to domestic electricity power supplies.
German versions of the Operating Instructions and Reference manual are available on the CD.
Eine deutsche Version der Bedienungsanleitung und des Referenzhandbuchs finden Sie auf der
beigelegten CD.
is equipment suitable for use in all establishments other than domestic and those directly
shall meet class A limits.
Although class A limits have been derived for industrial and commercial establishments, administrations
The Camera ..........................................................................................................................................................7
1.1
1.2 IVC Studio ..............................................................................................................................................................8
Getting Started ............................................................................................................................................. 11
2
2.1
Creating a product...........................................................................................................................................11
2.2 About Writing Programs ................................................................................................................................14
2.3 Adding Program Steps................................................................................................................................... 16
2.5 Testing and Running the Program.............................................................................................................23
2.6 Saving the Program ........................................................................................................................................24
Using IVC Studio ..........................................................................................................................................27
3.2 Handling the Emulator ...................................................................................................................................30
3.7 IVC Studio Settings .........................................................................................................................................39
Draw Line ....................................................................................................................................................56
4.2 Region of Interest (ROI).................................................................................................................................62
ROI Rectangle............................................................................................................................................62
ROI Rotated Rectangle...........................................................................................................................63
ROI Circle.....................................................................................................................................................65
ROI Ellipse ...................................................................................................................................................66
ROI Perimeter ............................................................................................................................................67
ROI Union.....................................................................................................................................................68
ROI Intersection ........................................................................................................................................69
ROI Difference ........................................................................................................................................... 70
Find Line Edge...........................................................................................................................................85
Find Mean of Edges................................................................................................................................92
Find Circle Edges......................................................................................................................................94
Area ............................................................................................................................................................... 98
Single Blob Analysis ................................................................................................................................99
Mean Intensity........................................................................................................................................ 101
Line Intersection....................................................................................................................................102
Distance and Angle ..............................................................................................................................103
Get Shape................................................................................................................................................113
Match Rotation....................................................................................................................................... 119
In Range.................................................................................................................................................... 138
Polar to Cartesian Coordinates........................................................................................................139
Fit Circle ....................................................................................................................................................140
Fit Ellipse...................................................................................................................................................141
If Then Goto.............................................................................................................................................148
If Error Goto............................................................................................................................................. 149
If in Range Goto.....................................................................................................................................150
If All in Range Goto............................................................................................................................... 151
Get Timer..................................................................................................................................................160
Read from Table.................................................................................................................................... 162
Write to Table .........................................................................................................................................163
Fill Table....................................................................................................................................................164
Load Data Block from Flash .............................................................................................................165
Save Data Block to Flash...................................................................................................................166
Load Image from Flash....................................................................................................................... 167
Save Image to Flash............................................................................................................................ 168
Write Table To Flash ............................................................................................................................170
Read Table From Flash....................................................................................................................... 171
Web Status Page ..................................................................................................................................172
4.11 Communication .............................................................................................................................................174
Communication Setup.........................................................................................................................191
Communication Read/Write..............................................................................................................192
Send to FTP............................................................................................................................................. 193
Get from FTP........................................................................................................................................... 196
Get SNTP Time.......................................................................................................................................198
Set Output................................................................................................................................................ 200
Set All Outputs........................................................................................................................................201
Set Timed Output..................................................................................................................................202
Set LED .....................................................................................................................................................204
Locating Shapes (tips and tricks).......................................................................................................................214
Find Line Edge............................................................................................................................................................218
Communication Setup ............................................................................................................................................223
Blob Finder Setup .....................................................................................................................................................235
6.1 Connecting to Devices................................................................................................................................240
6.2 Saving to Flash ..............................................................................................................................................242
The camera contains a powerful microprocessor that is tailored for image analysis. The
processor can perform a number of commands – or tools – that are used for example for
capturing an image, finding an edge in an image or setting one of the camera’s output
signals.
Working Memory
x1=1.273
y1=9.742
z1=6.37
...
Active
Program
Active
Table
Image
Banks
Data
Blocks
Flash Memory
1
2
3
4
5
...
Program
Banks
1
2
3
4
5
...
Saved
Images
1
2
3
4
5
...
Saved
Data Blocks
The camera also has a working memory, which contains the following:
Active program, which is a sequence of commands that are used for analyzing the
images.
Active table, which is used for reading and storing values that are used during the
analysis.
A number of image banks, which each contains an image captured and processed by
the camera.
Data blocks, which are used by some tools for storing or reading additional data. For
example, some pattern recognition tools (Teach tools) create and save data in a data
block, which can later be used by other tools (Match tools).
In addition, the camera has a flash memory, which is used for additional storage. The flash
memory contains the following:
Program banks, which are used for storing programs and tables that can be loaded into
the camera’s working memory. A program bank always contains both one program and
one table.
Saved images, which can be used for example as a basis when teaching the camera
patterns to recognize.
Saved data blocks, containing for example pattern recognition data to be used by
Match tools, so that the pattern does not have to be taught before running a program.
IVC Studio is used for developing the programs that are used by the cameras when performing inspections – that is, analyzing images. IVC Studio can handle both 2D and 3D
cameras.
When you develop a program in IVC Studio, you work with a product. A product in IVC
Studio is a great help for handling all the devices (usually cameras), programs and tables
that are needed for a certain inspection.
The product contains a list of the used devices, and copies of all programs and tables that
are used by the devices. Normally, each device has one program and one table associated
to it, which is also the program and table that are currently in the working memory.
To be able to work with a program in IVC Studio, it must be associated with a device. The
device can be either a hardware camera or the Emulator, see below. A program is always
executed on a device – and never on the computer. The computer is mainly used for
building and modifying the programs on the devices, and to display the results sent from
the devices.
Product
Devices
Camera1
ProgramsTables
Camera2Emulator
<< uses >>
LabelLabelTable
FillLevelFillTable
1.2.1 IVC Emulator
The Emulator is a software behaving like an IVC camera, and can be used instead of an
IVC camera. The Emulator is available in the IVC Studio development environment, and it
makes it possible to develop programs when there is no IVC camera available. The Emulator can emulate both 2D and 3D cameras. The main difference between the Emulator and
a camera is that the former uses a pre-recorded set of images stored in an image folder
on the PC, whereas the latter views live images.
1.2.2 Programs in Development and Production
During development, you build the program in IVC Studio but the program is automatically
downloaded to the associated device.
When a program (or program step) is executed it is executed in the camera, and the
results are sent back to IVC Studio where they are displayed.
When the development of a program is finished and it is ready to be used, the program
(and table) is downloaded to the device and started.
After this it is not necessary to use IVC Studio any more. It may be used to display the
results from the program, for example to signal when faults occur. But the device can also
be used as a stand-alone unit, where other equipment is used for controlling the device
and displaying the output. For example, you could set up a web page on the camera and
then monitor the camera from a web browser on any computer on the network.
Programs
Tables
Input
Output
1.2.3 Saving Programs
When you save a product in IVC Studio, the included programs and tables are saved with
the product on the computer. Nothing is saved on the device when you save the product.
This is not a problem since the program associated with the device is automatically loaded
into the device as soon as the program is started or edited in IVC Studio.
Product
Devices
Camera 1
Camera 2
Associated
Program
Associated
Table
Copied
automatically
Copy values
manually
Working
Memory
Active
Program
Active
Table
Save in
lash
F
Flash
Memory
1
2
3
4
5
...
Program
Banks
The programs and tables may be stored manually on the device as well. The flash memory
in the device contains a number of program banks, each of which can contain a program
and a table.
When you store a program in the flash memory, you always store the active program and
table, which are currently in the working memory of the device.
A program stored in program bank 0 will automatically be started when the device is
powered up.
A device may be used in several products, using different programs and tables depending
on the product. This makes it easy to use the same camera for performing different inspections. Just create one product for each inspection, and in each product associate the
program and table to be used for the specific inspection.
For example, there are three cameras set up by a production line, and we are producing
two different items on this production line – a transparent bottle and an opaque jar. For the
bottle we can use IVC-2D cameras to inspect both the label on the front and the fill level,
but for the jar we need to use an IVC-3D camera to inspect the fill level.
When switching between producing the two products, we can simply open the product in
IVC Studio to load the corresponding programs and tables into the devices. If we would
change the design of the label for the bottle, we can just change the values in the table
Bottle_Label_Table to suit the new design. If necessary we could also make a copy of the
program Label, modify it, and associate the modified program with device 1.
In this chapter we will introduce the basics in IVC Studio, and learn how to:
Set up IVC Studio to write a program
How to write the program - that is adding program steps and setting parameters
How to test and debug the program
As an example we will build a simple program that checks whether or not a label has been
placed correctly on a bottle, that is if it is tilted or not.
OKFail
A simple way of checking this is to:
Capture an image of the bottle
Search the image along two lines to find the edge of the label in two locations
Calculate the angle between the two locations
If this angle is too large then the label is tilted, and the program changes the state of an
output. In a real application this output could for example control a lever that pushes the
faulty bottle to the side.
When writing a program in IVC Studio you can use either a hardware camera or, if no such
is available, the Emulator.
In the following sections it is assumed that a hardware camera is used, and that both the
camera and IVC Studio are installed and are working properly. How to install the camera
and IVC Studio is described in the installation instruction.
How to use the Emulator is described in section Using IVC Studio in the IVC-2D Reference
Manual.
2.1 Creating a product
Before starting to write the program that performs the inspection, you need the following:
A product to work in
A device to use in the product (in this case a camera)
A program written for the device
A table used for the program in the device
A product in IVC Studio is a collection of devices (usually cameras) that are used for per-
forming an inspection, for example of bottles on a production line. Each device contains
one or more programs that instruct the device how to perform the inspection.
A program is a list of commands, or tools, that the device executes one by one, in order to
capture images, analyze them and draw conclusions from. To its help, the program has a
table that it can read values from and store results to.
Product
Devices
2.1.1 Create a
Camera1
ProgramsTables
Product
Camera2Emulator
<<
uses
>>
LabelLabelTable
FillLevelFillTable
The first step is to create the product to work in:
1.Start IVC Studio and log in.
If you just installed IVC Studio, the default user and password can be found in the
installation instruction.
2.Choose File
Æ New Product from the IVC Studio menu bar.
A new empty product named New Product is opened.
The main window shows the contents of the currently open product. The left pane shows
the different types of objects that the product may contain, that is; devices, programs and
tables.
Clicking on one of the categories will display the objects contained in the product. Since
the product was just created, all the categories are empty, with the exception of Devices,
which displays all available devices.
There is also a fourth type that we haven’t mentioned yet - macros. Macros are basically
small programs that you can call from within regular programs. They can be useful for
reusing blocks of program steps when writing advanced programs.
2.1.2 Select a Device
The next step is to select the device used for the inspection:
3. Click Devices in the left pane of the main window.
The camera is displayed in the right pane. If there are more devices that can be used
by IVC Studio in your network, those will also be displayed in the right pane.
4. Select a device by clicking in the checkbox in front of it in the right pane.
You should always select the devices that you intend to use in your product. IVC Studio
periodically updates the information in the device list by polling the devices that are selected in the list.
If no device is selected in the list, IVC Studio will poll every device it can find for information.
This slows down IVC Studio may affect the performance of devices used by other users.
2.1.3 Create a Program
Now we are ready to create the program that we intend to build and associate it with a
device.
The reason for associating the program with a device before building it is that the program
is always run in a device and not on the computer. What you see in IVC Studio when
running a program are just the results, which are sent from the device. If you didn’t associate the program with a device, you would not be able to see any result of the program or
even test the program.
5. Right-click Programs in the left pane in the main window, and choose New Program
from the pop-up menu.
6. Fill in a name for the program in the dialog box, and click OK.
7. Click Devices in the left pane of the main window.
8. Right-click the device in the right pane that is selected for the product, and choose
Select Program from the pop-up menu.
9. Select the program in the list in the dialog box, and click OK.
2.1.4 Create a Table
There must also be a table associated with the device, so before starting to build the
program we must create a table and associate it with the device:
10. Right-click Tables in the left pane in the main window, and choose New Table from the
pop-up menu
11. Fill in a name for the table in the dialog box, and click OK.
12. Click Devices in the left pane of the main window.
13. Right-click the device in the right pane that is selected for the product and chose
Select Table from the pop-up menu.
14. Select the table in the list in the dialog box, and click OK.
15. Finally, save your changes to the product on the PC by choosing File
Before starting to write the program, we will take a look at what a program consists of and
the programming environment.
2.2.1 Tools
A program is a list of commands – or tools – that are performed by the camera. When the
program runs, the commands are carried out one by one in the order that they appear in
the program list. So when you build a program in IVC Studio, you work with this list of
commands.
Most of the tools have a number of input parameters that can be set. For example when
starting to take a snapshot from a camera, you may specify the exposure time and which
input that should trigger the capture.
0.Retrieveanimage
1.Findedge(left)
Ycoordinateofedge220
2.Findedge(right)
Ycoordinateofedge340
3.Calculateangle
Angle
4.MeasurementOK?
!
Result
5.MeasurementOK
()
"#
(-
45¡
$%&
'%&
.(-
*
Table
Row
Value
#/%
6.MeasurementnotOK
()
+,
Many tools also produce results that are available as output parameters. These parameters can be stored in the table or be used directly by other steps in your program.
When you write a program, the main window contains a few additional parts:
Toolbar – contains the tools that can be used with the device.
Program List – shows the tools used in the program and the parameters for each tool.
Table – shows the contents of the device’s table
Image Banks – shows thumbnails of the images currently in the image banks of the
device (if any)
Preview – shows the result of the program step when applied to an image.
ToolbarTree View
Image Banks
PreviewTableProgram Steps
The toolbar actually contains several toolbars on which the tools are grouped into categories. You switch between the categories by clicking the tabs at the bottom of the toolbar.
The program list shows each step in the programs as a table. Each step contains:
The input parameters that can be set for the tool
The execution time for the tool when executed
The result (return values) from the tool
There are four columns in the program list, which are used for specifying parameter values;
Value, Table, Step and Result. Which column to use depends on what type of parameter
value you want to use; constant values, values stored in the table, or results from previous
steps.
Image banks are used for storing images, just like the table is used for storing values. This
can be very useful, for example if you want to modify the image, but need to use the
original image later on in the program. Note that the images are stored in the camera, and
that the images in the image banks remain there until they are removed or overwritten by
other images.
The preview window is used by some tools to visualize the result of the tool. This preview is
useful when you develop your program, but is not generated when the program is running.
The preview window may also be used for setting parameters for certain tools. This is
further described later on in this chapter.
Now we are ready to start writing our program for inspecting the label on the bottles.
Start by adding the first program step to the program, which should grab an image from
the camera:
1. Click on the name of your program in the left pane in the main window.
A toolbar is displayed at the top of the window, which contains a number of tools that
can be used with the device. Below the toolbar there is a row of tabs, which are used
for switching between different categories.
2. Click the Grab tool in the Image category on the toolbar to add the first step to the
program.
The Grab tool is added to the program’s folder in the left pane, and the Image Banks,
Program List and Previews are displayed in the right pane.
3. Double-click the blue field at the top of the program step, and type a description for
the step, for example “Retrieve an image”.
DescriptionValueTable
Retrieve an image
0 - Grab
01 - Destination bank0------------------
Time of execution (µs)0
Previous result
StepResult
The command is now added to our program, but in order to see the effect of the command, it has to be executed by the camera.
4. Click the Grab step in the program list to select the step.
5. Press F1 to open up the Reference manual for the Grab step.
6. Close the manual again and remember to use the F1 button whenever you want to
learn more about a tool.
7. Choose Debug
ÆExecute Step from the IVC Studio menu, or press the F5 key on the
keyboard.
An image is now retrieved from the camera and stored in image bank 0.
To search the image for the edge we need two tools:
A ROI Rectangle that creates a Region of Interest, which defines where in the image we
expect to find the edge of the label.
A Find Column Edge that looks for the upper edge of the label on the left side of the
image.
Scan line
Left point
Region of interest
(ROI)
We also need a step that finds the upper edge on the right side, but we will add that step
after we have set the necessary parameters.
8. Click the ROI rectangle tool on the ROI toolbar.
9. In the dialog box that is displayed, choose ...after current step and click OK.
The ROI Rectangle step is added to the program list.
10. Add a description to the step, such as “Set ROI to the top of the label”
11. In a similar manner, add a Find column edge tool (from the Edge toolbar) to the
program and give it the description “Find left edge”.
2.4 Setting Parameter Values
The input parameters can be set in a number of different ways:
By manually entering a constant value
By using interactive setup to set constant values
By retrieving a value from the table
By using the result from a previous step
By writing an expression that may combine the methods above
In this section we will look at different ways of setting constant parameter values. Using
tables, results from previous steps and expressions will be shown in the following sections.
One important thing when specifying coordinates in images – coordinates are always
measured from the top, left corner of the image.
Both the ROI rectangle and the Find column edge tools need a number of parameters to be
set:
ROI rectangle • The rectangle that is our region of interest.
Find column edge • An image bank containing the image to scan.
• A Region of Interest (ROI), which is specified by entering the number
of the program step in which we defined the ROI that we want to use.
• The line along which the image should be scanned and the direction
to scan in. Since this tool always scans along vertical lines, the line
can be specified by entering the x coordinate for the line.
• The range of grayscale values in which we expect to find the edge
that we are searching for.
To set a constant value manually is really straight-forward – just enter the value in the Value
column for the parameter:
12. Select the Find column edge step.
13. Double-click the Value column for the parameter 06=ROI definition step, and enter the
program step in which you specified the ROI.
14. Set the scan direction by double-clicking the Value column for the parameter
03=Analysis direction, and choose Up
ÆDown from the menu.
Interactive setup windows are also used for entering constant values, but in this case
captured images are used to provide feedback for the settings. Parameters can be set
interactively in three different ways:
In the Preview window
By clicking the button with three dots (
double-clicked
By double-clicking the Setup field that is displayed at the bottom left corner of certain
program steps
For example, when defining a ROI it is usually much easier to mark it directly in the image in
a preview window than entering coordinates for the rectangle in the Value column:
15. Select the ROI rectangle step.
A rectangle is shown in the upper preview window. This is the default ROI that is set
for a new ROI rectangle.
16. Move and resize the rectangle in the preview, so that it marks the area where you can
see a part of the upper edge of the label.
17. Select the Find column edge step
18. Set the line to scan along by moving it in the preview window.
The line must be inside the ROI, which is also displayed in the preview window. By
default, the line is placed at the left edge of the preview window.
If you need a larger window to work in, you can double-click a preview to open it in a
separate window. In this window you can fine-tune the parameters settings, for example if
there are small details in the image.
Some parameters can be set in special interactive setup windows. These windows are
similar to the preview windows, but contain additional controls that are used for setting the
parameter values.
19. Double-click the Value column for the parameter 04=Gray low, and click the button with
the three dots.
A preview of the image is displayed in a separate window, which also shows the ROI,
the line along which the image is searched (yellow), and the edge that is detected
using the current parameter values (red/green).
20. Click on the H (Gray High) or L (Gray Low) button, and adjust the upper or lower gray
value with the slider, so that the edge of the label is clearly visible within the ROI.
Certain tools have interactive setup windows in which you can set all parameters. These
tools have a Setup field in the bottom left corner of the program step in the program list. To
open the setup window, double-click the Setup field.
When all parameters have been set for the Find Column Edge step, we can duplicate the
step and use the copy to find the edge on the right side – just change the line to search
along.
21. Select the Find column edge and choose EditÆ Copy from the main menu.
22. Choose Edit
23. Set the line to scan along in the new Find column edge step by moving it in the preview
window.
24. Change the description of the program step to “Find right edge”.
2.4.2 Using Tables and Results from Other Steps
We will need the x coordinates for the lines when we calculate the angle of the top edge of
the label. Therefore it is useful to store these values in the table instead of having to set
them manually for each step in which they are used:
ÆPaste.
25. Select the “Find left edge” step, and copy the value of the parameter 02=Column.
This value is the x coordinate for the left point of the label.
26. Paste the value into an empty row in the Value on Device column in the table.
The row is now highlighted in the table, indicating that the value on the device differs
from the value in the database.
You may also enter a description for the row, describing what the value is used for.
27.In the table, right-click the value in the Value on Device column, and choose Copy
Device Value to DB to synchronize the value on the PC with the value in the device.
28. Select the “Find left edge” step again, and double-click in the Table column for the
parameter 02=Column.
29. Fill in the number of the table row in which you pasted the value of the x coordinate.
30. In a similar way, copy the value of the parameter 02=Column in the “Find right edge”
step to the table, and replace the value in the program step with a reference to the
table row.
Now we are ready to add a step that calculates the angle of the top edge of the label.
The tool we are going to add takes the x and y coordinates of two points as parameters.
We just stored the x coordinates in the table, and the y coordinates are the results (output
parameters) of the two Find Column Edge steps in the program.
31. Add a Distance and angle tool (from the Measure toolbar) to the program.
32. Set the parameters 01=Start point X and 03=End point X to refer to the table rows
where you stored the x coordinates of the left and the right point on the label edge.
33. Double-click the Step column of the parameter 02=Start point Y.
A Previous result dialog box is displayed, in which you can select which result from
which program step number to use as parameter value.
34. Choose the step number of the first Find column edge step and then the first result
from that step (there is only one result to choose from), and click OK.
The numbers of the step and the result are entered in the Step and Result columns of
the 02=Start point Y parameter and the current value is displayed in the Value column.
35. In a similar way, set the parameter 04=End point Y to the result of the second Find
Column Edge step.
2.4.3 Using Conditions and Jumps
The angle of the label should now be tested to see whether or not it falls within the valid
range of angles, and accept or reject the bottle according to the result. This is done by
adding the following steps:
In range, which tests if a value lies within a range specified by the upper and lower limit
of the range, and returns 1 if the value is within the range or 0 if it is not within the range.
If then goto, which jumps to a specified program step if a value is not zero.
The Distance and angle tool returns an angle between 0 and 360 degrees, but we would
like to specify an angle between for example -5 to +5 degrees as being a valid angle. One
way to get around this is to state that angles between 5 and 355 degrees are not accepted, and any other angle is accepted.
90°
Angle Out of Range
Angle In Range
90°
α
0°
180°
0°
α
270°
• Angle is not OK
• The test if the angle is
within “Out of Range” returns 1, and the program
jumps
180°
270°
• Angle of the label is OK
• The test if the angle is
within “Out of Range”
returns 0, and no jump is
made
To make it even more flexible, we will store the highest angle that is accepted in the table,
and calculate the range directly in the program step.
36. Add an In range tool (from the Calculation toolbar).
37. Set the parameter 01=Value to the angle that was calculated by the previous step by
referring to the result of that step.
38. Enter the highest acceptable angle, for example 5 degrees, in a row in the table.
39. Set the parameter 02=Min value allowed to refer to the table row in which the angle is
stored.
40. Set the parameter 03=Max value allowed to the following value:
=360-V<table row>
where <table row> is replaced with the number of the row where the angle is
stored.
41. Add an If then goto tool (from the Program toolbar).
42. Set the parameter 01=Control expression to the result of the In range step.
Do not set the parameter 02=Goto step yet, since we are going to jump to a program
The value of the parameter 03=Max value allowed is an expression that calculates a value
each time this step is performed. An expression always begins with an equal sign (=), and
may contain:
Constant values 360, 4/7, etc.
Table values Vn for the value in row n
Results from other steps SmRn for result n of step m
Parameters (arguments) in other steps SmAn input parameter n of step m
Functions sin(), abs(), etc.
Instead of writing an expression, we could have used a Ma the matical oper ation tool. Which
to choose depends on the complexity of the calculation – the more complex a calculation
the more efficient is the Mathematical Expression.
Finally, we add program steps that set one of the outputs of the camera to high or low,
depending on the result of the analysis. This can be used for example to control a lever
that pushes the faulty bottle to the side.
43. Add a Set output tool (from the Communication toolbar), and set the following
parameters:
01=0utput number 0
02=Signal value Low
Name the step “Angle within range”
44. Add a Goto tool (from the Program toolbar) and set the parameters so that this step
jumps to step 0.
45. Add another Set output tool, and set the following parameters:
01=0utput number 0
02= Signal value High
Name the step “Angle out of range”
46. Add a Goto tool and make sure that this step jumps to step 0.
47. Select the If then goto step, and set the parameter 02=Goto step to the step number of
the “Angle out of range” step.
It is not necessary to add the last Goto step, since the program automatically jumps to
step 0 when it comes to the end. It is however a good practice to make sure that the
program jumps to the right place at the end. For example, you may add steps at the
beginning of the program that initialize the program, and that we only intend to run when
the program starts.
2.5 Testing and Running the Program
Now the program is written, but how do we know that it is working properly?
One way is to step through the program using Debug Step. The result of each step is shown in the preview window and the Value column of each
parameter.
48. Use Debug Æ Execute Step and Debug Æ Step by Step to step through the program and
make sure that it gives the correct result. Move the bottle (or what you are using) to
get both accepted and rejected labels.
Another way is to add some program steps that show the result of the analysis, and run
the program.
49. Add a Copy image bank tool after the first Grab step.
We add this step in order to have a copy of the image to draw in. If we draw in the
original image the analysis is affected by our drawings.
50. Add a Draw ROI tool after the ROI rectangle step.
This step draws the region of interest in the image. Make sure to draw in the image
bank with the copy of the image.
51. Add a Add text tool after the “Angle within range” step. Set the following parameters:
04=String ‘OK
06=String color Choose a green color
08=Size 2
You should also specify the location of the text to be displayed with the parameters
01=X origin and 02=Y origin. Make sure to draw in the correct image bank.
52. Add a Display tool after the Add text step, and set the parameter so that it displays
image bank 1.
53. Copy the Add text and the Display steps to after the “Angle within range” step. Change
the text to be displayed to ”Failed” and coloured red.
54. Choose Debug
ÆRun and watch the result in the Display window.
2.6 Saving the Program
To save the program we have written, use File Æ Save Product. This will save the program
on the PC (along with all other programs and tables in the product), but not on the device.
The program is present on the device as well, since it is downloaded to the device as you
build it.
But if the power to the device is cut, your program will be lost from the device and has to
be downloaded again from the PC. To prevent this from happening, you may save the
program in the flash memory on the device.
IVC StudioDevice
Product
Devices
Camera 1
Camera 2
Associated
Program
Associated
Table
Copied
automatically
Copy values
manually
Working
Memory
Active
Program
Active
Table
Save in
lash
F
To download a program to a device without saving it in the flash memory:
Flash
Memory
1
2
3
4
5
...
Program
Banks
1. Open the product containing the program.
2. Make sure the program is associated with the device, and that a table is associated
as well.
3. Right-click the device in the list of devices, and choose Start Program from the pop-up
menu.
The program is downloaded to the device and started. The status of the device is
changed from STOP to RUN.
When you save the program in the flash memory on the device, you choose the program
bank in which the program is saved. You always save the program that is currently in the
working memory of the device, and the table that is active is also saved with the program.
To save the program on the flash memory of the device:
4. Right-click the device in the list of devices and choose FlashÆ Write Program in Flash.
5. Select the program bank in which to save the program, and click OK.
The program is now saved in the selected program bank.
If you save a program in program bank 0, this program will start when the device is powered up. If you want the device to run a different program, you can load that program using
a PC, either by using an existing product (containing the program to be used), or by downloading the program from the device’s flash memory.
2.7 What’s Next?
In this chapter we have looked at the basics of how to handle IVC Studio, such as setting
up a product and writing a simple program. However, there are many features in IVC Studio
and the camera that we have not looked at, and that makes it possible to write advanced
programs for inspections and automation of production. Some of the features are:
Using the camera as a stand-alone unit
Using several devices in a product
Using several programs on a single device
Using Cameras Stand-alone
Once the program is developed it can be downloaded to the device and started. Now the
program will run in the device until it is stopped, and it is no longer necessary to use IVC
Studio. If the program is also saved in program bank 0 on the flash memory, the program
will be started when the device is powered up.
If you want to interact with the device, you can write a program that for example communicates with other equipment via the RS485 port, or uses the inputs and outputs of the
device to communicate with a simple control panel.
A product may use several devices that each performs a certain inspection. It is also
possible to use the same device in several products, and running different programs in the
device depending on in which products it is used.
To use several devices in the product, simply select the devices by clicking the checkbox in
front of them in the main window.
When the development is finished you can easily download the programs and tables to all
included devices at once by right-clicking Devices in the left pane of the main window and
choosing Product Transmission. This will also start the programs in the devices.
Using Several Programs
While there can be only one program in the working memory, additional programs can be
stored in the flash memory of the device. These programs can either be loaded manually
into the working memory, or they can be called from the active program.
To load a program manually, use IVC Studio to associate the program with the device
and then start the program. This requires that the program is available in the product
that is open in IVC Studio.
If the program is not available on the PC, you can retrieve it from the device by right-
clicking the device in the list of devices, and choosing Flash
ÆImport Program from Flash.
To call a program stored in flash from the active program, please refer to the Tools
section of this manual for information on which tool to use.
Note that calling a program stored in flash will load both a program and a table into the
working memory of the device, replacing the previous program and table there.
Ethernet devices are displayed in the right pane in the window.
Click the Ethernet Device Configuration button.
The Ethernet Device Settings window is displayed containing a list
of available devices.
Select a device from the list.
The current settings of that device are displayed in the right pane.
Change the value of the parameter Image Banks.
For IVC-3D, change the value of the parameter Profile Banks.
Click Update.
Æ Configuration from the IVC Studio menu bar.
Chapter 3Reference Manual
Using IVC Studio
IVC-2D
Loading Device Firmware
Firmware contains information on the available tools and how they perform. You load new
firmware to upgrade IVC Studio with new tools.
To load device firmware
Choose File
Note:
Æ Load Device Firmware.
Do not interrupt the loading of firmware once it has started.
Do not disconnect the power or the network connection to
the device until the device is shown again in the list of devices in the IVC Studio main window (that is listed with the
status RUNNING or STOP)
3.1.2 Starting, Stopping, and Resetting Devices
The device can be in one of three states:
run
stop
error
Resetting the device restarts the processor in the camera. This may be necessary if the
device is stalled.
To start running a
program in a device
Right-click the device and choose Start Program from the popup menu, or press F6. The program keeps running until it is
stopped.
To view the result when using an IVC-2D, right-click the
device and choose Live Device from the pop-up menu.
To stop a program
Right-click the device and choose Stop Program from the pop-
up menu.
To reset a device
Choose Options
Æ Configuration from the IVC Studio menu
bar.
A pop-up window containing a tree view appears.
Select Ethernet Devices in the tree view.
Ethernet devices appear in the right panel of the pop-up
window.
Click the Ethernet Device Configuration button.
The Ethernet Device Settings window appears containing
available devices.
Right-click the device and choose Reset Device from the pop-
up menu.
3.1.3 Handling Memory in Camera
Saving camera memory is useful for backup purposes. The camera contains image banks,
a data block memory and a Flash memory. For more information on the Flash memory see
section Handling Programs on the Camera.
Image banks and data block memory are used for storage during program execution.
When starting to develop a new program, it may be useful to refresh the memory in order
to make sure that no old data affects the new program. The contents of the image banks
can also be saved to disk.
To save the data block
memory from the
Right-click the device and choose Device Management
Save Data Block to File from the pop-up menu.
Æ
camera to a PC file
To save an image bank
to disk
Right-click image bank in the active program window and
choose Save Image Bank to Disk from the pop-up menu. See
section Handling Images for more information on handling
image banks.
The Emulator is a software program in IVC Studio that behaves like a hardware camera. It
makes it possible to write or update programs when there is no hardware camera available. The Emulator can behave as (emulate) both 2D and 3D cameras. Each product in
IVC Studio can contain several devices, but only one emulated camera.
The main difference between the Emulator and a camera is that the former uses a predefined set of images stored in a dedicated image folder on the PC, whereas the latter views
live images. Not all tools are emulated by the Emulator; these tools are marked with [Not emulated] in the user interface. Interactive setups are not available for non-emulated tools.
The Grab tool functions differently when the Emulator is used. This is described in section
Using the Grab and the Grab Setup Tools below.
The execution time of a tool when using the emulator depends on the performance of the
PC. This time is not the same as the execution time when the tool is executed on a hardware camera. This means that the field “Time of execution (us)” in the step program view
cannot be used in a calculation of the expected cycle time for the application when the
emulator is used.
From the Emulator menu in the menu bar you can enable and disable the Emulator, and
change its settings. In the Emulator settings dialog you can choose which camera type to
emulate, select which folder to capture pre-recorded images from, and choose to enable
the Emulator automatically when starting IVC Studio.
3.2.1 Preparing images for the Emulator
Instead of viewing live images, the Emulator captures pre-recorded images. Before starting
the Emulator it is thus necessary to prepare images. This is done by recording images that
are captured by a real camera. The images must be saved in the raw format (.raw or .img)
for IVC-3D and IVC-2D, or bitmap (.bmp) for IVC-2D, in a version of IVC Studio that supports the Emulator. When saving an image, the Grab Setup parameters are stored in the
image file and can be read by the Emulator.
Use a camera of the same type that you will emulate.
Select or write a program containing a Grab Setup tool defining
how to captures images, a Grab tool to capture the images, and a
Send to FTP tool to store the images in raw format in a selected
folder. The PC receiving the images must have an FTP server
running.
Choose Emulator
The Emulator settings dialog box is opened.
Æ Settings… from the IVC Studio menu bar.
Loading...
+ 223 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.