Reader, Initscanner1, Decode – Argox PA-20 Programming Guide User Manual

Page 25: Sleepscanner1

Advertising
background image

PT-20 Programming Guide

23

Reader

InitScanner1

Purpose: Initialize respective scanner port.

Syntax: void InitScanner1(void);

Example call: InitScanner1( );

Includes:

#include “SDK.h ”

Description: Use InitScanner1 function to initialize scanner port. The scanner port

won't work unless it is initialized.

Returns: None

Decode

Purpose: Perform barcode decoding.

Syntax: int Decode(void);

Example call: while(1){if(Decode( )) break;}

Includes:

#include “SDK.h ”

Description: Once the scanner port is initialized (by use of InitScanner1 function), call

this Decode function to perform barcode decoding. This function should

be called constantly in user's program loops when barcode decoding is

required. If the barcode decoding is not required for a long period of

time, it is

recommended that the scanner port should be stopped by use of the

HaltScanner1 function. If the Decode function decodes successfully, the

decoded data will be placed in the string variable CodeBuf with a string

terminating character appended.

And the c

ode length will be saved in “CodeLen”, the code name type will

be saved in “CodeName”, and the code ID will be saved in CodeID.

And we have the other buffer for save all barcode information in

“FullCodeBuf”, the format of “FullCodeBuf” as follows:

Code

name

Pream

ble

ID*

Code

Lengt

h

Barcode

data

ID*

Posta

mble

Termi

nator

The I

D position depends on “Code ID position” setting.

Returns: 0 : Fail。

Other value : Barcode length。

SleepScanner1

Purpose: Set scanner module sleep.

Syntax: void SleepScanner1(BOOL bStatus);

Advertising