emuTerminate (Function)

Top  Previous  Next

Architecture:

ALL

Device support:

All emulated devices

Emulator version:

2.12


This function requests that the RTCU Emulator terminates. If successful, it does not return.

It is useful when e.g. using it for running automated tests, where the RTCU Emulator can then be terminated when the test is completed or has failed.

When called on physical devices, it just returns 0 without doing anything.

 

Input:

exitCode : SINT

The exit code for the RTCU Emulator process to return when terminating.

Note that the RTCU Emulator may decide to return 0 or -1 when terminating by itself.

 

Returns: INT

0

- Not supported.

-1

- Error

 

Declaration:

FUNCTION emuTerminate : INT;
VAR_INPUT
  exitCode   : SINT; // Exit code to return from process when terminated.
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
VAR
  rc     : INT;
END_VAR;
 
BEGIN
  ...
  // Terminate the RTCU Emulator with an exit code of 1
  rc := emuTerminate(exitCode := 1);
  ...
END;
END_PROGRAM;