NI Vision System
NI Vision System
University
College
Department
of
Electrical
Engineering,
Information
Technology
and
Cybernetics
NI Vision System
HANS-PETTER
H ALVORSEN,
2 013.02.19
Faculty of Technology,
Tel: +47 35 57 50 00
Fax: +47 35 57 54 01
Table of Contents
Table
of
Contents
....................................................................................................................................
ii
1
Hardware
..........................................................................................................................................
1
2
Software
...........................................................................................................................................
2
2.1.1
NI
Vision
Acquisition
Software
...........................................................................................
2
2.1.2
Vision
Development
Module
.............................................................................................
2
2.1.3
Vision
Builder
for
Automated
Inspections
.........................................................................
3
3
Configuration
....................................................................................................................................
5
4
Using
Vision
in
LabVIEW
...................................................................................................................
8
4.1.1
Using
the
Vision
Acquisition
Express
VI
.............................................................................
8
4.1.2
Using
the
IMAQdx
VIs
......................................................................................................
10
4.1.3
Open
Images
from
a
File
..................................................................................................
12
ii
1 Hardware
The
camera
is
a
Basler
scA640-70gc,
which
is
a
standard
GigE
Ethernet
camera.
The
camera
is
connected
to
the
computer
using
a
standard
Ethernet
cable.
Below
we
see
the
camera
specifications
for
the
Basler
scA640-70gc
model:
Included
with
the
camera:
Power
Supply
Ethernet
cable,
twisted-pair
C-mount
lens
(8
mm,
F1.4
or
12mm,
F.1.4)
Tripod
mount
2 Software
You
need
the
following
software:
LabVIEW
NI
Vision
Acquisition
Software
NI
Vision
Development
Module
(NI
Vision
Builder
for
Automated
Inspection)
If you install all these packages, you will end up with the following palette in LabVIEW:
Pattern
matching
Texture
recognition
2
Software
Below
we
see
the
Machine
Vision
palette
in
LabVIEW:
We
will
learn
more
about
these
later.
Software
NI
Vision
Builder
for
Automated
Inspection
(AI)
is
an
external
and
independent
application
for
building
and
machine
vision
applications
without
the
need
for
programming.
3 Configuration
When
the
necessary
software
is
installed,
we
use
the
Measurement
&
Automation
Explorer
(MAX)
to
get
started.
When
we
plug
in
the
camera
using
an
Ethernet
cable
into
the
computer,
the
camera
should
appear
in
the
list.
You
can
connect
a
camera
to
a
local
Windows
machine
or
a
LabVIEW
Real-Time
target
machine.
We
will
focus
on
connection
the
camera
to
a
local
machine.
Complete
the
following
steps
to
connect
a
GigE
camera
or
an
IEEE
1394
camera
to
a
local
Windows
machine:
1. Connect
the
camera
to
the
Ethernet
port
on
the
local
machine.
2. In
the
MAX
configuration
tree,
expand
Devices
and
Interfaces
to
obtain
a
list
of
installed
devices.
3. Expand
NI-IMAQdx
Devices
to
obtain
a
list
of
available
cameras.
When
the
camera
is
successfully
connected,
you
can
configure
and
test
the
camera
in
MAX.
Click
the
camera
name
to
select
the
appropriate
camera
(in
this
tutorial
we
use
a
Basler
scA640-70gc
camera).
Click
Snap
to
acquire
a
single
image
or
click
Grab
to
continuously
acquire
an
image.
5
Configuration
If everything works, you should be able to see an image inside camera window:
Though
you
might
get
an
error
like
this:
Which
means
you
should
reduce
the
Package
Size
in
the
configuration
and/or
configure
the
Firewall
on
your
computer.
When
it
comes
to
the
Firewall,
the
easiest
thing
to
do
is
to
turn
the
whole
Firewall
off
in
order
to
make
sure
the
camera
works.
Configuration
But
it
is
not
recommended
to
turn
off
the
Firewall
entirely
and
let
the
computer
be
unprotected
for
a
long
time.
If
still
not
working,
you
should
also
try
to
turn
of
the
Anti
Virus
software
temporary.
4 Using Vision in
LabVIEW
We
start
by
demonstrating
how
to
acquire
images
from
the
camera
using
LabVIEW
code.
When
we
drag
the
Vision
Acquisition
Express
VI
to
the
lock
diagram,
a
wizard
will
appear:
The
image
will
be
acquired
on
the
Front
Panel
in
the
Image
Out:
10
Below
we
see
a
simple
example
where
we
use
the
IMAQdx
VIs
to
create
an
application
where
we
acquire
a
single
image
from
the
camera.
11
On
the
Front
Panel
we
can
use
different
containers
for
showing
images
on
the
screen:
12
In
the
example
above
it
will
pop-up
an
open
File
dialog
box,
but
we
can
also
specify
the
file
path
directly
in
the
LabVIEW
code.
On
the
Front
panel
we
will
see
the
image
inside
an
image
container:
13
Telemark
University
College
Faculty
of
Technology
Kjlnes
Ring
56
N-3918
Porsgrunn,
Norway
www.hit.no
Hans-Petter
Halvorsen,
M.Sc.
Telemark
University
College
Department
of
Electrical
Engineering,
Information
Technology
and
Cybernetics
Phone:
+47
3557
5158
E-mail:
[email protected]
Blog:
http://home.hit.no/~hansha/
Room:
B-237a