Example

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

void main (void)

 

{

// Command calls status

short sStatus = 0;

LPSCANINFO SScnconfig;

// Scanner data structure

sStatus = scnOpenScanner();

// Enable scanner

if (sStatus == -2)

printf("Scanner error-- %d", sStatus);

else {// Configure scanner sStatus = scnGetScanInfo(SScnconfig);

if (sStatus != 0) printf("Scanner is disabled\n");

else {

SScnconfig->uchCode39 = SCN_ENABLE; sStatus = scnSetScanInfo(SScnconfig); if (sStatus != 0)

printf("Scanner is disabled\n"); else

{

printf("Scanning...\n");

// Perform scan

sStatus = scnTrigger(1);

 

if (sStatus != 0)

 

printf("Scan error-- %d\n", sStatus);

else

 

{

 

spkBeep(1, 1000);

// Check scanner buffer

sStatus = scnScannerHit();

if (sStatus == 0)

 

printf("Scanner buffer is\nempty\n");

else

// Display result

printf("Bar code scanned was a %d", sStatus);

}

 

}

 

}

 

}

// Disable scanner

sStatus = scnCloseScanner();

}

Function Reference 4-73

Page 109
Image 109
Paxar Gold 6037EX manual Scanner data structure