RTIsShuttingDown

NI LabWindows™/CVI™ Real-Time Module Help

Edition Date: August 2015

Part Number: 372398G-01

»View Product Info
Download Help (Windows Only)

int RTIsShuttingDown (void);

Purpose

Indicates whether the real-time target is shutting down.

You can use RTIsShuttingDown to programmatically determine when to run the cleanup code in a real-time application, as follows:

void CVIFUNC_C RTmain (void)
{

if (InitCVIRTE (0, 0, 0) == 0)

return; /* out of memory */

/* your initialization code */

while (!RTIsShuttingDown ())

{

/* your code */

}

/* your cleanup code */

CloseCVIRTE ();

}

RT This function is supported only on RT systems.

Parameters

None.

Return Value

Name Type Description
shuttingDown int Indicates whether the real-time target is shutting down. RTIsShuttingDown initially returns false. The following table describes when RTIsShuttingDown returns true and the behavior of the cleanup code and the real-time target.

Shutdown Method During Development and Debugging After the DLL is Deployed on an RT Target
Select Run»Simulate RT Shutting Down The cleanup code runs to completion.
The real-time target does not reboot.
Not applicable.
Select Run»Abort Execution and Reboot Target The cleanup code is not guaranteed to run to completion.
The real-time target reboots.
Not applicable.
Reboot through MAX The cleanup code is not guaranteed to run to completion.
The real-time target reboots.
The cleanup code runs to completion.
The real-time target reboots.

National Instruments recommends that you use the Simulate RT Shutting Down item to terminate execution while you are debugging.

Code Description
1 The real-time target is shutting down.
0 The real-time target is not shutting down.

Additional Information

Library: Real-Time Utility Library

Include file: rtutil.h

LabWindows/CVI compatibility: LabWindows/CVI 8.1 and later

Examples

Refer to the following examples that use the RTIsShuttingDown function:

  • realtime\FileIORT\FileIORT.cws

    Open example
  • realtime\LoopTimingRT\LoopTimingRT.cws

    Open example
  • realtime\NetworkVariableRT\NetworkVariableRT.cws

    Open example
  • realtime\RS-232RT\DebugViaCom.cws

    Open example
  • realtime\RS-232RT\Messages.cws

    Open example
  • realtime\SymmetricMultiprocessingRT\SymmetricMultiprocessingRT.cws

    Open example
  • realtime\ThreadPriorityRT\ThreadPriorityRT.cws

    Open example
  • realtime\WatchdogRT\WatchdogRT.cws

    Open example

WAS THIS ARTICLE HELPFUL?

Not Helpful