DeepSleep (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

All

Firmware version:

1.02 / 1.00.00


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

 

This function is equivalent to pmDeepSleep().

 

Note:

During deep sleep mode the timers (TP, TON, TOF, etc.) will not be updated and the time spent in deep sleep 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 when the RTCU IDE (or any other RACP1-compatible host) is connected to the device. This is to ensure stable communication without interruptions.

 

 

Input:

delay : INT (0..32767)

Number of milliseconds to sleep.

The actual deep sleep period will be adjusted into steps of 250 ms.

 

Returns:

None.

 

Declaration:

FUNCTION DeepSleep;
VAR_INPUT
  delay : INT;
END_VAR;

 

 

Example:

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