OnEnd Event (AProgram, ADriver, ASystem)

Occurs when the application has finished.

Syntax

Object.OnEnd()

The OnEnd event syntax has the following parts:

 

Name

Type

Description

Object

AProgram, ADriver, ASystem

Module object

Comments

The OnEnd events apply to the Program, Driver and System modules. ATEasy will call first the Program OnEnd event (if one is running) then 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 OnEnd events are called before the program is about to exit. This can happen after the program (if exist) finished the last test/task, or after calling ExitProgram statement or after the system OnInitSystem was called and no program exist, or after the application was aborted.

The following list shows the order of OnEnd events combined with default output (see ModuleEvents.prj example for more information):

 

   * 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 OnEnd events to perform cleanup and to turn off instrument power before the application is exited. 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 OnEnd events for other module and will exit the application (similar to the exit statement).

Example

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

prg1.OnEnd()

{

! ... program cleanup code ...

print "Program "; Program.Name; " has cleaned up after ending."

}

Applies to

AProgram, ADriver, ASystem

See Also

Exit Statement, ExitProgram Statement, OnAbort, OnEndTask, OnEndTest, End Events, About Module Events