Download HALCON Version 5.2 HALCON/C++ User's Manual
Transcript
2.3. NUMERICAL PARAMETERS
27
The syntax of tuple- and simple-mode are basically the same. The data type in the tuple-mode
is just HTuple, that’s all.
If you are not interested in a certain value of a numerical output parameter you can use the
anonymous variable “ ” instead of passing a “dummy” tuple to that variable.
#include "HalconCpp.h"
#include "iostream.h"
main ()
{
HTuple SysFlags,Info;
long i;
// Tuple variables
// Loop variable
::get_system("?",&SysFlags);
// Get system values
for (i=0; i<SysFlags.Num(); i++) {
::get_system(SysFlags[i].S(),&Info);
out << SysFlags[i] << "=" << Info << "\n";
}
// Get i-th Sysflag
// Print i-th Sysflag
}
Figure 2.10: A sample program for using the tuple-mode: output of the actual HALCON system
state.
The sample program in Fig. 2.10 shows the use of a tuple. The program obtains information
on the actual HALCON system state. The call ::get system("?",&SysFlags) gets all flags
of the system and its current values. Because the number and the type of the numerical output
parameter are not known in this case, the call has to be made in the tuple-mode. The rest of the
program is self-explanatory.