beautypg.com

Paxar Gold 6037EX User Manual

Page 59

background image

Function Reference 4-23

Example

#include

#include

#include "mmsultra.h"

void main(void)

{

PRINTINIT pConfig;

// Print data structure

unsigned short usStatus = 0;

// Battery level

short sStatus = 0;

// Command call status

sStatus = pclInit(NULL);

// Start Print subsystem

if (sStatus != 0)

printf("Init Failed\nError: %d", sStatus);

else

{

usStatus = pclGetBatteryLevel();

// Get the battery level

if (usStatus > 711)

// If level OK,

{

usStatus = pclFeed();

// Feed supplies

if (usStatus != 0)

{

printf("Feed Error-- press any key when printer is reset.");

_getch();

pclClearError();

}

}

else

printf("Charge battery");

// Display low level msg

}

pclClose();

// Close Print subsystem

}