The text of a manual · part 25 of 37
JANUS PSK for Basic, Version 2.1 Reference Manual, pages 241 to 250
Pages 241 to 250 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 241
imIrlV – 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. 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
3-75
Page 242
imIrlV – Visual Basic
Example ’**************** imIrlV *************************** ’ $INCLUDE: ’im20vbas.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, VARPTR(source), VARSEG(source%), 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%) 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
3-76
Page 243
imIrlY – Visual Basic
3 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: ’im20vbas.bi’ FUNCTION imIrlY% (Timeout, PortID, SSEGADD(EomChar$), Protocol, 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. The PortID parameter identifies the communications port as follows: imCom1 imCom2 imCom4
COM1 COM2, scanner port (2010 and 2050) COM4 (RF only)
3-77
Page 244
imIrlY – Visual Basic
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:
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.
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. You must install a protocol handler to use this function.
3-78
Page 245
imIrlY – Visual Basic
3
The receive buffers are cleared whenever the protocol is turned ON or OFF. To change the termination character (or to not change the setting at all), use imNewTermChar or imNoChange instead of toggling the protocol. 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, imIrlV, imSetDisplayMode, imSetInputMode
Example ’**************** imIrlY *************************** ’ $INCLUDE: ’im20vbas.bi’ CONST bufsize = 300 DIM inString AS STRING * bufsize DIM comString AS STRING * bufsize CLS
’ Clear the screen imSetInputMode(imProgrammer) ImLinkCom% = imLinkComm(imCom1, VARPTR(comString),VARSEG(comString), LEN(str)) TimeOut = 10000 ’ Set timeout to 10 seconds
’ eomChar$ = CHR$(0) ’ No termination character eomChar$ = CHR$(13) ’ Termination character is CR PRINT "Send Data>>";
’ status% = imIrlY(TimeOut, imCom1, SSEGADD(eomChar$), imProtocolOn, VARPTR(inString), , VARSEG(inString), VARPTR(cmdCount%), VARSEG(cmdCount%)) status% = imIrlY(TimeOut, imCom1, SSEGADD(eomChar$), imProtocolOff, VARPTR(inString), , VARSEG(inString), VARPTR(cmdCount%), VARSEG(cmdCount%))
’ ’ ’ ’
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%) ImLinkCom% = imUnlinkComm(imCom1) imSetInputMode(imWedge)
END
3-79
Page 246
imLinkComm – Visual Basic imLinkComm Purpose:
This function establishes a link between the Reader Wedge function and a designated communications port. The following figure lists the different modes and the functions to use when linked or unlinked.
Linking Specific Modes and Functions imDesktop imDesktop imWedge or or
(do not link)
imProgrammer imProgrammer
(not linked)
(linked, protocol handler loaded)
Key imReceiveInput Standard Input Functions (i.e., INSTR$, INKEY$, etc.)
Label
Key Label
Source = imKeyboardSelect Source = imLabelSelect imReceiveInput Key Label COM
With a protocol handler loaded (to use Intermec protocols) COM imReceiveBuffer (etc.)
COM
COM
Standard Receive Functions (i.e., INT 14H, _BIOS_SERIALCOM) Standard Transmit Functions (i.e., INT 14H, _BIOS_SERIALCOM)
Source = imComxSelect imReceiveBuffer (etc.) imTransmitBuffer (etc.)
COM
Without a protocol handler loaded COM
Source = imLabelSelect
With a protocol handler loaded (to use Intermec protocols)
imTransmitBuffer (etc.) COM
Source = imKeyboardSelect
COM imTransmitBuffer (etc.)
Without a protocol handler loaded COM
COM
Standard Receive Functions (i.e., INT 14H, _BIOS_SERIALCOM) Standard Transmit Functions (i.e., INT 14H, _BIOS_SERIALCOM)
AIT-43
Syntax:
3-80
REM $INCLUDE: ’im20vbas.bi’ FUNCTION ImLinkComm% (PortID, VARPTR(Buffer),VARSEG(Buffer), BufferSize)
Page 247
imLinkComm – Visual Basic
IN Parameters:
3
The PortID parameter identifies the communications port as follows: imCom1 imCom2 imCom4
COM1 COM2, scanner port (2010 and 2050) COM4 (RF only)
The Buffer parameter is a pointer to a memory area used by the Reader Wedge. Your application should not use this buffer. The BufferSize parameter is the number of bytes to allocate for the buffer array (suggested size is 300 bytes). OUT Parameters:
None.
Return Value:
This function returns one of the standard status codes defined in Appendix A, “Status Codes.”
Notes:
Use this function if you want to receive data with the Reader Wedge input function imIrlY or use the communications port with imReceiveInput and imIrlV. This function needs to be called only once. You must unlink at the end of your application. You must install a protocol handler 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.
See Also:
imUnlinkComm, imReceiveInput, imIrlV, imIrlY
Example See example for imReceiveInput, imIrlY, and imSerialProtocolControl.
3-81
Page 248
imMessage – Visual Basic imMessage Purpose:
This function displays the error message associated with a specific status code returned by an Intermec function. These status codes are listed in Appendix A. Use this function to display additional information about status codes during application development.
Syntax:
REM $INCLUDE: 'im20vbas.bi' SUB imMessage%(StatusCode )
IN Parameters:
The StatusCode parameter is a standard status code returned from various PSK functions.
OUT Parameters:
None.
Return Value:
None.
Notes:
The status message is displayed at the current cursor location without any formatting.
Example '**************** imMessage ************************ ' $INCLUDE: 'im20vbas.bi' CLS ' Clear the screen str1$ = "$+DJ3" PRINT "Set normal contrast" status% = imCommand(SSEGADD(str1$), LEN(str1$)) PRINT "Command status >>";HEX$(status%) imMessage(status%) END
3-82
Page 249
imNumberPadOff – Visual Basic
3 imNumberPadOff Purpose:
This function disables the number pad feature. When the number pad is disabled, the numeric keys function the same as the 1 through + keys above the “QWERTY” keys on a normal PC keyboard. When the number pad is disabled, you cannot type characters from the extended ASCII character set or use the number pad to move the cursor. For more information, refer to your JANUS user’s manual.
Syntax:
REM $INCLUDE: 'im20vbas.bi' FUNCTION imNumberPadOff%()
IN Parameters:
None.
OUT Parameters:
None.
Return Value:
This function returns one of the standard status codes defined in Appendix A, “Status Codes.”
See Also:
imNumberPadOn
Example '**************** imNumberPadOff ******************* REM $INCLUDE: 'im20vbas.bi' ' Initializing Variables NumberPadTest$ = "" Temp$ = "" CLS status% = imNumberPadOff PRINT PRINT "Test number pad off" PRINT "<ENTER> when done: " INPUT NumberPadTest$ PRINT PRINT "Press any key to quit." INPUT Temp$ END
3-83
Page 250
imNumberPadOn – Visual Basic imNumberPadOn Purpose:
This function enables the reader’s number pad. When enabled, the number pad functions the same way as the 10-key number pad on a standard PC keyboard. The numeric keys then provide cursor movement and editing keys, numbers, and access to the extended ASCII character set. When you enable the number pad, you also turn the Num Lock key off or on. When Num Lock is on, the number pad keys produce only numbers or extended ASCII characters with the same scan codes as the numeric keypad on a PC. The numeric keys always generate the same ASCII characters for numbers, but the scan codes depend on the status of the number pad and Num Lock. When Num Lock is off, the number pad keys move the cursor (Home) or edit text (Del). Refer to your JANUS user’s manual for more information on the number pad.
Syntax:
REM $INCLUDE: 'im20vbas.bi' FUNCTION imNumberPadOn%(NumLock)
IN Parameters:
The NumLock parameter indicates whether the Num Lock key is ON or OFF. Use one of these constants: imNumlockOn imNumlockOff
Enable the number pad with Num Lock ON Disable the number pad with Num Lock OFF
OUT Parameters:
None.
Return Value:
This function returns one of the standard status codes defined in Appendix A, “Status Codes.”
See Also:
imNumberPadOff
3-84