The text of a manual · part 15 of 37
JANUS PSK for Basic, Version 2.1 Reference Manual, pages 141 to 150
Pages 141 to 150 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 141
imSetInputMode – QuickBasic
2
Programmer Mode Inputs are echoed to the screen. Reader commands are executed as well as saved. Use this mode when the reader is executing IRL commands. In general, when you are running an application that uses the function libraries or software interrupts, the reader should be in programmer mode. Desktop Mode The application is responsible for retrieving and displaying input. Use this mode when you need detailed information about a pressed key. Each character returned consists of four bytes: the ASCII code, scan code, and two bytes of keyboard flags (Shift, Ctrl, Alt). Upon exiting the program, set the input mode to imWedge so that DOS will work as expected. For more information about reader input modes, see Chapter 3, “Advanced Programming,” in the JANUS PSK for C/C++ Reference Manual. See Also:
imGetInputMode, imReceiveInput
Example See example for imGetInputMode and imReceiveInput.
2-115
Page 142
imSetKeyclick – QuickBasic imSetKeyclick Purpose:
Each time you press a key, the reader can emit a click. This function enables or disables the keyclick.
Syntax:
REM $INCLUDE: 'im20bas1.bi' FUNCTION imSetKeyclick% CDECL (BYVAL KeyClick AS INTEGER)
IN Parameters:
The KeyClick parameter is one of these constants: imEnable imDisable
Enable the keyclick Disable the keyclick
OUT Parameters:
None.
Return Value:
This function returns one of the standard status codes defined in Appendix A, “Status Codes.”
See Also:
imGetKeyclick
Example See example for imGetKeyclick.
2-116
Page 143
imSetViewportLock – QuickBasic
2 imSetViewportLock Purpose:
This function enables or disables the keys that move the viewport.
Syntax:
REM $INCLUDE: 'im20bas1.bi' FUNCTION imSetViewportLock% CDECL (BYVAL VpLock AS INTEGER)
IN Parameters:
The VpLock parameter is one of these constants: imEnable imDisable
Lock the viewport Unlock the viewport
OUT Parameters:
None.
Return Value:
This function returns one of the standard status codes defined in Appendix A, “Status Codes.”
Notes:
The display must be in 80 x 25 mode for this function to work correctly. This function controls whether the viewport moves (unlocked) or does not move (locked) when the viewport movement keys are pressed. This function has no effect on the JANUS 2050.
See Also:
imGetViewportLock, imSetFollowCursor
Example See example for imGetViewportLock.
2-117
Page 144
imSetWarmBoot – QuickBasic imSetWarmBoot Purpose:
This function enables or disables the Ctrl-Alt-Del warm boot key sequence. When disabled, the Ctrl-Alt-Del key sequence does not reboot the reader.
Syntax:
REM $INCLUDE: 'im20bas1.bi' FUNCTION imSetWarmBoot% CDECL (BYVAL WarmBoot AS INTEGER)
IN Parameters:
The WarmBoot parameter is one of these constants: imEnable imDisable
Enable Ctrl-Alt-Del warm boot Disable Ctrl-Alt-Del warm boot
OUT Parameters:
None.
Return Value:
This function returns one of the standard status codes defined in Appendix A, “Status Codes.”
See Also:
imGetWarmBoot
Example '**************** imSetWarmBoot ******************** REM $INCLUDE: 'im20bas1.bi' status% = imSetWarmBoot(imDisable) PRINT "Disabling <BOOT>" status% = imGetWarmBoot(ctrlKey%) IF ctrlKey% = imEnable THEN PRINT "<BOOT> enabled" ELSE PRINT "<BOOT> disabled" END IF INPUT "Test it1>>",response$ status% = imSetWarmBoot(imEnable) PRINT "Enabling <BOOT>" INPUT "Test it1>>",response$ END
2-118
Page 145
imSound – QuickBasic
2 imSound Purpose:
This function generates a beep of specified pitch and duration. For example, use a soft beep for library use, a loud beep for manufacturing use, or a unique beep to distinguish between other readers.
Syntax:
REM $INCLUDE: 'im20bas1.bi' FUNCTION imSound% CDECL (BYVAL Pitch AS INTEGER, BYVAL Duration AS INTEGER, BYVAL Volume AS INTEGER)
IN Parameters:
The Pitch parameter is the frequency of the beep you want the reader to make. The numeric range for Pitch is from 20 to 20,000 Hz. You can also use one of these constants: imHighPitch imLowPitch imVeryLowPitch
2400 Hz 1200 Hz 600 Hz
The Duration parameter is the length of the beep. The numeric range for Duration is from 1 to 65,000 ms. You can also use one of these constants: imBeepDuration imClickDuration
50 ms 4 ms
The Volume parameter is one of these constants: imOffVolume imQuietVolume imNormalVolume imLoudVolume imExtraLoudVolume imCurrentVolume
Volume is off Volume is quiet Volume is normal Volume is loud Volume is extra loud Volume is the current volume
OUT Parameters:
None.
Return Value:
This function returns one of the standard status codes defined in Appendix A, “Status Codes.”
2-119
Page 146
imSound – QuickBasic
Example '**************** imSound ************************** REM $INCLUDE: 'im20bas1.bi' RESTORE duration% = 0 pitch% = -1 volume% = imCurrentVolume ' Play a song ' Read data and play song until end of data DO WHILE pitch% <> 0 'Read in pitch and duration READ pitch%, duration% ' Call the Intermec function status% = imSound(pitch%, duration%, volume%) LOOP PRINT "status = ", HEX$(status%) ' Sound data DATA 523, 500, 392, 500, 440, 500, 330, 500, 349, 500, 330, 250 DATA 296, 250, 262, 1000, 0 ,0 ' Enumeration of notes and frequencies ' C0 = 262, D0 = 296, E0 = 330, F0 = 349, G0 = 392, A0 = 440, B0 = 494, ' C1 = 523, D1 = 587, E1 = 659, F1 = 698, G1 = 784, A1 = 880, B1 = 988, ' EIGHTH = 125, QUARTER = 250, HALF = 500, WHOLE = 1000, END = 0 ' Above sound DATA ' C1, HALF, G0, HALF, A0, HALF, E0, HALF, F0, HALF, E0, QUARTER, ' D0, QUARTER, C0, WHOLE, END END
2-120
Page 147
imStandbyWait – QuickBasic
2 imStandbyWait Purpose:
This function requests that reader services wait in standby mode for a specific period of time. You can use this function to suspend the reader for a length of time to save the battery power.
Syntax:
REM $INCLUDE: 'im20bas1.bi' FUNCTION ImStandbyWait% CDECL (BYVAL Timeout AS LONG)
IN Parameters:
The Timeout parameter is the amount of time to wait in standby mode. 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 you select imInfiniteTimeout, the function will not return until the end of message character has been received. OUT Parameters:
None.
Return Value:
This function returns one of the standard status codes defined in Appendix A, “Status Codes.”
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:
None.
Example See example for imCommand.
2-121
Page 148
imTransmitBuffer – QuickBasic imTransmitBuffer Purpose:
This function transmits the contents of a data buffer through a designated communications port. This function continues operating until the buffer transmission is complete or until an error status is detected.
Syntax:
REM $INCLUDE: 'im20bas1.bi' FUNCTION imTransmitBuffer% CDECL (BYVAL PortID AS INTEGER, BYVAL UserLength AS INTEGER, BYVAL DataBuffer AS INTEGER, BYVAL Timeout AS INTEGER)
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 UserLength parameter is the length of the data string that you want to transmit. The DataBuffer parameter is a far pointer to the data array that you want to transmit. The Timeout parameter is the transmission timeout period. You can exit the function before data is sent 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 you select imInfiniteTimeout, the function will not return until the end of message character has been received. OUT Parameters:
2-122
None.
Page 149
imTransmitBuffer – QuickBasic
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:
imReceiveBuffer, imTransmitBufferNoWait, imTransmitBufferNoprot
2
Example '**************** imTransmitBuffer ***************** ' Note: Must have reader services and comm protocol handler installed ' to enable send/receive buffer functions ' Run these TSR's at DOS prompt before running these tests: ' rservice ' phimec 1 ( 1 is COM1) REM $INCLUDE: 'im20bas1.bi' ' Must be run with Phimec protocol installed PRINT "imTransmitBuffer" outstr$ = "Hi There" ' Call Intermec function status% = imTransmitBuffer (imCom1, LEN(outstr$), SADD(outstr$), 1000) PRINT "com = ", imCom1 PRINT "str = ", outstr$ PRINT "len = ", LEN(outstr$) PRINT "status = ", HEX$(status%) END
2-123
Page 150
imTransmitBufferNoWait – QuickBasic imTransmitBufferNoWait Purpose:
This function transmits the contents of a buffer and passes control back to its client.
Syntax:
REM $INCLUDE: 'im20bas1.bi' FUNCTION imTransmitBufferNoWait% CDECL (BYVAL PortID AS INTEGER, SEG DataStruct AS imFarComDataStruct)
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 DataStruct parameter is a far pointer to the data array that you want to transmit. 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. This function differs from imTransmitBuffer in that the client must set the buffer structure and monitor the buffer status until transmission is complete. Use this function for multiple buffer transmissions in conjunction with checking the status in DataStruct. You must build and maintain a DataStruct of the type imFarComDataStruct as described in IM20BAS1.BI.
See Also:
2-124 imTransmitBufferNoprot, imCancelTxBuffer