Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeEnglishEspañolContact

The text of a manual · part 5 of 37

JANUS PSK for Basic, Version 2.1 Reference Manual, pages 41 to 50

Pages 41 to 50 of 362

The original document is the PDF (601 KB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.

For the Intermec J2020, Intermec J2010 and Intermec J2050

Page 41

QuickBasic Library

2

QuickBasic Functions The following pages list the QuickBasic functions available in the PSK, along with notes on syntax and examples of how to use each function. Note: Do not run programs that use PSK library functions on your PC, unless you have the JANUS Application Simulator installed. If you attempt to run these programs without the Simulator, you will receive an error message and the program will not run.

CAUTION

Caution Do not run programs that use Intermec-specific interrupt extensions on your PC, unless you have the JANUS Application Simulator installed. If you attempt to run these programs without the Simulator, they will cause your PC to lock up and possibly corrupt your system BIOS. Conseil N’exécutez pas de programmes utilisant des extensions d’interruption spécifiques à Intermec sur votre PC, à moins que JANUS Application Simulator soit installé. Si vous tentez de les exécuter sans le Simulator, ces programmes risquent de verrouiller votre PC et d’altérer le BIOS de votre système.

2-15

Page 42

JANUS PSK for Basic Reference Manual

QuickBasic Functions Listed by Category Communications imCancelRxBuffer, 2-23 imCancelTxBuffer, 2-26 imLinkComm, 2-76 imProtocolExtendedStatus, 2-84 imReceiveBuffer, 2-87 imReceiveBufferNoprot, 2-89 imReceiveBufferNoWait, 2-92 imReceiveByte, 2-95 imRxCheckStatus, 2-101 imSerialProtocolControl, 2-102 imTransmitBuffer, 2-122 imTransmitBufferNoprot, 2-126 imTransmitBufferNoWait, 2-124 imTransmitByte, 2-128 imUnlinkComm, 2-130

Display imBacklightOff, 2-20 imBacklightOn, 2-21 imBacklightToggle, 2-22 imDecreaseContrast, 2-31 imGetContrast, 2-34 imGetDisplayMode, 2-37 imGetDisplayType, 2-39 imGetFollowCursor, 2-40 imIncreaseContrast, 2-51 imSetContrast, 2-105 imSetDisplayMode, 2-108 imSetFollowCursor, 2-113

2-16

Input imGetInputMode, 2-41 imGetLabelSymbology, 2-44 imGetLength, 2-45 imGetPostamble, 2-46 imGetPreamble, 2-47 imInputStatus, 2-53 imReceiveByte, 2-95 imReceiveInput, 2-97 imSetInputMode, 2-114

Irl imIrlA, 2-55 imIrlK, 2-60 imIrlN, 2-64 imIrlV, 2-69 imIrlY, 2-73

Keypad imGetControlKey, 2-36 imGetKeyclick, 2-43 imGetWarmBoot, 2-50 imNumberPadOff, 2-79 imNumberPadOn, 2-80 imSetControlKey, 2-107 imSetKeyclick, 2-116 imSetWarmBoot, 2-118

Program Control imApplBreakStatus, 2-18 imStandbyWait, 2-121

Page 43

QuickBasic Library

2

Sound imSound, 2-119

System imCommand, 2-28 imGetConfigInfo, 2-33 imMessage, 2-78 imPowerStatus, 2-82 imRsInstalled, 2-100

Viewport imCursorToViewport, 2-30 imGetViewportLock, 2-48 imSetViewportLock, 2-117 imViewportEnd, 2-131 imViewportGetxy, 2-132 imViewportHome, 2-133 imViewportMove, 2-134 imViewportPageDown, 2-136 imViewportPageUp, 2-137 imViewportSetxy, 2-138 imViewportToCursor, 2-140

2-17

Page 44

imApplBreakStatus – QuickBasic imApplBreakStatus Purpose:

This function checks whether the application break sequence has been pressed. All PSK functions are terminated when the application break sequence is keyed in. Place calls to this function at strategic locations in your program to detect when a user wants to break out of a loop. Your program can determine what action to take when the break sequence is detected.

Syntax:

REM $INCLUDE: ’im20bas1.bi’ FUNCTION imApplBreakStatus% CDECL (BreakStatus AS INTEGER)

IN Parameters:

None.

OUT Parameters:

The BreakStatus parameter returns a nonzero value if the break status bit is set and zero if it is not set.

Return Value:

This function returns one of the standard status codes defined in Appendix A, “Status Codes.”

Notes:

The BreakStatus flag is reset each time the routine is called. Because this function is also called during the input routines provided in the library, you should check the return code from input functions for the hex value 8515H. This value indicates that the input function has terminated because the application break sequence was entered. In this case, BreakStatus is cleared by the input function’s call to imApplBreakStatus. To enter an application break sequence 1. Press 2. Press 3. Press 4. Press

2-18 q n2g 1 q to turn off the reader. -

- at the same time.

. This sets the reader’s application break bit.

to turn on the reader.

Page 45

imApplBreakStatus – QuickBasic

2

Example ’**************** imApplBreakStatus **************** REM $INCLUDE: ’im20bas1.bi’ ’ Initializing Variables Brk% = 0 Temp$ = "" ’ Clear the screen CLS ’ Press the following sequence to set the application break on: ’ I/O key (Turn OFF the reader) ’ F3+2+LeftArrow (Press F3, 2, and left arrow at the same time) ’ 1 (Press the 1 key to set application break bit) ’ I/O key (Turn the reader ON) WHILE Temp$ <> "q" ’

Check the application break status status% = imApplBreakStatus(Brk%) IF Brk% THEN PRINT "App Brk is ON" ELSE PRINT "App Brk is OFF" END IF

PRINT PRINT "Press any key to continue, " PRINT "’q’ for quit: " PRINT PRINT Temp$ = INPUT$(1) WEND END

2-19

Page 46

imBacklightOff – QuickBasic imBacklightOff Purpose:

This function turns the display backlight off. Turn the backlight off to prolong the reader’s battery life.

Syntax:

REM $INCLUDE: ’im20bas1.bi’ SUB imBacklightOff CDECL ()

IN Parameters:

None.

OUT Parameters:

None.

Return Value:

None.

Notes:

You can program the backlight to automatically turn off after a specified time to save battery power. The length of time depends on the backlight timeout configuration parameter. The configuration parameter is set in 1 second increments. The default is 10 seconds. This function has no effect on the JANUS 2050.

See Also:

imBacklightOn, imBacklightToggle

Example ’**************** imBacklightOff ******************* REM $INCLUDE: ’im20bas1.bi’ ’ Backlight off CALL imBacklightOff PRINT "Backlight off" END

2-20

Page 47

imBacklightOn – QuickBasic

2 imBacklightOn Purpose:

This function turns the display backlight on to illuminate the reader display in dimly lit environments.

Syntax:

REM $INCLUDE: ’im20bas1.bi’ SUB imBacklightOn CDECL ()

IN Parameters:

None.

OUT Parameters:

None.

Return Value:

None.

Notes:

You can program the backlight to automatically turn off after a specified time to save battery power. The length of time depends on the backlight timeout configuration parameter. The configuration parameter is set in 1 second increments. The default is 10 seconds. This function has no effect on the JANUS 2050.

See Also:

imBacklightOff, imBacklightToggle

Example ’**************** imBacklightOn ******************** REM $INCLUDE: ’im20bas1.bi’ ’ Backlight on CALL imBacklightOn PRINT "Backlight on " END

2-21

Page 48

imBacklightToggle – QuickBasic imBacklightToggle Purpose:

This function toggles the display backlight ON and OFF.

Syntax:

REM $INCLUDE: ’im20bas1.bi’ SUB imBacklightToggle CDECL ()

IN Parameters:

None.

OUT Parameters:

None.

Return Value:

None.

Notes:

You can program the backlight to automatically turn off after a specified time to save battery power. The length of time depends on the backlight timeout configuration parameter. The configuration parameter is set in 1 second increments. The default is 10 seconds. This function has no effect on the JANUS 2050.

See Also:

imBacklightOn, imBacklightOff

Example ’**************** imBacklightToggle ******************** REM $INCLUDE: ’im20bas1.bi’ ’ Backlight toggle CALL imBacklightToggle PRINT "Backlight switched on/off " END

2-22

Page 49

imCancelRxBuffer – QuickBasic

2 imCancelRxBuffer Purpose:

This function clears the receive buffer of the designated communications port.

Syntax:

REM $INCLUDE: ’im20bas1.bi’ FUNCTION imCancelRxBuffer% CDECL (BYVAL PortID AS INTEGER)

IN Parameters:

The PortID parameter identifies the communications port as follows: imCom1 imCom2 imCom4

COM1 COM2, scanner port (2010 and 2050) COM4 (RF only)

OUT Parameters:

None.

Return Value:

This function returns one of the standard status codes defined in Appendix A, “Status Codes.” If there is no input pending to receive, this function returns 4602H (no client).

Notes:

You must install a protocol handler to use this function.

See Also:

imReceiveBufferNoWait, imReceiveBufferNoprot

Example ’**************** imCancelRxBuffer ***************** REM $INCLUDE: ’im20bas1.bi’ ’ Data buffer size must be at least 256 bytes CONST buffsize = 300 ’ Data buffer structure for receive/transmit again and noprot DIM farcomBuffStruct AS imFarComDataStruct ’ Define fixed length strings of 300 bytes (256 is minimum string buffer) DIM str3 AS STRING * buffsize ’fixed length string DIM done AS INTEGER ’ The difference between imReceiveBufferNoWait and the ReceiveBufferNoprot ’ is that the user must set up the imReceiveBufferNoWait comm ’ struct and pend on the results. Whereas, in the Noprot receive, the ’ user sets up the length of the buffer, points at that buffer and

2-23

Page 50

imCancelRxBuffer – QuickBasic

’ sends it off and returns. There is no pending on this level for the ’ imReceiveBufferNoprot routine ’ Phimec protocol handler must be installed to run this routine ’ Get the receive environment ready ’ Call Intermec function status%= imCancelRxBuffer(imCom1) ’ Zero out string str3 = STRING$(buffsize, CHR$(0)) ’ Set up communication buffer structure farcomBuffStruct.command = imPhReceive farcomBuffStruct.protocolMode = imNoProtocol farcomBuffStruct.eomChar = CHR$(13) ’CR for terminating char farcomBuffStruct.userLength = buffsize farcomBuffStruct.SegDataPtr = VARSEG(str3) farcomBuffStruct.OffSetDataPtr = VARPTR(str3) farcomBuffStruct.protocolXferStatus = imCuInuse farcomBuffStruct.CommLength = 0 done = FALSE ’ Call Intermec function status%= imReceiveBufferNoWait(ImCom1, farcomBuffStruct) PRINT "Func1= ", HEX$(status%) ’ Loop until first character in buffer is a ’Q’ or Esc is pressed DO ’ ’ Check for receive errors: ’ Print the error status IF status%= imIserror THEN PRINT "Rx Again err = ", HEX$(status%) done = FALSE ELSE ’ Keyboard char temp$ = " " ’ Get the receive data PRINT "Input chars" PRINT "Enter ’Q’" PRINT "or Esc to exit" ’ Check to see if any characters are in buffer DO WHILE farcomBuffStruct.protocolXferStatus = imCuInuse AND temp$ <> CHR$(27) ’ Pick up any keypad input temp$ = INKEY$ LOOP PRINT "Comm done" ’ Print the input string PRINT str3 ’ Update buffer for next block then call imRxCheckStatus to ’ get protocol handler to reset status. farcomBuffStruct.command = imPhRecvAgain farcomBuffStruct.protocolXferStatus = imCuInuse farcomBuffStruct.commLength = 0 status%= imRxCheckStatus(ImCom1)

2-24