Chapter 5   HDevelop Procedures

HDevelop offers a mechanism for the creation and execution of procedures. Procedures are meant to increase the readability and modularity of HDevelop programs by encapsulating functionality of multiple operator calls in one or more procedure calls. It also makes it easier to reuse program code in other HDevelop programs by storing repeatedly used functionality in external procedures.

An HDevelop procedure consists of an interface and a program body. Procedure interfaces resemble the interfaces of HALCON operators. They contain parameter lists for iconic and control input and output parameters. The procedure body contains a list of operator and procedure calls. Furthermore, HDevelop provides extensive support to supplement procedures with structured documentation. The documentation is automatically integrated into the online help system.

Every HDevelop program is made up of one or more procedures. It always contains the main procedure, which has a special status inside the program, because it is always the top-most procedure in the calling hierarchy and cannot be deleted from the program.

HDevelop offers all necessary mechanisms for creating, loading, deleting, copying, modifying, saving, and exporting procedures. Once a procedure is created, it can basically be used like an operator: Calls to the procedure can be added to any program body and be executed with the appropriate calling parameters. Generally, the concept of using procedures inside HDevelop is an extension to the concept of calling HALCON operators since procedure and operator interfaces have the same parameter categories, and the same rules apply for passing calling parameters.