HALCON/COM User's Manual
HALCON/COM User's Manual
HALCON/COM User's Manual
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Chapter 3<br />
Example Visual Basic Session<br />
In this chapter you will learn how to develop <strong>HALCON</strong> applications quickly using Microsoft Visual<br />
Basic and the <strong>HALCON</strong>/<strong>COM</strong> interface. There will be simple steps describing what to do.<br />
The result will be a very small exemplary vision application with doubtful value but equipped<br />
with a graphical user interface. As an additional source of information you are strongly encouraged<br />
to have a look at the other examples which are supplied as Visual Basic sources together<br />
with <strong>HALCON</strong>.<br />
The program developed in this chapter is also available ready to go in the<br />
±ÀÄÇÆÊÇÇ̱ÒÜÑÔÐ×ÒÚÒÅÒÙÐ directory together with other examples. However,<br />
it is recommended to follow the steps below and program it yourself, as you will get a<br />
better impression of how Visual Basic program development works and gain a lot of additional<br />
information with the single steps.<br />
Please note, that to use <strong>HALCON</strong>/<strong>COM</strong> inside Visual Basic you need Windows NT 4.0 with<br />
Service Pack 4 or Windows 2000, and Visual Basic 6.0.<br />
3.1 First Step: The GUI<br />
Go ahead and<br />
1. Launch Visual Basic. A dialog named ÆÛ ÈÖÓØ should appear allowing you to<br />
select the type of project you want. Switch to ÆÛ in the tab list, select ËØÒÖ <br />
and click ÇÔÒ.<br />
2. Select ÈÖÓØ from the menu bar and click ÓÑÔÓÒÒØ×. A dialogue box shows up<br />
listing the components installed on your system. Switch to ÓÒØÖÓÐ× in the tab list and<br />
place a check next to the item ÀÐÓÒ ØÝÔÐÖÖÝ Î½º¼.<br />
3. Press ¾. The object browser should appear. See if you can find ÀÁÑ and browse<br />
through some of the corresponding methods. Clicking on a method shows its parameterization<br />
as well as a short help text about what it will do in the status area at the bottom<br />
of the object browser. Close the object browser.<br />
4. Have a look at the dialogue template (’form’) showing in the lower half of the<br />
screen; it should be titled ÓÖѽ. In the upper half you will discover an area titled<br />
ÈÖÓÔÖØ× ¹ ÓÖѽ. Here you can set and retrieve the active GUI object’s (in this<br />
17