zpPowerDown (Function)

Top  Previous  Next

Architecture:

X32

Device support:

SX1

Firmware version:

2.70


The device enters Zero Power mode and waits for a specific event to occur before restart.

Zero Power mode is similar to pmPowerDown but uses much less power which allows operation for several years solely from the on-board battery of the device.

 

The device will wake up and reboot when one of several events occur:

 

Vibration.

Timeout.

Digital input 1 change (controlled by dip-switch).

Digital input 2 change (controlled by dip-switch).

External power applied.

Hardware reset (reset switch).

 

Please refer to the technical manual for the RTCU SX1 series for detailed information on the configuration of the digital inputs.

 

After exiting the Zero Power mode, the wake-up cause can be received by querying the boot event with zpBootEvent.

 

Input:

Time: DINT (-1 .. 2147483647) (default -1)

This is the time to power down in minutes. Leave this empty if not used.

 

Vibration: BOOL (default FALSE)

This enables vibration detection (see pmSetVibrationSensivity for adjusting sensitivity).

 

Returns:

None.

 

Declaration:

FUNCTION zpPowerDown;
VAR_INPUT
  Time       : DINT := -1;
  Vibration : BOOL := FALSE;
END_VAR;

 

Example:

INCLUDE rtcu.inc
 
PROGRAM example;
DebugFmt(message := "Reason for boot : \1", v1 := zpBootEvent());
BEGIN
  // boot once a day or on vibration
  zpPowerDown(Time := (60*24), Vibration := TRUE);
END;
 
END_PROGRAM;