Example

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

void main (void)

 

{

// Command calls status

short sStatus = 0;

char cBuffer[100];

// Internal scanner buffer

int iInput = 0;

// Trigger input

sStatus = scnOpenScanner();

// Enable scanner

if (sStatus == -2)

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

{

// Perform scan

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

if (iInput == 0) { iInput = _getch(); if (iInput == 0x85) {

sStatus = scnTrigger(1); if (sStatus != 0)

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

else {

// Get data from scan

sStatus = scnGetScannedData(cBuffer);

if (sStatus <= 0)

 

printf("Data retrieval error-- %d", sStatus);

else {

// Beep for success

spkBeep(1, 1000);

 

// Display result

printf("Scan data:\n

%s\n", cBuffer);

printf("Bar code type: %d", sStatus);

}

 

}

 

}

 

}

 

}

// Disable scanner

sStatus = scnCloseScanner();

}

Function Reference 4-65

Page 101
Image 101
Paxar Gold 6037EX manual Internal scanner buffer