This function sets the power off or suspend (when the resume function is enabled) of the terminal according to the specified parameters.

Syntax

void AutoPowerDown(
  int what, 
  unsigned long time
);

Parameters

what
[in] This is the operation to be executed.
The following values can be specified.
ValueDescription
APD_OFF Disables the AutoPowerDown feature.
APD_ON Enables the AutoPowerDown feature.
APD_RESET Resets the countdown for automatic power down.
Note that the countdown for automatic power down is also reset when a key is pressed, or when data is received via the serial port.
APD_NOW Causes the scanner to switch itself off or suspend immediately.
The time parameter is ignored.
APD_ENABLE The AutoPowerDown function is enabled.
The elapsed time will be reset.
Use this value if you interrupted with APD_DISABLE.
APD_DISABLE The AutoPowerDown function is disabled.
time
[in] The time before the terminal powers down automatically. (Valid only when APD_ON is specified)
  • It can be specified in units of 20 msec at the minimum, but if less than the lower limit (5 seconds) is specified, it will be automatically set to the lower limit (5 seconds).
  • If 0 is specified, the auto power down function will be stopped.
  • The valid setting range is 0,250〜4,294,967,295.
  • Example: If time is 250, 250 x 20 msec will be 5 seconds.

Return value

None

Remarks

Every time when the user presses a key, or when the communications port receives data, the count down for automatic power down is reset.
Specify one of the above parameters for this function.
The power is not turned off during file opening, scanner module startup, buzzer (fixed time) playback, LED (fixed time) lighting, and vibrator (fixed time) vibration.

The lower limit is 5 seconds
For the resume function, refer to the UseResume function in the System library.

Requirements

Header file:
lib.h
Library file:
libSTARTUPOPH5000.a

Sample

#include <stdio.h>
#include "lib.h"


const char string[] = "Hello, world";

void main(void)
{ 
    char c,*s;

    AutoPowerDown(ON, TIME_100MS*100);
    Cursor(ON);
    Cursor(AUTOWRAP);
    s = (char*)string;
    while( (c = *s) != '\0' )
    {
        putchar(c);Delay(TIME_100MS*10);s++;
    }

    for(;;)
    {
        Idle();
    }
}

Last updated: 2020/10/07