Click or drag to resize

16 Stand-Alone Mode

Stand-Alone Mode enables the automatic and autonomous execution of a pre-defined CommandList (the Stand-Alone List) after the SP-ICE-3 Card has (re-)booted.

This stand-alone list is distinguished only by being selected for use in stand-alone mode, and is in all other respects a normal CommandList, which may itself branch to, or make calls to, other lists.

Danger  Warning!

  • If you intend to enable stand-alone mode, read this topic very carefully!

  • Be aware that as long as stand-alone mode is enabled on the card, the laser may be activated unexpectedly if the card is switched on or rebooted.

Stand-Alone Mode: Main Configuration

The main configuration of stand-alone mode is specified by the following three properties of RAYLASE.SPICE3SystemConfig:

Name

Description

EnableStandAloneMode

This enables/disables the stand-alone mode.

Note that this setting only takes effect after the card has been rebooted.

StandAloneListID

The ID of the Stand-Alone List that should be automatically executed after the card has (re-)booted.

Note that the stand-alone list, and any other lists which it calls, must already have been stored on the card before it is (re-)booted.

Command Lists can be stored on the card by using ListAPIStore.

StandAloneExecuteOnErrorListID

The ID of the Execute-On-Error List that should be automatically executed if an error occurs during execution of Stand-Alone List.

  • This list can be used to perform clean up, and possibly restart execution of the Stand-Alone List.

If set to a negative value, execution is simply stopped if an error occurs. In this case, execution of the Stand-Alone List can be resumed by:

  • rebooting the card;

  • making a connection to the card and issuing ListAPIExecute.

How to enable Stand-Alone Mode via the SP-ICE-3 Configuration Tool (SPICE3Config.exe).

  1. Please follow 17.1 Accessing the card with the SP-ICE-3 Configuration Tool to prepare for the remaining steps.

  2. Select the System tab.

    Scroll and resize it, if necessary, so that the required items are visible.

    SP-ICE-3 Configuration-Stand Alone Mode
  3. Set the Stand-Alone Main List and Stand-Alone Error List as appropriate for your application.

  4. Danger  Warning!

    • Be aware that as long as stand-alone mode is enabled on the card, the laser may be activated unexpectedly if the card is switched on or rebooted.

    Click the Enable Stand-Alone Mode checkbox.

  5. To save the altered configuration to the card's non-volatile memory, click the Upload to card button.

Stand-Alone Mode: Further Configuration

Besides storing the list(s) and enabling stand-alone mode, there are several other items that must be configured in order for stand-alone mode to work as expected:

  • Appropriate settings for ScannerConfig and LaserConfig must be stored on the card before starting stand-alone mode.

    Do not forget to store the configurations on the card using the corresponding API functions (LaserAPIStoreConfig, ScannerAPIStoreConfig, etc.).

    Any configuration values which have not been stored will be lost when the card is rebooted.

  • Suitable values for the ProcessVariables can either be stored on the card using ProcessAPIStoreVariables, or specified within the Stand-Alone List itself.

  • From the SP-ICE-3 Configuration Tool (SPICE3Config.exe), the various configuration and variable settings are stored automatically when they are sent to the card using Upload To Card.

  • Within the Stand-Alone List, the laser must be armed (using AppendArmLaser) before the first marking command.

  • When using an Execute-On-Error List, make sure it does not attempt to restart execution until the condition that led to the error has been cleared: otherwise an infinite loop may occur.

Programmatic Stand-Alone Mode Example

The following example shows how configuration of stand-alone mode can be performed by an application program.

Stand-Alone Configuration.
using ( ClientAPI client = new ClientAPI( myCardIP ) )
{
client.System.ResetToDefaults();

ScannerConfig sc = client.Scanner.GetConfig();
sc.FieldSize = new Utils.Point3D( 512000, 512000, 1 );
sc.Heads[0].FieldTransform = new XForm();
sc.Heads[0].TrackingError = new Utils.Point3D( 120, 120, 0 );
client.Scanner.SetConfig( sc );
client.Scanner.StoreConfig(); // Important! Config has to be stored in order to be available after a reboot of the card

LaserConfig lc = client.Laser.GetConfig();
lc.PowerScale = 0.8;
client.Laser.SetConfig( lc );
client.Laser.StoreConfig(); // Important! Config has to be stored in order to be available after a reboot of the card

PortConfig pA = client.Gpio.GetConfig().Ports[IOPort.PortA];
pA.Directions[0] = IODirection.Input; // Set Pin 0-9 of PortA as input
pA.Functions[0] = 0; // Set mapping of Pin 0 t 0 (Gpio)
pA.Functions[4] = 1; // Set mapping of Pin 4 t 1 (StartMark)
pA.Polarities[0] = Polarity.ActiveLow;
pA.Polarities[4] = Polarity.ActiveLow;
GpioConfig gpio = new GpioConfig();
gpio.Ports.Add( IOPort.PortA, pA );
client.Gpio.SetConfig( gpio );
client.Gpio.StoreConfig(); // Important! Config has to be stored in order to be available after a reboot of the card

const int standAloneID = 100;
const int executeOnErrorID = 300;
const int otherListID = 2;

// This list will be started directly after every boot of the card when stand-alone is enabled
CommandList standAloneList = new CommandList();
standAloneList.AppendJumpSpeed( 5 );
standAloneList.AppendJumpDelay( 0 );
standAloneList.AppendMarkSpeed( 0.5 );
standAloneList.AppendMarkDelay( 0 );
standAloneList.AppendPolyDelay( 0 );
standAloneList.AppendJumpAbs( 0, 0 );
standAloneList.AppendProgress( 5 ); // If we connect to the card when running in stand-alone mode we can receive some progress
standAloneList.AppendWaitStart(); // Wait for StartMark
standAloneList.AppendArmLaser( true );
standAloneList.AppendBranchList( otherListID );
client.List.Set( standAloneID, standAloneList );
client.List.Store( standAloneID ); // Important! List has to be stored in order to be available after a reboot of the card

CommandList otherList = new CommandList();
otherList.AppendLoopStart( -1 ); // Endless loop
otherList.AppendJumpAbs( 0, 0 );
otherList.AppendMarkRel( 200000, 200000 );
otherList.AppendJumpRel( -200000, -200000 );
otherList.AppendMarkRel( -200000, -200000 );
otherList.AppendJumpRel( 200000, 200000 );
otherList.AppendMarkRel( 200000, -200000 );
otherList.AppendJumpRel( -200000, 200000 );
otherList.AppendMarkRel( -200000, 200000 );
otherList.AppendJumpRel( 200000, -200000 );
otherList.AppendProgress( 10 ); // If we connect to the card when running in stand-alone mode we can receive some progress
otherList.AppendLoopEnd();
client.List.Set( otherListID, otherList );
client.List.Store( otherListID ); // Important! List has to be stored in order to be available after a reboot of the card

// This list will be executed if an error occurres during execution
CommandList executeOnErrorList = new CommandList();
executeOnErrorList.AppendLoopStart( -1 );
executeOnErrorList.AppendBranchList( standAloneID, 0x01, IOPort.PortA ); // Wait for Pin 0 of PortA to be active
executeOnErrorList.AppendSleep( 1000000 ); // Sleep 1 Second
executeOnErrorList.AppendLoopEnd();
client.List.Set( executeOnErrorID, executeOnErrorList );
client.List.Store( executeOnErrorID ); // Important! List has to be stored in order to be available after a reboot of the card

// After all configurations have been made the stand-alone mode can be activated
SystemConfig sys = client.System.GetConfig();
sys = client.System.GetConfig();
sys.StandAloneList = standAloneID; // The list to automatically start after booting the card
sys.StandAloneExecuteOnErrorList = executeOnErrorID; // The list that should be executed if an error occurres during execution
sys.EnableStandAloneMode = true; // Enable stand-alone mode
client.System.SetConfig( sys );
client.System.StoreConfig(); // Important! Config has to be stored in order to be available after a reboot of the card
}

Now the SP-ICE-3 Card is ready to be rebooted. After rebooting, the card will start executing the Stand-Alone List ( standAloneListID = 100 ).

Operation of the Execute-On-Error List can be tested by using Abort Execution on the General tab of the SP-ICE-3 Configuration Tool (SPICE3Config.exe).