Download HDevelop User's Manual
Transcript
4.2. CODE GENERATION FOR VISUAL BASIC 89 and control variables belong to Variant. The subroutine RunHalcon() has a parameter Window which is of type HWindowX. This is the link to the window in the panel where all output operations are passed to. Depending on the program, additional subroutines and variables are declared. 4.2.2.1 Array Assignment If a single value is assigned to a variant array, a special subroutine is called to ensure that the index is valid. If the array is to small it is resized. 4.2.2.2 Expressions All parameter expression inside HDevelop are translated into expressions based on the HALCON tuple operators. Therefore, an expression might look somewhat complex. In many cases these expressions can be changed to simple Visual Basic expressions, like tuple sub becomes a simple subtraction. To ensure that the exported program has the same effect in Visual Basic this exchange is not applied automatically, because the semantic is not always identical. 4.2.2.3 Stop The HDevelop operator stop is translated into a subroutine in Visual Basic which creates a message box. This message box causes the program to halt until the button is pressed. 4.2.2.4 Exit The HDevelop operator exit is translated into the Visual Basic routine End. Because this routine has no parameter the parameters of exit are suppressed. 4.2.2.5 Used Classes There are only six classes/types that are used: Variant for control parameters and HUntypedObjectX for iconic data. In addition, there is the container class HTupleX which comprises all operators of HALCON processing tuples, in this case the data type Variant. Then, there are the classes HWindowXCtrl and its low level content HWindowX. HWindowXCtrl is used inside the project for the output window and a variable of class HWindowX directs the output to this window. Finally, the class HOperatorSetX is used as a container for all HALCON operators. There is no need for other classes as long as the program has the same functionality as in HDevelop. When editing a generated program you are free to use any of the classes of HALCON/COM to extend the functionality. 4.2.3 Limitations and Troubleshooting Besides the restrictions mentioned in this section and in section 4.4, please also check the description of the HDevelop operators on page 38. HALCON 6.0.4