pmDeepSleep (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

All

Firmware version:

1.02 / 1.00.00


pmDeepSleep will stop the processor of the RTCU device for a number of milliseconds - thereby lowering the power consumption considerably.

 

Note:

During DeepSleep mode, the timers (TP, TON, TOF, etc) will not be updated, and the time spent in DeepSleep mode will not be counted.

The real-time clock functions (clockNow, clockGet, etc.) will be updated correctly.

 

The DeepSleep() function will degrade to a Sleep() operation if full execution speed is required by other operations such as the battery charger, voice messaging, or the insertion of a programming cable.

 

Input:                

delay : INT (0..32767)

Number of milliseconds to sleep. The minimum sleep period is 200 ms.

 

Returns:

None.

 

Declaration:

FUNCTION pmDeepSleep;
VAR_INPUT
  delay : INT := -1;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
 
BEGIN
  ...
  // Go in low-power mode for 5000 mSecs
  pmDeepSleep(delay := 5000);
  ...
END;
 
END_PROGRAM;