The text of a manual · part 12 of 25
JANUS PSK for Ada Reference Manual, pages 111 to 120
Pages 111 to 120 of 250
The original document is the PDF (415 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 111
im_issuccess
3 im_issuccess Purpose:
This macro determines if the return status code from another PSK function is either a success or warning.
Syntax:
With System, Text_IO, Intrmecd_IO, Intrmecp_IO; Use System, Text_IO, Intrmecd_IO, Intrmecp_IO; function im_issuccess( status :System.Word ) return Boolean;
IN Parameters:
The status parameter is any PSK function that returns a status code.
OUT Parameters:
None.
Return Value:
0 nonzero
See Also:
“Status Code Macros” in Chapter 2, “Working With Ada,” im_iserror, im_isgood, im_iswarn
Indicates an error (either fatal or nonfatal) Indicates success or warning
Example With System, Text_IO, Intrmecd_IO, Intrmecp_IO; Use System, Text_IO, Intrmecd_IO, Intrmecp_IO; procedure ex_issuccess is status : System.Word; begin status := im_sound(IM_LOW_PITCH, IM_BEEP_DURATION, IM_NORMAL_VOLUME); if im_issuccess(status) then Put_Line('Beep success or warning!'); else Put_Line('Beep error!'); end if; New_Line; end ex_issuccess;
3-71
Page 112
im_iswarn im_iswarn Purpose:
This macro determines if the return status code from another PSK function is a warning.
Syntax:
With System, Text_IO, Intrmecd_IO, Intrmecp_IO; Use System, Text_IO, Intrmecd_IO, Intrmecp_IO; function im_iswarn( status :System.Word ) return Boolean;
IN Parameters:
The status parameter is any PSK function that returns a status code.
OUT Parameters:
None.
Return Value:
0 nonzero
See Also:
“Status Code Macros” in Chapter 2, “Working With Ada,” im_iserror, im_isgood, im_issuccess
Indicates success or an error (either fatal or nonfatal) Indicates a warning
Example With System, Text_IO, Intrmecd_IO, Intrmecp_IO; Use System, Text_IO, Intrmecd_IO, Intrmecp_IO; procedure ex_iswarn is status : System.Word; begin status := im_sound(IM_LOW_PITCH, IM_BEEP_DURATION, IM_NORMAL_VOLUME); if im_iswarn(status) then Put_Line('Beep warning!'); else Put_Line('Beep success or error!'); end if; New_Line; end ex_iswarn;
3-72
Page 113
im_link_comm
3 im_link_comm 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. Note: Programmer mode and Desktop mode differ in how they handle keyboard inputs. In Programmer mode, the Enter key terminates keyboard input. In Desktop mode, keyboard entry terminates when you press each key.
Linking Specific Modes and Functions
IM_DESKTOP or or
(do not link)
IM_PROGRAMMER
IM_PROGRAMMER
(not linked)
(linked, protocol handler loaded)
Key Label
IM_DESKTOP
IM_WEDGE im_receive_input Standard Input Functions (i.e., TEXT_IO.Get)
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
Standard Transmit Functions
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
Standard Transmit Functions
AIT-27
3-73
Page 114
im_link_comm
Syntax:
With Intrmecd_IO, Intrmecp_IO; Use Intrmecd_IO, Intrmecp_IO; function im_link_comm ( port : In IM_COM_PORT, buffer_ptr : In System.Address; buffer_size : In System.Word; ) return System.Word;
IN Parameter:
The port parameter is one of the following constants: IM_COM1 IM_COM2 IM_COM4
COM1 COM2, scanner (2010 and 2050) COM4 (RF only)
The buffer_ptr parameter is a pointer to a memory area used by the Reader Wedge. Your application should not use this buffer. The buffer_size parameter is the actual number of bytes allocated in the buffer parameter (suggested size is 300 bytes). OUT Parameter:
None.
Return Value:
This function returns one of the standard status codes listed in Appendix A, “Status Codes.”
Notes:
You must install a protocol handler to use this function. You must install the Reader Wedge to use this function. For information, see “Runtime Requirements” in Chapter 2, “Working With Ada.” Use this function if you want to receive data with im_irl_y or to use the communications port with im_receive_input and im_irl_v. Your program only needs to call this function once, and you must unlink at the end of your application using im_unlink_comm.
See Also:
im_unlink_comm, im_receive_input, im_irl_v, im_irl_y, im_serial_protocol_control
Example See example for im_irl_y.
3-74
Page 115
im_message
3 im_message This procedure displays the error message associated with a specific status code returned by an Intermec function or procedure.
Purpose:
Use this procedure to display additional information about status codes during application development. Syntax:
With Intrmecd_IO, Intrmecp_IO; Use Intrmecd_IO, Intrmecp_IO; procedure im_message (status_code : IN System.Word);
IN Parameter:
The status_code parameter is one of the standard status codes listed in Appendix A, “Status Codes.”
OUT Parameter:
None.
Return Value:
None.
Notes:
The status message is displayed at the current cursor location without any formatting.
Example With System, Text_IO, Intrmecd_IO, Intrmecp_IO; Use System, Text_IO, Intrmecd_IO, Intrmecp_IO; procedure message Is status
: System.Word;
begin status := im_sound(IM_LOW_PITCH, IM_BEEP_DURATION, IM_NORMAL_VOLUME); if im_isgood(status) then Put_Line('Beep successful!'); else Put('Beep error: '); im_message(status); New_Line; end if; New_Line; end message;
3-75
Page 116
im_number_pad_off im_number_pad_off Purpose:
This function disables the number pad feature. When 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 guide.
Syntax:
With Intrmecd_IO, Intrmecp_IO; Use Intrmecd_IO, Intrmecp_IO; function im_number_pad_off return System.Word;
IN Parameters:
None.
OUT Parameters:
None.
Return Value:
This function returns one of the standard status codes listed in Appendix A, “Status Codes.”
See Also:
im_number_pad_on
3-76
Page 117
im_number_pad_off
3
Example With System, Bit, Text_IO, Intrmecd_IO, Intrmecp_IO; Use System, Bit, Text_IO, Intrmecd_IO, Intrmecp_IO; procedure numpadof Is package SYSWORD_IO is new INTEGER_IO (System.Word); status : System.Word; in_char : Character := ' '; begin status := im_number_pad_off; if not(Tstbit(status, 15)) then Put_line ("Number pad disable"); Put_Line ("q to quit"); loop exit when in_char = 'q'; Get (in_char); end loop; else Put ("Nmbr Pad Off error = "); SYSWORD_IO.Put (status, WIDTH => 8); New_Line; end if; end numpadof;
3-77
Page 118
im_number_pad_on im_number_pad_on 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 number lock (Num Lock) 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:
With Intrmecd_IO, Intrmecp_IO; Use Intrmecd_IO, Intrmecp_IO; function im_number_pad_on ( numlock : IN IM_NUMBER_LOCK ) return System.Word;
IN Parameter:
The numlock parameter passed to this function indicates whether the Num Lock key is on or off, using one of the following constants: IM_NUMLOCK_ON IM_NUMLOCK_OFF
Enable the number pad with Num Lock on Enable the number pad with Num Lock off
OUT Parameter:
None.
Return Value:
This function returns one of the standard status codes listed in Appendix A, “Status Codes.”
See Also:
im_number_pad_off
3-78
Page 119
im_number_pad_on
3
Example With System, Text_IO, Intrmecd_IO, Intrmecp_IO; Use System, Text_IO, Intrmecd_IO, Intrmecp_IO; procedure numpadon Is status : System.Word; in_char : Character := ' '; begin Put_Line ("Turn numlock ON/OFF"); -- IM_NUMLOCK_ON : Number pad enable with Numlock ON status := im_number_pad_on (IM_NUMLOCK_ON); Put_Line ("NP enable NL ON"); Put_Line ("q to quit"); loop exit when in_char = 'q'; Get (in_char); end loop; New_Line; in_char := ' '; -- IM_NUMLOCK_OFF : Number pad enable with Numlock OFF status := im_number_pad_on (IM_NUMLOCK_OFF); Put_Line ("NP enable NL OFF"); Put_Line ("q to quit"); loop exit when in_char = 'q'; Get (in_char); end loop; end numpadon;
3-79
Page 120
im_power_status im_power_status Purpose:
This procedure retrieves the line status, battery status, backup status, and the percentage of remaining battery life.
Syntax:
With Intrmecd_IO, Intrmecp_IO; Use Intrmecd_IO, Intrmecp_IO; procedure im_power_status ( line_status : OUT IM_LINE_STATUS; battery_status : OUT IM_BATTERY_STATUS; backup_status : OUT IM_BACKUP_STATUS; fuel_gauge : OUT System.Byte; status_code : OUT System.Word );
IN Parameter:
None.
OUT Parameter:
The line_status parameter is one of the following constants: IM_ACline_NOT_CONNECTED IM_ACline_CONNECTED IM_UNKNOWN_ACline
AC line is not connected AC line is connected Unknown AC line
The battery_status parameter is one of the following constants: IM_HIGH_BAT IM_LOW_BAT IM_CRITICAL_BAT IM_CHARGING_BAT IM_UNKNOWN_BAT
Battery charge is high Battery charge is low Battery charge is in critical Charging battery now Unknown battery
The backup_status parameter is one of the following constants: IM_BACKUP_OK IM_BACKUP_LOW
Backup battery OK Backup battery low
The fuel_gauge parameter retrieves one of the following values in increments of 10%: 0 to 100 255
3-80
% of full charge Unknown