Example

#include <conio.h> #include <stdio.h> #include "mmsultra.h"

void main(void)

 

{

// Pointer to cBuffer

char *pStatus2 = NULL;

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);

}

 

}

 

}

 

}

// Disable scanner

sStatus1 = scnCloseScanner();

}

Function Reference 4-61

Page 97
Image 97
Paxar Gold 6037EX manual Char *pStatus2 = Null