OnEndProgram Event (ADriver, ASystem)

Occurs when a program has finished.

Syntax

Object.OnEndProgram()

The OnEndProgram event syntax has the following parts:

 

Name

Type

Description

Object

ADriver, ASystem

ADriver or a ASystem object

Comments

The OnEndProgram events apply to the Driver and System modules. ATEasy will call first the System Drivers (if exist in your project) in reverse order, and last the System (if exist in your project). If the event procedure does not contain code then ATEasy will not call the event.

The OnEndProgram events are called before the program is about to exit. This can happen after the program (if exist) finished the last test/task and its OnEnd was called or when ExitProgram statement was called.

The following list shows the order of OnEndProgram events combined with default output (see ModuleEvents.prj example for more information). After the System OnEndProgram is called, ATEasy will output the program end header to the log as shown here. The log output can be override to create custom output using SetLogString function:

 

   * System.OnEndTask

   * Program.OnEnd

   * Driver2.OnEndProgram

   * Driver1.OnEndProgram

   * System.OnEndProgram

Stop time... : 11/8/2010 4:25:16 PM

Elapsed time : 0.07 minutes

UUT Status.. : -

Signature    : ....................

================================================================================

   * Program.OnEndSwitchUut

   * Driver2.OnEndSwitchUut

   * Driver1.OnEndSwitchUut

   * System.OnEndSwitchUut

   * System.OnEndSystem

   * Driver2.OnEnd

   * Driver1.OnEnd

   * System.OnEnd

Use the OnEndProgram events to perform cleanup and to turn off instrument power before the application is existed. You can also redirect ATEasy to ignore and not to exit by running another program, task or test using the Run, Task and Test statements. If the event returned normally (not ignored) ATEasy will continue to call all the OnEndProgram events for other modules and will continue to the OnEndSystem event.

Example

The following is an example of one way to use the OnEndProgram event:

System.OnEndProgram()

{

! ... system cleanup code ...

print "System has cleaned up after the end of program "; Program.Name

}

Applies to

ADriver, ASystem

See Also

ExitProgram Statement, OnAbort, OnEnd, OnEndSystem, OnEndTask, OnEndTest, End Events, About Module Events