64
CHAPTER 8. COIN COUNTER
that contains these four elements (see
Create “Coin Info” Cluster Array
),
and then create a data highway lane for this control. Create another lane
as an array of corresponding known coin diameters. Define these values
as constants in the
(qsm) initialize
state.
•
Create a subVI to produce the
coin info
record that is closest to the mea-
sured coin radius; remember to multiply the radius by two and to account
for the calibration scale factor. Calculate the distance between the mea-
sured diameter and all of the known coin diameters (subtract the array of
known diameters from the measured diameter and then take the absolute
value) and then use the
Array Max & Min
function to find the array index
of the minimum distance.
T
IP
:
Use the “Quick Drop” shortcut (Ctrl + space bar) to look up
and place a LabVIEW element by name. See Appendix C on page 139
for more LabVIEW tips.
•
Create a
calculate value
state to sum the individual coin values with a for-
loop structure auto-indexed by the “Circles Data” array to step through
each of the detected coins. Edit the
(image) overlay
state to add a similar
for-loop structure to create text labels to be placed at the center of each
coin; see
Overlay Text at X-Y Coordinates
and
8.3
Validation Tips
Evaluate the performance of your completed application, especially these use
cases:
•
No coins in view,
•
One coin moved to various locations – confirm that the coin is always
classified properly,
•
One sample each for all four classes – confirm that the total value dis-
played is correct,
•
Maximum number of coins in view, various number of samples of each
class – again, confirm that the total value is correct, and
18
(5:12)
19
(1:41)
20
(2:47)
Содержание NI myRIO
Страница 1: ...Ed Doering NI myRIO Vision Essentials Guide...
Страница 2: ......
Страница 11: ...Part I Machine Vision Fundamentals...
Страница 12: ......
Страница 31: ...Part II Introductory Machine Vision Projects...
Страница 32: ......
Страница 38: ...32 CHAPTER 4 CAMERA SETUP...
Страница 44: ...38 CHAPTER 5 STEREO VISION...
Страница 61: ...Part III Machine Vision Application Projects...
Страница 62: ......
Страница 72: ...66 CHAPTER 8 COIN COUNTER...
Страница 85: ...CHAPTER 10 KEYED OPTICAL LOCK 79 Figure 10 3 Typical expected results for the Geometric Matching step...
Страница 86: ...80 CHAPTER 10 KEYED OPTICAL LOCK...
Страница 92: ...86 CHAPTER 11 DMM TEST STAND...
Страница 134: ...128 CHAPTER 17 MARBLE SORTER...
Страница 135: ...Part IV Appendices...
Страница 136: ......
Страница 143: ...B MXPandMSPConnectorDiagrams Figure B 1 MXP myRIO eXpansion Port connector diagram...
Страница 144: ...138 APPENDIX B MXP AND MSP CONNECTOR DIAGRAMS Figure B 2 MSP miniSystem Port connector diagram...
Страница 148: ...142 APPENDIX D BUILD A STAND ALONE APPLICATION...
Страница 149: ...E MarbleSorterConstructionDetails To be continued...
Страница 150: ...144 APPENDIX E MARBLE SORTER CONSTRUCTION DETAILS...