PowerDown (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

All

Firmware version:

1.00 / 1.00.00


PowerDown will switch the power completely off to the RTCU and subsequently switch it on again after a number of seconds. When the device starts again, the program starts from the beginning - just as if the power had been reconnected.

 

On devices that support an IGNITION input, the device will also power up if this input goes high while the device is in power down mode. If the IGNITION input is high when the PowerDown() function is called, an error code will be returned.

 

 

Input:

seconds : DINT (0..2147483648)

Number of seconds to sleep.

-1 will keep the device powered down forever (until the power is recycled or the ignition input is triggered).

 

Returns: INT

If the power-down succeeds, the device will power down for the specified time.

If the function does not succeed, it will return with:

1

- Power-down not possible because ignition is active.

2

- Power-down not successful - probably because the device has been forced on.

 

Declaration:

FUNCTION PowerDown : INT;
VAR_INPUT
  seconds : DINT;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
 
BEGIN
  ...
  // Switch power off, and turn it on again after 60 seconds
  PowerDown(seconds := 60);
  ...
END;
 
END_PROGRAM;