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 10 of 37

JANUS PSK for Basic, Version 2.1 Reference Manual, pages 91 to 100

Pages 91 to 100 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 91

imIrlN – QuickBasic

2

Data is returned only if its length matches one of the five lengths specified in the TestTable. The TestTable parameter must be a matrix of the following form: {a, b, c, d}, {a, b, c, d}, {a, b, c, d}, {a, b, c, d}, {a, b, c, d}, The a position in the matrix is one of the following: imNoLength imLength imRange

Accept data of any length Accept data of a specific length Accept data within a length range

If imLength is specified in the a position, the actual length of the data string is placed in the d position (and b and c are not used). If imRange is specified in the a position, the data length must be within the range of b and c (and d is not used). Any unused table entries must be set to {imNoLength,0,0,0}. OUT Parameters:

You must allocate at least 256 bytes to the PwString parameter. The CmdCount returned is 0 unless an abort command is passed in the string.

2-65

Page 92

imIrlN – QuickBasic

The Symbology parameter is one of these constants: imUnknownDecode imCODABAR imCode11 imCode16k imCode39 imCode49 imCode93 imCode128 imI2Of5 imMSI imPLESSEY imUPC

Unknown bar code Codebar bar code Code 11 bar code Code 16K bar code Code 39 bar code Code 93 bar code Code 49 bar code Code 128 bar code Interleaved 2 of 5 MSI bar code Plessey bar code Universal Product code

Return Value:

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

Notes:

You must set the reader to programmer mode with the imSetInputMode function to use this function. You must install the Reader Wedge to use this function. For information on loading RWTSR.EXE, see “Runtime Requirements” earlier in this chapter. Data does not display correctly on the screen if the display is in the 80 x 25 mode after the cursor has scrolled off the bottom of the display. Set the display to one of the other modes using imSetDisplayMode.

See Also:

2-66 imIrlA, imIrlK, imIrlV, imIrlY, imSetInputMode

Page 93

imIrlN – QuickBasic

2

Example ’**************** imIrlN *************************** ’ $INCLUDE: ’im20bas1.bi’ DIM

LengthTable(imNumIrlLengths) AS imLengthSpec

CONST bufsize = 300 DIM inString AS STRING * bufsize CLS

’ Clear the screen imSetInputMode(imProgrammer) TimeOut = 10000

’ ’

’ Set timeout to 10 seconds

This example shows how to set 3 lengths and 1 range. Input would need to be of length 3, 5, 7, or 11 through 15 characters. LengthTable(1).entry = imLength LengthTable(1).min = 0 LengthTable(1).max = 0 LengthTable(1).match = 3 LengthTable(2).entry = imLength LengthTable(2).min = 0 LengthTable(2).max = 0 LengthTable(2).match = 5 LengthTable(3).entry = imLength LengthTable(3).min = 0 LengthTable(3).max = 0 LengthTable(3).match = 7 LengthTable(4).entry = imRange LengthTable(4).min = 11 LengthTable(4).max = 15 LengthTable(4).match = 0 LengthTable(5).entry = imNoLength LengthTable(5).min = 0 LengthTable(5).max = 0 LengthTable(5).match = 0

’ Just a placeholder

’ This table would be used if the user wanted to enter data of any length. ’ ’ LengthTable(1).entry = imNoLength ’ LengthTable(1).min = 0 ’ LengthTable(1).max = 0 ’ LengthTable(1).match = 0 ’ ’ LengthTable(2).entry = imNoLength ’ LengthTable(2).min = 0 ’ LengthTable(2).max = 0 ’ LengthTable(2).match = 0 ’ ’ LengthTable(3).entry = imNoLength ’ LengthTable(3).min = 0 ’ LengthTable(3).max = 0 ’ LengthTable(3).match = 0 ’

2-67

Page 94

imIrlN – QuickBasic

’ ’ ’ ’ ’ ’ ’ ’ ’

LengthTable(4).entry = imNoLength LengthTable(4).min = 0 LengthTable(4).max = 0 LengthTable(4).match = 0 LengthTable(5).entry = imNoLength LengthTable(5).min = 0 LengthTable(5).max = 0 LengthTable(5).match = 0 PRINT "Input>>";

status% = imIrlN(TimeOut, LengthTable(1).entry, VARPTR(inString), cmdCount%, Symbology%) ’ ’ ’ ’

This will get the length of the returned string by looking for the first null. Doing a LEN function will return the length of the string, but since this is a fixed-length string, the value that would be returned (in this example) would be 300. charCounter% = 1 WHILE MID$(inString, charCounter%, 1) > CHR$(0) charCounter% = charCounter% + 1 WEND charCounter% = charCounter% - 1 PRINT PRINT "Recvd>>";LEFT$(inString,charCounter%) imSetInputMode(imWedge)

END

2-68

Page 95

imIrlV – QuickBasic

2 imIrlV Purpose:

This function receives input from any specified source in the same manner as the IRL universal input command V. For more information on IRL and command V, refer to the IRL Programming Reference Manual.

Syntax:

REM $INCLUDE: ’im20bas1.bi’ FUNCTION ImIrlV% CDECL (BYVAL Timeout AS LONG, BYVAL Edit AS INTEGER, BYVAL Beeper AS INTEGER, BYVAL Display AS INTEGER, BYVAL Source AS INTEGER, BYVAL PwStringPTR AS INTEGER, CmdCount AS INTEGER, Symbology AS INTEGER)

IN Parameters:

The Timeout parameter is the receive input timeout period. You can exit the function before data is received or before the timeout occurs by performing an application break sequence (see your JANUS user’s manual). The return status indicates whether the function was successful, a timeout occurred, or the application break was received. The Timeout parameter is a number or one of these constants: 0 to 65,534 ms imZeroTimeout imInfiniteTimeout

Numeric range No wait Wait forever

If imInfiniteTimeout is selected, the function will not return until the end of message character has been received. The Edit parameter determines whether the Reader Wedge parses reader commands. Use one of these constants: imDisable imEnable

Disable reader command parsing Enable reader command parsing

If Edit is imDisabled, reader commands are treated as data.

2-69

Page 96

imIrlV – QuickBasic

The Beeper parameter determines whether the IRL V command beeps or not when data is entered. Use one of these constants: imAppliBeep imWedgeBeep

Application controls the beep Beeps each time data is entered

The Display parameter determines if the data is displayed when it is entered. Use one of these constants: imDisable imEnable IN/OUT Parameters:

Disable display of data Enable display of data

The Source parameter determines which input sources are allowed. When the IRL V command returns, Source indicates where the data came from. When both keypad and label inputs are enabled, the Source always returns keypad. It is possible for keyed and scanned data to be intermixed. If you have both the keypad and scanner enabled, and you want to know where the data came from, first check the symbology: • If the symbology is imUnknownDecode, then the data is from the keypad. • If the symbology is another value (such as imCode39), then some or all of the data came from the scanner. The Source parameter is one of these constants: imNoSelect imLabelSelect imKeyboardSelect imCom1Select imCom2Select imCom4Select imAllSelect

OUT Parameters:

No source Label Keypad COM1 COM2, scanner port selected (2010 and 2050) COM4 (RF only) All sources are designated

The PwString parameter is the returned string containing the IRL commands and must have at least 256 bytes allocated. The CmdCount is 0 unless an abort command is passed in the string.

2-70

Page 97

imIrlV – QuickBasic

2

The Symbology parameter is one of these constants: imUnknownDecode imCODABAR imCode11 imCode16k imCode39 imCode49 imCode93 imCode128 imI2Of5 imMSI imPLESSEY imUPC

Unknown bar code Codebar bar code Code 11 bar code Code 16K bar code Code 39 bar code Code 93 bar code Code 49 bar code Code 128 bar code Interleaved 2 of 5 MSI bar code Plessey bar code Universal Product code

Return Value:

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

Notes:

You must set the reader to programmer mode with the imSetInputMode function to use this function. You must install the Reader Wedge to use this function. For information on loading RWTSR.EXE, see “Runtime Requirements” earlier in this chapter. To receive data from a communications port, you must install a protocol handler. Use the imLinkComm function to establish a link between the Reader Wedge and a communications port, and use the imUnlinkComm function to remove the link. Data is automatically cleared from both the scanner and the keypad buffers but not from any communications port buffer. Data does not display correctly on the screen if the display is in the 80 x 25 mode after the cursor has scrolled off the bottom of the display. Set the display to one of the other modes using imSetDisplayMode.

See Also:

imIrlA, imIrlK, imIrlN, imIrlY, imSetInputMode

2-71

Page 98

imIrlV – QuickBasic

Example ’**************** imIrlV *************************** ’ $INCLUDE: ’im20bas1.bi’ CONST bufsize = 300 DIM inString AS STRING * bufsize CLS

’ Clear the screen imSetInputMode(imProgrammer) TimeOut

= 10000

’ Set timeout to 10 seconds source%

= imKeyboardSelect + imLabelSelect editMode = imEnable

’ Edit for reader commands beepMode = imWedgeBeep

’ Wedge does the beeping dispMode = imEnable

’ Display the input as it is entered

PRINT "Input>>"; status% = imIrlV(TimeOut, editMode, beepMode, dispMode, source%, VARPTR(inString), cmdCount%, Symbology%) ’ ’ ’ ’

This will get the length of the returned string by looking for the first null. Doing a LEN function will return the length of the string, but since this is a fixed-length string, the value that would be returned (in this example) would be 300. charCounter% = 1 WHILE MID$(inString, charCounter%, 1) > CHR$(0) charCounter% = charCounter% + 1 WEND charCounter% = charCounter% - 1 PRINT PRINT "Recvd>>";LEFT$(inString,charCounter%) IF Symbology% > imUnknownDecode THEN PRINT "From Label" IF Symbology% = imCode39 THEN PRINT "Code 39" ELSE PRINT "Another symbology" END IF ELSEIF source% = imKeyboardSelect THEN PRINT "From Keypad" ELSEIF source% = imCom1Select THEN PRINT "From Com 1" ELSEIF source% = imCom4Select THEN PRINT "From Com 4" ELSE PRINT "Unknown Source" END IF imSetInputMode(imWedge)

END

2-72

Page 99

imIrlY – QuickBasic

2 imIrlY Purpose:

This function receives input from a designated communications port. in the same manner as the IRL ASCII input command Y. This function receives a single block, not an entire file. This function always clears input from the host and edits reader commands from input. Unlike the other IRL instructions, the data is not automatically displayed. For more information on IRL and command Y, refer to the IRL Programming Reference Manual.

Syntax:

REM $INCLUDE: ’im20bas1.bi’ FUNCTION imIrlY% CDECL (BYVAL Timeout AS LONG, BYVAL PortID AS INTEGER, BYVAL (SADD(EomChar$)) AS INTEGER, BYVAL Protocol AS INTEGER, BYVAL (SADD(InString$)) AS INTEGER, CmdCount AS INTEGER)

IN Parameters:

The Timeout parameter is the receive input timeout period. You can exit the function before data is received or before the timeout occurs by performing an application break sequence (see your JANUS user’s manual). The return status indicates whether the function was successful, a timeout occurred, or the application break was received. The Timeout parameter is a number or one of these constants: 0 to 65,534 ms imZeroTimeout imInfiniteTimeout

Numeric range No wait Wait forever

If imInfiniteTimeout is selected, the function will not return until the end of message character has been received. The PortID parameter identifies the communications port as follows: imCom1 imCom2 imCom4

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

2-73

Page 100

imIrlY – QuickBasic

The EomChar parameter is the end of message character needed to terminate input from the communications port. The character is normally a carriage return, but you can set it to any other character. The Protocol parameter is one of these constants: imNoChange imProtocolOff imProtocolOn imNewTermChar

Keep the current protocol Turn the protocol OFF Turn the protocol ON Use the new termination character

The Protocol parameter affects how incoming messages are received: • If imNoChange is specified, the protocol and end of message settings remain the same as the last time the function was called. • If imProtocolOff is specified, the incoming data is terminated with the specified end of message character. If the end of message character is null, the function terminates upon receiving the first character. • If imProtocolOn is specified, the incoming message is terminated with the end of message character of the active protocol. • If imNewTermChar is specified, imProtocolOff is assumed and the new end of message character specified in the parameter list is used. OUT Parameters:

You must allocate at least 256 bytes to the InString parameter. The CmdCount returned is 0 unless an abort command is passed in the string.

Return Value:

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

Notes:

You must set the reader to programmer mode with the imSetInputMode function to use this function. You must install the Reader Wedge to use this function. For information on loading RWTSR.EXE, see “Runtime Requirements” earlier in this chapter. You must install a protocol handler to use this function.

2-74