labview tutorial - illinois wesleyan universitygspaldin/labview_imaging.pdfbefore it can work in...
TRANSCRIPT
![Page 2: LabView Tutorial - Illinois Wesleyan Universitygspaldin/LabVIEW_Imaging.pdfbefore it can work in LabView. Setting the camera exposure This is the name “cam1” that LabView uses](https://reader034.vdocuments.mx/reader034/viewer/2022042100/5e7c3a1c1d42e16c5001ee15/html5/thumbnails/2.jpg)
Measurement & Automation Explorer
(MAX)
Expand “Devices and Interfaces”
Check that “NI-IMAQdx” appears
(may take a few seconds to refresh)
Expand “NI-IMAQdx”
Check that camera is listed
Camera needs to work in MAX
before it can work in LabView
![Page 3: LabView Tutorial - Illinois Wesleyan Universitygspaldin/LabVIEW_Imaging.pdfbefore it can work in LabView. Setting the camera exposure This is the name “cam1” that LabView uses](https://reader034.vdocuments.mx/reader034/viewer/2022042100/5e7c3a1c1d42e16c5001ee15/html5/thumbnails/3.jpg)
Setting the camera exposure
This is the name “cam1”
that LabView uses to
identify the camera
Click “Grab” to
continuously acquire
images
When closing MAX
agree to save the
camera settings
Adjust the exposure
& gain
![Page 4: LabView Tutorial - Illinois Wesleyan Universitygspaldin/LabVIEW_Imaging.pdfbefore it can work in LabView. Setting the camera exposure This is the name “cam1” that LabView uses](https://reader034.vdocuments.mx/reader034/viewer/2022042100/5e7c3a1c1d42e16c5001ee15/html5/thumbnails/4.jpg)
Using NI-IMAQdx in LabView
![Page 5: LabView Tutorial - Illinois Wesleyan Universitygspaldin/LabVIEW_Imaging.pdfbefore it can work in LabView. Setting the camera exposure This is the name “cam1” that LabView uses](https://reader034.vdocuments.mx/reader034/viewer/2022042100/5e7c3a1c1d42e16c5001ee15/html5/thumbnails/5.jpg)
Setting up an image acquisition
Require the following sequence:
1. Open camera
2. Configure the acquisition
3. Grab image
4. Close camera
This is the same camera reference used
by Measurement & Automation Explorer
![Page 6: LabView Tutorial - Illinois Wesleyan Universitygspaldin/LabVIEW_Imaging.pdfbefore it can work in LabView. Setting the camera exposure This is the name “cam1” that LabView uses](https://reader034.vdocuments.mx/reader034/viewer/2022042100/5e7c3a1c1d42e16c5001ee15/html5/thumbnails/6.jpg)
Image management in LabView
Use “IMAQ Create” to reserve
memory for storing the image
![Page 7: LabView Tutorial - Illinois Wesleyan Universitygspaldin/LabVIEW_Imaging.pdfbefore it can work in LabView. Setting the camera exposure This is the name “cam1” that LabView uses](https://reader034.vdocuments.mx/reader034/viewer/2022042100/5e7c3a1c1d42e16c5001ee15/html5/thumbnails/7.jpg)
Basic camera software
Need to provide a name for the image and
specify its type (e.g. RGB, Greyscale etc.)
Need to provide an indicator for the image
![Page 8: LabView Tutorial - Illinois Wesleyan Universitygspaldin/LabVIEW_Imaging.pdfbefore it can work in LabView. Setting the camera exposure This is the name “cam1” that LabView uses](https://reader034.vdocuments.mx/reader034/viewer/2022042100/5e7c3a1c1d42e16c5001ee15/html5/thumbnails/8.jpg)
Providing an image indicator
1. On front panel right click indicator and select “replace”
2. Select “Vision”
3. Select “Image Display”
![Page 9: LabView Tutorial - Illinois Wesleyan Universitygspaldin/LabVIEW_Imaging.pdfbefore it can work in LabView. Setting the camera exposure This is the name “cam1” that LabView uses](https://reader034.vdocuments.mx/reader034/viewer/2022042100/5e7c3a1c1d42e16c5001ee15/html5/thumbnails/9.jpg)
Run program – snapshot image
Run program once.
Program initialises the
camera, grabs a single image
then closes the camera.
![Page 10: LabView Tutorial - Illinois Wesleyan Universitygspaldin/LabVIEW_Imaging.pdfbefore it can work in LabView. Setting the camera exposure This is the name “cam1” that LabView uses](https://reader034.vdocuments.mx/reader034/viewer/2022042100/5e7c3a1c1d42e16c5001ee15/html5/thumbnails/10.jpg)
Continuous image acquisition
Grab images until program
is stopped by pressing the
“Stop” buttonClose camera only when
program is stopped
These only need to
execute once
![Page 11: LabView Tutorial - Illinois Wesleyan Universitygspaldin/LabVIEW_Imaging.pdfbefore it can work in LabView. Setting the camera exposure This is the name “cam1” that LabView uses](https://reader034.vdocuments.mx/reader034/viewer/2022042100/5e7c3a1c1d42e16c5001ee15/html5/thumbnails/11.jpg)
Creating a sub.vi – first call
Returns a Boolean true
when vi is called for the
first time
![Page 12: LabView Tutorial - Illinois Wesleyan Universitygspaldin/LabVIEW_Imaging.pdfbefore it can work in LabView. Setting the camera exposure This is the name “cam1” that LabView uses](https://reader034.vdocuments.mx/reader034/viewer/2022042100/5e7c3a1c1d42e16c5001ee15/html5/thumbnails/12.jpg)
Creating a camera sub.vi
This case only executes once
Camera closes when main
program is stoppedFirst call
True cases
![Page 13: LabView Tutorial - Illinois Wesleyan Universitygspaldin/LabVIEW_Imaging.pdfbefore it can work in LabView. Setting the camera exposure This is the name “cam1” that LabView uses](https://reader034.vdocuments.mx/reader034/viewer/2022042100/5e7c3a1c1d42e16c5001ee15/html5/thumbnails/13.jpg)
Creating a camera sub.vi
Grab images until main
program is stopped
Shift registers act as storage for
image, camera reference etc.
False cases
True constant stops the
program getting stuck in
the while loop
![Page 14: LabView Tutorial - Illinois Wesleyan Universitygspaldin/LabVIEW_Imaging.pdfbefore it can work in LabView. Setting the camera exposure This is the name “cam1” that LabView uses](https://reader034.vdocuments.mx/reader034/viewer/2022042100/5e7c3a1c1d42e16c5001ee15/html5/thumbnails/14.jpg)
Setting up the connections
On the front panel right click on the vi
icon and select “Show Connector”
Use wiring tool to link up front
panel indicators and controls to
the connector
![Page 15: LabView Tutorial - Illinois Wesleyan Universitygspaldin/LabVIEW_Imaging.pdfbefore it can work in LabView. Setting the camera exposure This is the name “cam1” that LabView uses](https://reader034.vdocuments.mx/reader034/viewer/2022042100/5e7c3a1c1d42e16c5001ee15/html5/thumbnails/15.jpg)
Adding a sub.vi to main program
Select sub.vi to include in
main program.
Any *.vi program can be
inserted as a sub.vi
![Page 16: LabView Tutorial - Illinois Wesleyan Universitygspaldin/LabVIEW_Imaging.pdfbefore it can work in LabView. Setting the camera exposure This is the name “cam1” that LabView uses](https://reader034.vdocuments.mx/reader034/viewer/2022042100/5e7c3a1c1d42e16c5001ee15/html5/thumbnails/16.jpg)
Running sub.vi from main program
CloseSession in
Sub.vi
![Page 17: LabView Tutorial - Illinois Wesleyan Universitygspaldin/LabVIEW_Imaging.pdfbefore it can work in LabView. Setting the camera exposure This is the name “cam1” that LabView uses](https://reader034.vdocuments.mx/reader034/viewer/2022042100/5e7c3a1c1d42e16c5001ee15/html5/thumbnails/17.jpg)
Adding exposure & gain controls
Use “Enumerate Attributes” to
generate list of control
parameters available for the
camera (can be deleted later).
![Page 18: LabView Tutorial - Illinois Wesleyan Universitygspaldin/LabVIEW_Imaging.pdfbefore it can work in LabView. Setting the camera exposure This is the name “cam1” that LabView uses](https://reader034.vdocuments.mx/reader034/viewer/2022042100/5e7c3a1c1d42e16c5001ee15/html5/thumbnails/18.jpg)
Adding exposure & gain controls
Index through the attributes to find those
corresponding to exposure & gain. Take
note of the attribute names and data types.
![Page 19: LabView Tutorial - Illinois Wesleyan Universitygspaldin/LabVIEW_Imaging.pdfbefore it can work in LabView. Setting the camera exposure This is the name “cam1” that LabView uses](https://reader034.vdocuments.mx/reader034/viewer/2022042100/5e7c3a1c1d42e16c5001ee15/html5/thumbnails/19.jpg)
Adding exposure & gain controls
Place 2 numerical sliders
on the front panel. Label
them “Exposure” & “Gain”.
![Page 20: LabView Tutorial - Illinois Wesleyan Universitygspaldin/LabVIEW_Imaging.pdfbefore it can work in LabView. Setting the camera exposure This is the name “cam1” that LabView uses](https://reader034.vdocuments.mx/reader034/viewer/2022042100/5e7c3a1c1d42e16c5001ee15/html5/thumbnails/20.jpg)
Connecting up the controls
Now need to link the controls
to the LabView program and
set the max & min values.
Enumerate Attributes can now be
deleted once the names and
data types are known
![Page 21: LabView Tutorial - Illinois Wesleyan Universitygspaldin/LabVIEW_Imaging.pdfbefore it can work in LabView. Setting the camera exposure This is the name “cam1” that LabView uses](https://reader034.vdocuments.mx/reader034/viewer/2022042100/5e7c3a1c1d42e16c5001ee15/html5/thumbnails/21.jpg)
Using IMAQdx property nodes
Use “not equal” comparison & shift
register to test for changes to the
controls (only updates properties
when values are changed).
“bundle” the controls to make
code more manageable
![Page 22: LabView Tutorial - Illinois Wesleyan Universitygspaldin/LabVIEW_Imaging.pdfbefore it can work in LabView. Setting the camera exposure This is the name “cam1” that LabView uses](https://reader034.vdocuments.mx/reader034/viewer/2022042100/5e7c3a1c1d42e16c5001ee15/html5/thumbnails/22.jpg)
Defining attribute names & types
Setting the attribute data
types
Setting the attribute names
![Page 23: LabView Tutorial - Illinois Wesleyan Universitygspaldin/LabVIEW_Imaging.pdfbefore it can work in LabView. Setting the camera exposure This is the name “cam1” that LabView uses](https://reader034.vdocuments.mx/reader034/viewer/2022042100/5e7c3a1c1d42e16c5001ee15/html5/thumbnails/23.jpg)
Updating the terminal connections
Add the 2 new controls to the
connector terminals using
the wiring tool
![Page 24: LabView Tutorial - Illinois Wesleyan Universitygspaldin/LabVIEW_Imaging.pdfbefore it can work in LabView. Setting the camera exposure This is the name “cam1” that LabView uses](https://reader034.vdocuments.mx/reader034/viewer/2022042100/5e7c3a1c1d42e16c5001ee15/html5/thumbnails/24.jpg)
Updating the main.vi front panel
Double click to change
scale limits
![Page 25: LabView Tutorial - Illinois Wesleyan Universitygspaldin/LabVIEW_Imaging.pdfbefore it can work in LabView. Setting the camera exposure This is the name “cam1” that LabView uses](https://reader034.vdocuments.mx/reader034/viewer/2022042100/5e7c3a1c1d42e16c5001ee15/html5/thumbnails/25.jpg)
Testing the main.vi
Exposure & gain can now be
controlled while vi is running
![Page 26: LabView Tutorial - Illinois Wesleyan Universitygspaldin/LabVIEW_Imaging.pdfbefore it can work in LabView. Setting the camera exposure This is the name “cam1” that LabView uses](https://reader034.vdocuments.mx/reader034/viewer/2022042100/5e7c3a1c1d42e16c5001ee15/html5/thumbnails/26.jpg)
Working with color
Create new images for the
red, green & blue planes
Each RGB color plane
is 8 bit Grayscale
Select the “Extract
Color Planes” vi
![Page 27: LabView Tutorial - Illinois Wesleyan Universitygspaldin/LabVIEW_Imaging.pdfbefore it can work in LabView. Setting the camera exposure This is the name “cam1” that LabView uses](https://reader034.vdocuments.mx/reader034/viewer/2022042100/5e7c3a1c1d42e16c5001ee15/html5/thumbnails/27.jpg)
Working with color
Update the image out indicators
to display the images
Red Green Blue
![Page 28: LabView Tutorial - Illinois Wesleyan Universitygspaldin/LabVIEW_Imaging.pdfbefore it can work in LabView. Setting the camera exposure This is the name “cam1” that LabView uses](https://reader034.vdocuments.mx/reader034/viewer/2022042100/5e7c3a1c1d42e16c5001ee15/html5/thumbnails/28.jpg)
Extracting a row from the image
Controls row position for
extracting X-section from image.
![Page 29: LabView Tutorial - Illinois Wesleyan Universitygspaldin/LabVIEW_Imaging.pdfbefore it can work in LabView. Setting the camera exposure This is the name “cam1” that LabView uses](https://reader034.vdocuments.mx/reader034/viewer/2022042100/5e7c3a1c1d42e16c5001ee15/html5/thumbnails/29.jpg)
Extracting a row from the image
Red Green Blue
X-section
![Page 30: LabView Tutorial - Illinois Wesleyan Universitygspaldin/LabVIEW_Imaging.pdfbefore it can work in LabView. Setting the camera exposure This is the name “cam1” that LabView uses](https://reader034.vdocuments.mx/reader034/viewer/2022042100/5e7c3a1c1d42e16c5001ee15/html5/thumbnails/30.jpg)
Further reading
IMAQ™
IMAQ Vision
Concepts Manual
October 2000 Edition
Part Number 322916A-01