<< Click to Display Table of Contents > 

Scanner Card Interface > Description > Initialization

Initialization
Previous pageReturn to chapter overviewNext page

Prior to accessing the scanner via the low level calls, the system has to be initialized and configured. The initialization creates all necessary connections and starts all drivers required for the scanner card. Configuration consists of setting up field, offsets, gain, home position, laser type etc, possibly from a client application settings file. Initialization is detailed below; there is also a corresponding topic in the example code section.

warning

Both versions of the interface require COM to be initialized by the calling application with CoInitializeEx(0,COINIT_APARTMENTTHREADED).

COM Interface:

The initialization consists of three steps for the COM-interface:

1.creation of a ScOpticModule2D object

2.specifying correction file and initialization settings

3.initialization via ScInitControl

The ScOpticModule2D is initialized by simply creating the object. The exact syntax for this operation depends on the programming language used.

ScOpticModule2D opticModule = new ScOpticModule2D();
 

After the ScOpticModule2D was created successfully and init values have been specified, initialization can be done via ScInitControl:

opticModule->ScInitControl();
 

The object  may be created exactly once. If such an object is destroyed and supposed to be created again afterwards it has to be ensured that the previous object has really been destroyed. In some programming languages (.NET CLR ( = common language runtime) or Java) it might be possible that a Garbage Collector destroys unused objects asynchronously. In this case the application needs to actively check that the old object has indeed been destroyed before creating a new one. Alternatively you can call the Clear function on ScOpticModule2D prior to destruction, this will detach the COM object manually.

note

ScInitControl

DLL Interface:

The corresponding dll interface steps are:

1.ScSCIInitInterface()

2.specifying correction file and initialization settings

3.ScSCIInitOptic()

The ScOpticModule2D object is used only within the COM interface. In the dll interface all object handling is encapsulated and exposed via direct call functions.

note

ScSCIInitInterface

ScSCIInitOptic