Paxar Gold 6037EX User Manual

Size:
2.78 Mb
Download

s c n T r i g g e r

Description

Initiates a scan, placing the scanned data in the scanner buffer. If the LED on the keypad turns green, the scan was successful. This function works with each scanner.

Call scnGetScannedData immediately after calling scnTrigger. scnGetScannedData allows the application to read the scanned data.

Syntax

short far scnTrigger(short sWait);

Parameters

sWait Flag indicating whether to wait until the scan is complete. Values are:

0Return immediately. If the application uses this option, the scan may still be in progress when the function returns to the application. If so, it must use scnScannerHit to determine when the scan ends.

1Wait until the scan is complete, timed out, or un-decodable.

Return Values

0Successful.

-9 The scanner is disabled.

-10 The scanner timed out.

Example

See “scnGetScannedData” for an example.

Function Reference 4-95

s p k B e e p

Description

Sounds the printer’s beeper for the specified duration and frequency. If you pass invalid values in either parameter, the beeper does not sound.

Syntax

void far spkBeep(unsigned char uchDuration, unsigned short usFrequency);

Parameters

uchDuration The duration in tenths of a second. Values are1- 10.

usFrequency The frequency in hertz. Values are110-10,000.

Return Values

None

Example

See “scnGets” for an example.

4-96Programmer’s Manual

s y s G e t B I O S V e r s i o n

Description

Retrieves the BIOS version and build date.

The date string’s format is mm/dd/yy. The version string’s format isM.mm ss, whereM is the major version,mm is the minor version, andss is thesub-version.For example, 1.01 S.

Syntax

int far sysGetBIOSVersion(unsigned char far *lpszVersion, unsigned char far *lpszDate);

Parameters

lpszVersion Pointer to the BIOS version.

lpszDate Pointer to the BIOS build date. If you do not need the date, set this parameter to NULL.

Return Values

0

Successful

-1

Unsuccessful.

Example

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

void main(void)

 

{

// Status of retrieval

int iStatus = 0;

unsigned char ucVersion[9] = "

";// BIOS version

unsigned char ucDate[10] = "

"; // BIOS date

Function Reference 4-97

iStatus = sysGetBIOSVersion(ucVersion, ucDate); // Get info if (iStatus != 0)

printf("BIOS Version retrieval failed.");

else

 

 

 

{

 

 

// Display results

vidScroll(0, 0, 3, 11, 0, 0x07);

vidPutCursor(0, 0, 0);

 

 

printf("

BIOS

");

 

printf("Version is %s\n", ucVersion); printf("Date is %s", ucDate);

}

}

4-98Programmer’s Manual

v i d B a c k L i g h t O n

Description

Turns the LCD backlight on or off.

Syntax

void far vidBackLightOn(short sOn);

Parameters

sOn The state to change the backlight to. Values are1 (for On) and0 (for Off).

Return Values

None

Example

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

void main(void)

 

{

// User input

int cInput = 32;

printf("Turn backlight on?\n(Y/N): ");

// Prompt user

cInput = _getch();

// Get input

switch (cInput)

// Take action

{

 

case 'N': vidBackLightOn(0);

 

break;

 

case 'Y': vidBackLightOn(1);

 

break;

 

default: printf("Invalid input");

 

}

 

}

 

Function Reference 4-99

v i d G e t S t a t e

Description

Retrieves the current video mode as defined in vidSetMode.

Syntax

unsigned short far vidGetState(short far* lpsColCnt, short far* lpsPage);

Parameters

lpsColCnt A variable pointer to the number of character columns.

lpsPage A variable pointer to the current active display page.

Return Values

0

The current video mode (20 column display).

Example

See “pclCalibrate” for an example.

4-100Programmer’s Manual

v i d P u t C u r s o r

Description

Moves the cursor for the specified display page to the specified row and column.

Syntax

void far vidPutCursor(unsigned short usRow,

 

unsigned short usCol,

 

 

short sPage);

 

Parameters

 

 

usRow

Row. For 4-rowprinters, values are0-3.For8-row

 

printers, values are 0-7.

 

usCol

Column. Values are 0-19.

 

usPage

Display page. For 4-rowprinters, values are0-3.

 

For 8-rowprinters, values are0-1.

Return Values

 

 

None

 

 

Example

 

 

#include <stdio.h>

 

#include "mmsultra.h"

 

void main(void)

 

{

 

// Set the page

vidSetPage(0);

vidScroll(0, 0, 3, 19, 0, 0x07);

// Clear the screen

vidPutCursor(0, 0, 0);

// Move the cursor

printf("X\n");

 

// Print an X

printf("The 'X' is at\ncolumn 0, row 0");

// Display message

}

 

 

Function Reference 4-101

v i d P u t S t r

Description

Writes a string of ASCII characters with an attribute at the specified display page’s current cursor location. The string overwrites the characters in the affected positions. This function does not move the cursor. Use vidPutCursor to move it.

If the application writes to a display page other than the current one, the written string does not appear until the application sets that page as the current one with vidSetPage. Strings written to the current page appear immediately.

Syntax

void far vidPutStr(char far* lpchString, unsigned char uchAttr, short sPage);

Parameters

lpchString

The string to write. Bell, backspace, carriage

 

return, and line feed characters are invalid. The

 

string’s length must be less than or equal to the

 

number of remaining columns in the current row.

uchAttr

The string’s attribute. Values are:

 

0x07

Normal video

 

0x70

Reverse video

sPage

The display page. For 4-rowprinters, values are0-

 

3. For8-rowprinters, values are0-1.

Return Values

None

4-102Programmer’s Manual

Example

#include "mmsultra.h"

void main(void)

 

{

// Set the page

vidSetPage(0);

vidScroll(0, 0, 7, 19, 0, 0x07);

// Clear the screen

vidPutCursor(0, 0, 0);

// Move the cursor

vidPutStr("REVERSE", 0x70, 0);

// Print in reverse video

vidPutCursor(1, 0, 0);

// Move the cursor

vidPutStr("NORMAL", 0x07, 0);

// Print in Normal video

}

 

Function Reference 4-103

v i d R e a d C A

Description

Reads a character and attribute from the current cursor location for the specified display page.

Syntax

void far vidReadCA(unsigned char far* lpuchChr, unsigned char far* lpuchAttr, short sPage);

Parameters

lpuchChr A variable pointer to the character.

lpuchAttr A variable pointer to the character’s attribute. Returned values are:

0x07 Normal video

0x70 Reverse video

sPage The display page. For4-rowprinters, values are0- 3. For8-rowprinters, values are0-1.

Return Values

None

Example

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

void main(void)

 

{

// Character at position

unsigned char ucCharacter = 32;

unsigned char ucAttribute = 32;

// Attribute at position

vidSetPage(0);

// Set page

vidPutCursor(0, 0, 0);

// Move cursor

 

// Read char and

 

// attribute

vidReadCA(&ucCharacter, &ucAttribute, 0);

vidScroll(0, 0, 7, 19, 0, 0x07);

// Clear screen

4-104Programmer’s Manual