The text of a manual · part 28 of 37
JANUS PSK for Basic, Version 2.1 Reference Manual, pages 271 to 280
Pages 271 to 280 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 271
imRsInstalled – Visual Basic
3 imRsInstalled Purpose:
This function determines whether or not the reader services (RSERVICE.EXE) program is installed.
Syntax:
REM $INCLUDE: 'im20vbas.bi' FUNCTION imRsInstalled%()
IN Parameters:
None.
OUT Parameters:
None.
Return Value:
This function returns one of the standard status codes defined in Appendix A, “Status Codes.”
Example '**************** imRsInstalled ******************** REM $INCLUDE: 'im20vbas.bi' ' Call the Intermec function status% = imRsInstalled PRINT "status = ", HEX$(status%) IF status% = imRsAllSuccess THEN PRINT "Rservice installed ELSE PRINT "Rservice not installed" END IF END
3-105
Page 272
imRxCheckStatus – Visual Basic imRxCheckStatus Purpose:
This function directs the active protocol handler to check the communications port buffer status variable to determine if the application program has accepted the previous data. Use this function with the imReceiveBufferNoWait function to receive multiple buffers.
Syntax:
REM $INCLUDE: 'im20vbas.bi' FUNCTION imRxCheckStatus%(PortID)
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.”
Notes:
You must install a protocol handler to use this function.
See Also:
imReceiveBufferNoWait
Example See example for imReceiveBufferNoWait.
3-106
Page 273
imSerialProtocolControl – Visual Basic
3 imSerialProtocolControl Purpose:
This function controls the protocol mode for a designated communications port and determines whether the receive mode is with or without protocol according to the input parameter. Any change clears the input buffer and resets the reader command parser. Use this function to set protocol when connected to a communications port. The return value indicates a success if the port is currently linked to the Virtual Wedge. If the port is not currently linked to the Virtual Wedge, the function returns an error.
Syntax:
REM $INCLUDE: 'im20vbas.bi' FUNCTION imSerialProtocolControl% (PortID, ProtocolSwitch, EomChar)
IN Parameters:
The PortID parameter identifies the communications port as follows: imCom1 imCom2 imCom4
COM1 COM2, scanner port (2010 and 2050) COM4 (RF only)
The ProtocolSwitch parameter affects how incoming messages are received and 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 ProtocolSwitch affects all incoming messages as follows: • 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 message 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.
3-107
Page 274
imSerialProtocolControl – Visual Basic
• 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. 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. OUT Parameters:
None.
Return Value:
This function returns one of the standard status codes defined in Appendix A, “Status Codes.”
Notes:
Requires imLinkComm. 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.
See Also:
3-108 imLinkComm
Page 275
imSerialProtocolControl – Visual Basic
3
Example '**************** imSerialProtocolControl ********** REM $INCLUDE: 'im20vbas.bi' CLS DIM linkBuffer AS STRING * 300 DIM inputBuffer AS STRING * 300 DIM eomChar eomChar = 13 timeout% = 10000 source% = 0 linkBuffer = STRING$(300, CHR$(0)) inputBuffer = STRING$(300, CHR$(0)) CALL imSetInputMode(imProgrammer) status% = imLinkComm(imCom1, VARPTR(linkBuffer), LEN(linkBuffer)) ' Turn on the protocol status% = imSerialProtocolControl(imCom1, imProtocolOn, eomChar) ' Get data from com 1 PRINT "Waiting for data" WHILE source% <> 1 inputBuffer = STRING$(300, CHR$(0)) status% = imReceiveInput(imCom1Select, timeout%, source%, VARPTR(inputBuffer)) WEND PRINT "Message is:" PRINT inputBuffer status% = imUnLinkComm(imCom1) CALL imSetInputMode(imWedge) PRINT "Press any key" temp$ = INPUT$(1) END
3-109
Page 276
imSetContrast – Visual Basic imSetContrast Purpose:
This function sets the reader’s LCD display contrast level. There are eight levels of contrast (0 to 7) from very light to very dark, which are the most frequently used contrast settings.
Syntax:
REM $INCLUDE: 'im20vbas.bi' FUNCTION imSetContrast%(DisplayContrastLevel)
IN Parameters:
The DisplayContrastLevel parameter is one of these constants: imMinContrast imAveContrast imMaxContrast
Level 0 Level 4 Level 7
OUT Parameters:
None.
Return Value:
This function returns one of the standard status codes defined in Appendix A, “Status Codes.”
Notes:
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
This function has no effect on the JANUS 2050. See Also:
3-110 imGetContrast, imDecreaseContrast, imIncreaseContrast
Very dark
Page 277
imSetContrast – Visual Basic
3
Example '**************** imSetContrast ******************** REM $INCLUDE: 'im20vbas.bi' ' Set contrast ' Prompt for contrast level to set PRINT "Enter Contrast(0-7)" INPUT "Level = ", level% status% = imSetContrast (level%) PRINT "Set Contrast status =", HEX$(status%) END
3-111
Page 278
imSetControlKey – Visual Basic imSetControlKey Purpose:
This function enables or disables the Ctrl key setting. When disabled, none of the key combinations that use the Ctrl key work. For example, the warm boot key sequence Ctrl-Alt-Del will not work.
Syntax:
REM $INCLUDE: 'im20vbas.bi' FUNCTION imSetControlKey%(ControlKey)
IN Parameters:
The ControlKey parameter is one of these constants: imEnable imDisable
Enable the Ctrl key Disable the Ctrl key
OUT Parameters:
None.
Return Value:
This function returns one of the standard status codes defined in Appendix A, “Status Codes.”
See Also:
imGetControlKey
Example See example for imGetControlKey.
3-112
Page 279
imSetDisplayMode – Visual Basic
3 imSetDisplayMode Purpose:
This function sets the size mode, video mode, scroll mode, and character height of the display.
Syntax:
REM $INCLUDE: 'im20vbas.bi' FUNCTION imSetDisplayMode% ( SizeMode, VideoMode, ScrollMode, CharHt )
IN Parameters:
The SizeMode parameter is required and is one of these constants: imSizeMode80X25 imSizeMode40X25 imSizeMode 20X16 imSizeMode 20X8 imSizeMode 10X16 imSizeMode 10X8
80 x 25 text mode 40 x 25 text mode (2010 and 2020) 20 x 16 text mode (2010 and 2020) 20 x 8 text mode (2010 and 2020) 10 x 16 text mode (2010 and 2020) 10 x 8 text mode (2010 and 2020)
If imSizeMode80X25 is set, you also need to set the video mode, scroll mode, and character height. If any other SizeMode is set, the video mode, scroll mode, and character height are automatically set. The VideoMode parameter requires imSizeMode80X25. The standard PC BIOS supports up to video mode 13H. The reader only supports up to video mode 6. You can also set video modes 0 through 3 with IC.EXE. The VideoMode parameter is one of these constants: imStdVideoMode0 imStdVideoMode1 imStdVideoMode2 imStdVideoMode3 imStdVideoMode4 imStdVideoMode5 imStdVideoMode6
40 x 25 (use for double-wide characters) 40 x 25 (use for double-wide characters) 80 x 25 80 x 25 300 x 200 2-color 300 x 200 monochrome 640 x 200 2-color (2050)
3-113
Page 280
imSetDisplayMode – Visual Basic
The ScrollMode requires imSizeMode80X25 and is one of these constants: imLcdScrollAt25 imLcdScrollAt16 imLcdScrollAt13 imLcdScrollAt8 imMaxScrollMode
Scroll at line 25 Scroll at line 16 (2010 and 2020) Scroll at line 13 (2050 and double-height) Scroll at line 8 (2010 and 2020) Maximum number of scroll lines
The CharHt parameter requires imSizeMode80X25 and is one of these constants: imStandardCharHeight
Standard-height characters, applies to all scroll modes except line 8 and line 13 imDoubleCharHeight
Double-height characters, applies only to scroll at line 8 and line 13
OUT Parameters:
None.
Return Value:
This function returns one of the standard status codes defined in Appendix A, “Status Codes.”
Notes:
Changing display modes clears the screen. The IRL input commands do not display correctly when the display is in 80 x 25 mode and the cursor has scrolled off the display. To alleviate this problem, set the display mode to one of the other modes, such as 20 x 16. The mode does not change if there are conflicting parameters, such as trying to set the VideoMode to 16 lines and the ScrollMode at line 8. If you want to use one of the graphics modes, use the appropriate function call provided by your programming language. 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:
3-114 imGetDisplayMode, imSetFollowCursor