Click or drag to resize

9.6 Magnification Control

For scanners that are equipped with an optical zoom axis or 3-axis scanners with a "defocus" correction file the card can control the scanner's magnification.

MAGNIFICATION: move magnification optics to a different position

For changing the magnification, the MAGNIFICATION command is used.

How quickly the magnification optics move to a new position may be specified via the AppendMagnificationSpeed API method or the MAGNIFICATION_SPEED command.

ListAPI Method

SP-ICE-3 Command

AppendMagnificationAbs

MAGNIFICATION_ABS

AppendMagnificationRel

MAGNIFICATION_REL

Example: Changing the Magnification.
Note  Note

Boilerplate code is omitted from this example for brevity: please refer to 12.3 Example Code in this Manual.

Marking two lines at different magnifications.
using ( ClientAPI client = new ClientAPI() )
{
    client.Connect( CardIP );

    client.System.ResetToDefaults();

    double markSpeed = 0.1;
    double jumpSpeed = 1.0;
    double magnificationSpeed = 0.1;

    // For this example, we choose to mark two horizontal lines, one at position y0 the other at position y1.
    // The two lines will be marked at two different magnifications.
    double y0 = 0;
    double y1 = 10000;
    double minX = 0;
    double maxX = 10000;
    double magnification0 = 1.0;
    double magnification1 = 2.0;

    CommandList list = new CommandList();

    // Append process parameter values to the List:
    list.AppendJumpSpeed( jumpSpeed );
    list.AppendMarkSpeed( markSpeed );
    list.AppendMagnificationSpeed( magnificationSpeed );

    // Append vectors to the List:
    list.AppendMagnificationAbs( magnification0, false );
    list.AppendJumpAbs( minX, y0 );
    list.AppendMarkAbs( maxX, y0 );
    list.AppendMagnificationAbs( magnification1, false );
    list.AppendJumpAbs( minX, y1 );
    list.AppendMarkAbs( maxX, y1 );

    int listID = 0;
    client.List.Set( listID, list );

    // Determine a suitable timeout value for the marking process.
    int timeoutMs = (int)( 1e-3 * 2 * ( maxX - minX ) / markSpeed ) + 2000;

    client.Laser.ArmLaser( true );

    client.List.Execute( listID );

    int? doneID;
    if ( !client.List.WaitForListDone( out doneID, timeoutMs ) )
    {
        throw new ListException( "Timed out waiting for ListDone." );
    }
    if ( doneID != listID )
    {
        throw new ListException( "Got ListDone for wrong listID!" );
    }
}
Async option

The MAGNIFICATION command can be executed synchronously or asynchronously.

Synchronous execution

If asynchronous execution is disabled the execution of the list will be halted until the magnification command is completed, i.e. until the magnification optics reach the desired position.

MAGNIFICATION command with the async flag disabled and a subsequent JUMP command.
list.AppendMagnificationAbs( 1.0, false );
list.AppendJumpAbs( 0, 0 );
Bitmap - MagnificationSync.svg not found.
Commands running in sequence
Asynchronous execution

If asynchronous execution is enabled the execution of the list will proceed with subsequent commands and not wait for the MAGNIFICATION command to be completed.

MAGNIFICATION command with the async flag enabled and a subsequent JUMP command.
list.AppendMagnificationAbs( 1.0, true );
list.AppendJumpAbs( 0, 0 );
Bitmap - MagnificationAsync.svg not found.
Commands running in parallel