C Language Development Kit/Snippets/Input/ScanBarcodeSymbol

From OptiWiki

< C Language Development Kit | Snippets | Input
Revision as of 14:36, 10 July 2009 by Jbo (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Description Inputs a string of data by scanning a barcode, returns the barcode type id.
int ScanBarcodeSymbol( char *string, int min_length, int max_length, int *nCodeId);
char *string

Holds the scanned barcode.

int min_length

The minimal length the scanned barcode at least needs to have.

int max_length

The maximum length the scanned barcode may have.

int *nCodeId

The scanned barcode id, when succesfully scanned a barcode.

OK On success.
ERROR Aborted by pressing another key then the TRIGGER key.
Remarks Look in the "lib.h" header file to see to what kind of barcode id the scanned barcode matches. These code id's are different for OPL97xx/DCL153x and PHL series
#include "lib.h"
#include <stdio.h>
#include "input.h"  //Holds the input functions
void main( void )
    char string[ 40+1 ];
    int codeId;
        printf("\fScan barcode..\n");
        while( ScanBarcodeSymbol( string, 1, 40, &codeId ) != OK )
        //See "lib.h" to see to what barcode type the scanned code id matches
        printf("\fscanned:\n%s\ncode id=%d\npress a key", string, codeId);

Personal tools