beautypg.com

Example – Avery Dennison 6035 Programmer Manual Rev.CA 6/01 User Manual

Page 102

background image

Function Reference 4-61

Example

#include

#include

#include "mmsultra.h"

void main(void)

{

char *pStatus2 = NULL;

// Pointer to cBuffer

char cBuffer[100];

// Application buffer

short sStatus1 = 0;

// Command calls status

int iInput = 0;

// Trigger input

sStatus1 = scnOpenScanner();

// Enable scanner

if (sStatus1 == -2)

printf("Scanner open error-- %d", sStatus1);

else

{

// Perform scan

printf("Press trigger to\nscan...\n");

iInput = _getch();

if (iInput == 0)

{

iInput = _getch();

if (iInput == 0x85)

{

pStatus2 = scnGets(cBuffer);

if (pStatus2 == NULL)

printf("Scanner buffer read error\n");

else

{

spkBeep(1, 1000);

// Beep for success

// Display result

printf("Scan data:\n %s\n", cBuffer);

}

}

}

}

sStatus1 = scnCloseScanner();

// Disable scanner

}