22.01.2015 Views

HDevelop User's Manual

HDevelop User's Manual

HDevelop User's Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

86 CHAPTER 4. CODE GENERATION<br />

In this case ÚÐ is a ÐÓÒ variable and there is no multiplication available for the type ÐÓÒ in<br />

the class ÀÌÙÔÐ. So again we have to change the program slightly by adding the cast Operator:<br />

ÀÌÙÔР̽¸Ì¾<br />

ÐÓÒ ÚÐ<br />

̽ ̾ ÀÌÙÔдÚе<br />

4.2 Code Generation for Visual Basic<br />

This section describes how to create a HALCON application in Visual Basic, starting from a<br />

program developed in <strong>HDevelop</strong>. HALCON can be used together with Visual Basic based on<br />

the COM interface of HALCON. A detailed description of this interface can be found in the<br />

HALCON/COM User’s <strong>Manual</strong>.<br />

4.2.1 Basic Steps<br />

4.2.1.1 Export<br />

The first step is to export the program using the menu Ð º ËÚ ×. Here, select the language<br />

(Î×ÙÐ ×) and save it to file. In UNIX you specify the file by giving it the corresponding<br />

extension, which is “º×”. The result is a new file with the given name and the<br />

extension “º×”.<br />

4.2.1.2 The Visual Basic Template<br />

The exported file is intended to be used together with the predefined Visual Basic project that<br />

can be found in the directory<br />

±ÀÄÇÆÊÇÇ̱ÜÑÔÐ×ÚÀÚÐÓÔÌÑÔÐØ<br />

This project contains a form with a display window (ÀÏÒÓÛØÖÐ) and a button labeled ÊÙÒ.<br />

The file generated by <strong>HDevelop</strong> has to be added to this project. This is done by using the<br />

menu ÈÖÓØ º ÅÓÙÐ º Ü×ØÒ and selecting the file. Now the project is ready<br />

for execution: Run the project and then press the ÊÙÒ-button of the form which will call the<br />

exported code.<br />

4.2.2 Program Structure<br />

The file created by <strong>HDevelop</strong> consists of the subroutine ÊÙÒÀÐÓÒ´µ which corresponds to<br />

the original program. In addition, another subroutine is created with the name ÁÒØÀÐÓÒ´µ.<br />

This subroutine applies the same initializations which <strong>HDevelop</strong> does.<br />

Most of the variables (iconic as well as control) are declared locally in the subroutine<br />

ÊÙÒÀÐÓÒ´µ. Iconic variables inside ÊÙÒÀÐÓÒ´µ belong to the class ÀÍÒØÝÔÇØ<br />

<strong>HDevelop</strong> / 2000-11-16

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!