The text of a manual · part 23 of 37
JANUS PSK for Basic, Version 2.1 Reference Manual, pages 221 to 230
Pages 221 to 230 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 221
imIncreaseContrast – Visual Basic
3 imIncreaseContrast Purpose:
This function increases the LCD display contrast by one level. The display contrast is the lightness or darkness of the characters against the reader display. The reader display has 32 levels of contrast, where 0 is very light, and 31 is very dark.
Syntax:
REM $INCLUDE: ’im20vbas.bi’ FUNCTION imIncreaseContrast%()
IN Parameters:
None.
OUT Parameters:
None.
Return Value:
This function returns one of the standard status codes defined in Appendix A, “Status Codes.”
Notes:
The 0 to 31 scale fine tunes the contrast more precisely than using the keypad to adjust the contrast. The functions im_set_contrast and im_get_contrast use a scale of 0 to 7 that is related to the scale of 0 to 31 used by im_increase_contrast and im_decrease_contrast. The following table compares the two scales. This Value on Scale 0 to 7
Equates to This Value on Scale 0 to 31
Contrast Level
0 1 2 3 4 5 6 7
10 12 14 16 18 20 22 24
Very light
Very dark
This function has no effect on the JANUS 2050. See Also:
imGetContrast, imDecreaseContrast, imSetContrast
3-55
Page 222
imIncreaseContrast – Visual Basic
Example ’**************** imIncreaseContrast *************** REM $INCLUDE: ’im20vbas.bi’ PRINT "imIncreaseContrast" ’ Call Intermec function status% = imIncreaseContrast ’ Pause for keypad input temp$ = INPUT$(1) PRINT "imIncreaseContrast" ’ Call Intermec function status% = imIncreaseContrast END
3-56
Page 223
imInputStatus – Visual Basic
3 imInputStatus Purpose:
This function checks to see if any input buffers have data and returns the buffer identification.
Syntax:
REM $INCLUDE: ’im20vbas.bi’ FUNCTION imInputStatus%()
IN Parameters:
None.
OUT Parameters:
None.
Return Value:
The buffers checked correspond to these constants: imNoSelect imLabelSelect imKeyboardSelect imCom1Select imCom2Select imCom4Select imAllSelect
No input buffer selected Label selected Keypad selected COM1 selected COM2, scanner port selected (2010 and 2050) COM4 selected (RF only) All input buffers are selected
Notes:
You must install the Reader Wedge to use this function. For information on loading RWTSR.EXE, see “Runtime Requirements” earlier in this chapter.
See Also:
imReceiveInput
3-57
Page 224
imInputStatus – Visual Basic
Example ’**************** imInputStatus ******************** REM $INCLUDE: ’im20vbas.bi’ DIM str AS STRING * 300 DIM buffer AS STRING * 300 status% = imLinkComm(imCom1, VARPTR(str),VARSEG(str), LEN(str)) WHILE temp$ <> "q" CLS str = STRING$(300, CHR$(0)) inputstat% = 0 statbreak$ = "" PRINT "Getting Input Stat" WHILE inputstat% = 0 AND statbreak$ <> "q" statbreak$ = INKEY$ inputstat% = imInputStatus WEND PRINT "Input status: "; inputstat% PRINT PRINT "Getting Data" status% = imReceiveInput(inputstat%, 20000, source%, VARPTR(buffer)) PRINT "Receive status: "; HEX$(status%) PRINT "Source Input: "; source% PRINT "Output is: " PRINT buffer PRINT PRINT "press q to quit" temp$ = INPUT$(1) WEND status% = imUnlinkComm(imCom1) END
3-58
Page 225
imIrlA – Visual Basic
3 imIrlA Purpose:
This function receives input from bar code labels or the keypad in the same manner as the IRL ASCII input command A. This function returns the input data to the buffer, edits reader commands, and displays input data. For more information on IRL and command A, refer to the IRL Programming Reference Manual.
Syntax:
REM $INCLUDE: ’im20vbas.bi’ FUNCTION ImIrlA% (Timeout, VARPTR(TestTable), VARSEG(TestTable), SSEGADD(MaskString), VARPTR(InString), VARSEG(InString), VARPTR(CmdCount), VARSEG(CmdCount) VARPTR(Symb), VARSEG(Symb))
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 an integer or one of these constants: 0 to 32,767 ms 32,768 to 65,534 ms imZeroTimeout imInfiniteTimeout
Integer range See “Setting Timeout Values” in this chapter. No wait Wait forever
If you use imInfiniteTimeout, the function does not return until the end of message character has been received. 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},
3-59
Page 226
imIrlA – Visual Basic
{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 with 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). Set any unused table entries to {imNoLength,0,0,0}. The MaskString parameter sets up a data mask that received data must match. MaskString accepts a string of constants or wildcard characters. For example, use the string ### - #### to accept only phone numbers. You can use one or more of these wildcard characters to define the mask: # @ ? NULL (CHR$(0)) OUT Parameters:
Numeric Alpha Alphanumeric printable No mask
The InString parameter is the input string. You must allocate at least 256 bytes for InString. The CmdCount returned is 0 unless an abort command is passed in the string.
3-60
Page 227
imIrlA – Visual Basic
3
The Symb 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 imSetInputMode. 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:
imIrlK, imIrlN, imIrlV, imIrlY, imSetDisplayMode, imSetInputMode
3-61
Page 228
imIrlA – Visual Basic
Example ’**************** imIrlA *************************** ’ $INCLUDE: ’im20vbas.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
’ The data mask takes precedence over other options. ’ If no data mask is wanted, just set it to CHR$(0) ’ This example would be for a Social Security number ’
DataMask$ = "###-##-####" + CHR$(0) ’ Null terminate string DataMask$ = CHR$(0) ’ No data mask
’ ’
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
3-62
Page 229
imIrlA – Visual Basic
’ ’ ’ ’ ’ ’ ’ ’ ’ ’ ’ ’ ’ ’
3
LengthTable(3).entry = imNoLength LengthTable(3).min = 0 LengthTable(3).max = 0 LengthTable(3).match = 0 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% = imIrlA(TimeOut, (VARPTR(LengthTable(1).entry), VARSEG(LengthTable(1).entry), SSEGADD(DataMask$), VARPTR(inString), VARSEG(inString), VARPTR(cmdCount%),VARSEG(cmdCount%), VARPTR(Symbology%) VARSEG(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 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
3-63
Page 230
imIrlK – Visual Basic imIrlK Purpose:
This function receives input from the keypad in any format in the same manner as the IRL ASCII input command K. This function returns the input data to the buffer, edits reader commands, and displays input data. For more information on IRL and command K, refer to the IRL Programming Reference Manual.
Syntax:
REM $INCLUDE: ’im20vbas.bi’ FUNCTION ImIrlK% (Timeout, VARPTR(TestTable), VARSEG(TestTable), MaskString, VARPTR(InString), VARSEG(InString), VARPTR(CmdCount), VARSEG(CmdCount))
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 32,767 ms 32,768 to 65,534 ms imZeroTimeout imInfiniteTimeout
Integer range See “Setting Timeout Values” in this chapter. No wait Wait forever
If imInfiniteTimeout is selected, the function will not return until the end of message character has been received. 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},
3-64