The text of a manual · part 11 of 37
JANUS PSK for Basic, Version 2.1 Reference Manual, pages 101 to 110
Pages 101 to 110 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 101
imIrlY – QuickBasic
2
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: ’im20bas1.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), bufsize) 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, SADD(eomChar$), imProtocolOn, VARPTR(inString), cmdCount%) status% = imIrlY(TimeOut, imCom1, SADD(eomChar$), imProtocolOff, VARPTR(inString), 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
2-75
Page 102
imLinkComm – QuickBasic 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
IM_DESKTOP
IM_DESKTOP
IM_WEDGE or or
(do not link)
IM_PROGRAMMER
IM_PROGRAMMER
(not linked)
(linked, protocol handler loaded)
Key im_receive_input Standard Input Functions (i.e., KBHIT, GETCH, etc.)
Label
Key Label
Source = IM_KEYBOARD_SELECT Source = IM_LABEL_SELECT im_receive_input Key Label COM
With a protocol handler loaded (to use Intermec protocols) COM im_receive_buffer (etc.)
COM
COM
Standard Receive Functions (i.e., INT 14H, _BIOS_SERIALCOM) Standard Transmit Functions (i.e., INT 14H, _BIOS_SERIALCOM)
Source = IM_COMx_SELECT im_receive_buffer (etc.) im_transmit_buffer (etc.)
COM
Without a protocol handler loaded COM
Source = IM_LABEL_SELECT
With a protocol handler loaded (to use Intermec protocols)
im_transmit_buffer (etc.) COM
Source = IM_KEYBOARD_SELECT
COM im_transmit_buffer (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-24
Syntax:
2-76
REM $INCLUDE: ’im20bas1.bi’ FUNCTION ImLinkComm% CDECL (BYVAL PortID AS INTEGER, BYVAL Buffer AS INTEGER, BYVAL BufferSize AS INTEGER)
Page 103
imLinkComm – QuickBasic
IN Parameters:
2
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 (maximum 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.
2-77
Page 104
imMessage – QuickBasic 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: 'im20bas1.bi' SUB imMessage% CDECL (BYVAL StatusCode AS INTEGER)
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: 'im20bas1.bi' CLS ' Clear the screen str1$ = "$+DJ3" PRINT "Set normal contrast" status% = imCommand(SADD(str1$), LEN(str1$)) PRINT "Command status >>";HEX$(status%) imMessage(status%) END
2-78
Page 105
imNumberPadOff – QuickBasic
2 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: 'im20bas1.bi' FUNCTION imNumberPadOff% CDECL ()
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: 'im20bas1.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
2-79
Page 106
imNumberPadOn – QuickBasic 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: 'im20bas1.bi' FUNCTION imNumberPadOn% CDECL (BYVAL NumLock AS INTEGER)
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
2-80
Page 107
imNumberPadOn – QuickBasic
2
Example '**************** imNumberPadOn ******************** REM $INCLUDE: 'im20bas1.bi' ' Initializing Variables NumberPadTest$ = "" Temp$ = "" CLS status% = imNumberPadOn(imNumlockOff) PRINT "numpad enable NL OFF" PRINT "<ENTER> when done: " INPUT NumberPadTest$ PRINT status% = imNumberPadOn(imNumlockOn) PRINT PRINT "numpd enable NL ON" PRINT "<ENTER> when done: " INPUT NumberPadTest$ PRINT PRINT "Press any key to quit." INPUT Temp$ END
2-81
Page 108
imPowerStatus – QuickBasic imPowerStatus Purpose:
This function returns the line status, battery status, backup status, and percentage of remaining battery life.
Syntax:
REM $INCLUDE: 'im20bas1.bi' FUNCTION imPowerStatus% CDECL (LineStatus AS INTEGER, BatteryStatus AS INTEGER, BackupStatus AS INTEGER, FuelGauge AS INTEGER)
IN Parameters:
None.
OUT Parameters:
The LineStatus parameter returns one of these constants: imAclineNotConnected imAclineConnected imUnknownAcline
AC line is not connected AC line is connected AC line status is unknown
The BatteryStatus parameter returns one of these constants: imHighBat imLowBat imCriticalBat imChargingBat imUnknownBat
Battery charge is high Battery charge is low Battery charge is critical Battery is charging now Battery condition is unknown
The BackupStatus parameter returns one of these constants: imBackupOk imBackupLow
Backup battery is OK Backup battery is low
The FuelGauge parameter returns one of these constants: 0–100 255 Return Value:
2-82
% of full charge in increments of 10% Unknown
This function returns one of the standard status codes defined in Appendix A, “Status Codes.”
Page 109
imPowerStatus – QuickBasic
2
Example '**************** imPowerStatus ******************** REM $INCLUDE: 'im20bas1.bi' PRINT "imPowerStatus" acLine% = -1 battery% = -1 backup% = -1 fuel% = -1 status% = -1 status% = imPowerStatus(acLine%, battery%, backup%, fuel%) PRINT "ACLine = ", HEX$(acLine%) PRINT "battery = ", HEX$(battery%) PRINT "backup = ", HEX$(backup%) PRINT "fuel = ", HEX$(fuel%) PRINT "status = ", HEX$(status%) END
2-83
Page 110
imProtocolExtendedStatus – QuickBasic imProtocolExtendedStatus Purpose:
This function gets the protocol extended status from the designated communications port. You allocate the protocol status buffer or radio frequency (RF) status buffer, and then imProtocolExtendedStatus returns the status and setup in hexadecimal values.
Syntax:
REM $INCLUDE: 'im20bas1.bi' FUNCTION imProtocolExtendedStatus% CDECL (BYVAL PortID AS INTEGER, SEG StatusBuffer AS imCommStatusBufferS)
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 StatusBuffer parameter is a far pointer to a buffer structure. Use one of these constants: imCommStatusBufferS (as shown in the syntax above) imCommStatusBufferRF OUT Parameters:
None.
Return Value:
This function returns one of the standard status codes defined in Appendix A, “Status Codes.”
See Also:
imReceiveBufferNoWait, imTransmitBufferNoWait
2-84