10.07.2015 Views

HALCON Extension Package Programmer's Manual

HALCON Extension Package Programmer's Manual

HALCON Extension Package Programmer's Manual

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

5.6. AUXILIARY MACROS AND PROCEDURES 83ÀÔÖÔÖÀÈ´ÀÐÐÓ´ÔÖÓÒи´×Þص´×ÞÓ´ÀÔÖµ¾µ¸´ÎÇÁȵ²ÔÖµµÔÖ¼℄ºÔֺРÔÖ¼℄ºØÝÔ ÄÇÆÈÊÔÖ½℄ºÔÖº ºÔÖ½℄ºØÝÔ ÄÇÌÈÊÀÈÙØÈÈÖ´ÔÖÓÒи½¸ÔÖ¸¾µFigure 5.32: Write the control parameter values ¸º℄ using ÀÈÙØÈÈÖ.ÀÐÐÓËØÖÒÅÑ (see Fig. 5.26) specifying the expected number of characters for all inputstrings (parameter ×Þ) at the begin of a supply procedure, see Fig. 5.27 and 5.28. It is notnecessary to deallocate this memory explicetly — this is done automatically at the end of thesupply procedure.5.6 Auxiliary <strong>Extension</strong> <strong>Package</strong> Interface Macros andProceduresIn this section a couple of auxiliary routines are described that facilitate the programming ofsupply or action procedures, see Fig. 5.33.5.6.1 ÀÈThe macro ÀÈ (see Fig. 5.33) checks the result state of a procedure call. Most of the HAL-CON procedures are of the type ÀÖÖÓÖ 8 . For internal <strong>HALCON</strong> procedures the result codeÀ ÅË Çà is returned if no error occurred, see also section 3.6. ÀÈ exits the current procedureif the encapsulated procedure returns any other error code. Moreover, this error code is returnedto the caller of the current procedure.The macro is used to make source code more compact, but still safe with respect to error handling,see Fig. 5.34: Here, the call of the procedure ÀÊÄÓÑÔ is encapsulated within themacro. If any error occurs, the procedure exits with an appropriate error number. Otherwise theprocessing is continued.Be aware, that all memory permanently allocated within a procedure will not be deallocatedin case of an error if you exit the procedure using ÀÈ. This will lead to memoryleaks.8 All interface routines called in the examples in this chapter without being encapsulated by ÀÈ have a functionalitycomparable to ÀÈ, i.e. they exit the current procedure returning an appropriate error number in case ofan error.<strong>HALCON</strong> 6.0

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

Saved successfully!

Ooh no, something went wrong!