The text of a manual · part 6 of 25
JANUS PSK for Ada Reference Manual, pages 51 to 60
Pages 51 to 60 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 51
im_cancel_rx_buffer
3 im_cancel_rx_buffer Purpose:
This function clears the receive buffer of the designated communications port.
Syntax:
With Intrmecd_IO, Intrmecp_IO; Use Intrmecd_IO, Intrmecp_IO; function im_cancel_rx_buffer ( port : IN IM_COM_PORT ) return System.Word;
IN Parameter:
The port_id parameter identifies the communications port as follows: IM_COM1 IM_COM2 IM_COM4
COM1 COM2, scanner port (2010 and 2050) COM4 (RF only)
OUT Parameter:
None.
Return Value:
This function returns one of the standard status codes listed in Appendix A, “Status Codes.” If there is no pending input to receive, this function returns 4602H (no client).
Notes:
You must install a protocol handler to use this function.
See Also:
im_receive_buffer_no_wait, im_receive_buffer_noprot
Example See example for im_receive_buffer.
3-11
Page 52
im_cancel_tx_buffer im_cancel_tx_buffer Purpose:
This function clears the contents of the transmit buffer, stops transmission in progress, and resets the communications port. Use this function with Polling Mode D to clear out the buffer. Other protocols clear the buffer automatically.
Syntax:
With Intrmecd_IO, Intrmecp_IO; Use Intrmecd_IO, Intrmecp_IO; function im_cancel_tx_buffer ( port : IN IM_COM_PORT ) return System.Word;
IN Parameter:
The port_id parameter identifies the communications port as follows: IM_COM1 IM_COM2 IM_COM4
Return Value:
COM1 COM2, scanner port (2010 and 2050) COM4 (RF only)
This function returns one of the standard status codes listed in Appendix A, “Status Codes.” If there are no pending transmissions to receive, this function returns 4602H (no client).
Notes:
You must install a protocol handler to use this function.
See also:
im_transmit_buffer_no_wait, im_transmit_buffer_noprot, im_transmit_buffer
Example See example for im_receive_buffer.
3-12
Page 53
im_command
3 im_command Purpose:
This function modifies the reader’s configuration. For example, you can use this function to set a specific communications port’s baud rate.
Syntax:
With Intrmecd_IO, Intrmecp_IO; Use Intrmecd_IO, Intrmecp_IO; function im_command ( command : IN String; command_length : IN System.Word ) return System.Word;
IN Parameter:
The command parameter is a reader command string. The command string may include more than one reader command. For example, the command string %.1$+BV9 turns on the backlight and raises the beep volume. Reader commands are listed in your JANUS user’s manual. The command_length parameter is the length of the reader command string.
OUT Parameter:
None.
Return Value:
This function returns one of the standard status codes listed in Appendix A, “Status Codes.”
Notes:
For more information on reader commands, refer to your JANUS user’s manual. You must install the Reader Wedge to use this function. For information on loading RWTSR.EXE, see “Runtime Requirements” in Chapter 2, “Working With Ada.”
3-13
Page 54
im_command
Example With System, Bit, Text_IO, Intrmecd_IO, Intrmecp_IO; Use System, Bit, Text_IO, Intrmecd_IO, Intrmecp_IO; procedure command Is status : System.Word; high_trast : String(1..5) := "$+DJ7"; low_trast : String(1..5) := "$+DJ0"; norm_trast : String(1..5) := "$+DJ3"; begin Put_Line ("Setting high contrast"); status := im_command (high_trast, high_trast'Length); status := im_standby_wait (5000); Put_Line ("Setting low contrast"); status := im_command (low_trast, low_trast'Length); status := im_standby_wait (5000); Put_Line ("Setting normal contrast"); status := im_command (norm_trast, norm_trast'Length); end command;
3-14
Page 55
im_cursor_to_viewport
3 im_cursor_to_viewport Purpose:
This function moves the cursor to the center of the current viewport. Since the viewport can move around with or without the cursor, you can use this function to recenter the cursor.
Syntax:
With Intrmecd_IO, Intrmecp_IO; Use Intrmecd_IO, Intrmecp_IO; procedure im_cursor_to_viewport;
IN Parameters:
None.
OUT Parameters:
None.
Return Value:
None.
Notes:
This function has no effect on the JANUS 2050.
See also:
im_viewport_end, im_viewport_home, im_viewport_page_down, im_viewport_page_up, im_viewport_to_cursor, im_viewport_move
Example With System, Bit, Text_IO, Intrmecd_IO, Intrmecp_IO; Use System, Bit, Text_IO, Intrmecd_IO, Intrmecp_IO; procedure crsrview Is package STATUS_IO is new INTEGER_IO (System.Word); row, col : System.Word; status : System.Word; begin im_viewport_move (IM_VIEWPORT_RIGHT, 15, row, col, status); im_cursor_to_viewport; status := im_standby_wait (5000); -- show that viewport moved STATUS_IO.Put (row); STATUS_IO.Put (col); New_Line; im_viewport_home; end crsrview;
3-15
Page 56
im_decrease_contrast im_decrease_contrast Purpose:
This function decreases the LCD display contrast by one level. The display contrast is the lightness or darkness of the characters against the reader display. The reader display has 32 levels of contrast (0 to 31).
Syntax:
With Intrmecd_IO, Intrmecp_IO; Use Intrmecd_IO, Intrmecp_IO; function im_decrease_contrast return System.Word;
Parameters:
None.
Return Value:
This function returns one of the standard status codes listed in Appendix A, “Status Codes.”
Notes:
The 0 to 31 scale fine-tunes the contrast more precisely than using the keypad to adjust the contrast. 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 shows the equivalent values for the 0 to 7 scale. Scale 0 to 7
Scale 0 to 31
Level
0 1 2 3 4 5 6 7
10 12 14 16 18 20 22 24
Very light
Very dark
This function has no effect on the JANUS 2050. See Also:
3-16 im_increase_contrast, im_set_contrast, im_get_contrast
Page 57
im_decrease_contrast
3
Example With System, Bit, Text_IO, Intrmecd_IO, Intrmecp_IO; Use System, Bit, Text_IO, Intrmecd_IO, Intrmecp_IO; procedure deccontr Is package SYSWORD_IO is new INTEGER_IO (System.Word); status : System.Word; begin Put_Line ("Decreasing contrast"); status := im_decrease_contrast; if Tstbit(status, 15) then Put ("Dec contrast error = "); SYSWORD_IO.Put (status, WIDTH => 8); New_Line; end if; end deccontr;
3-17
Page 58
im_get_config_info im_get_config_info Purpose:
This procedure retrieves the current reader configuration information string and its length.
Syntax:
With Intrmecd_IO, Intrmecp_IO; Use Intrmecd_IO, Intrmecp_IO; procedure im_get_config_info ( config_string : OUT String; length : OUT System.Word; status_code : OUT System.Word);
IN/OUT Parameters:
The config_string parameter is the configuration information string. The first two characters specify the type of configuration information returned. For example, to get the beep duration setting, set the config_string to “BD.” The procedure retrieves the currently configured setting for beep duration. The length parameter is the length of the configuration information string. The status_code parameter is one of the standard status codes defined in Appendix A, “Status Codes.” For a list of the configuration commands, see your JANUS user’s manual.
Return Value:
None.
Notes:
This procedure differs from im_command in that you only pass the twocharacter command identifier. The im_command procedure passes an entire command string.
See Also:
im_command
3-18
Page 59
im_get_config_info
3
Example With System, Intrmecd_IO, Intrmecp_IO, Text_IO, RTEXT_IO, ITOOLS; Use Intrmecd_IO, Intrmecp_IO, Text_IO, RTEXT_IO, ITOOLS; procedure CONINFO is package SYSBYTE_IO is new INTEGER_IO(System.Byte); package SYSWORD_IO is new INTEGER_IO(System.Word); use SYSBYTE_IO, SYSWORD_IO; config_string : String(1..300) := (others => Ascii.NUL); config_length : System.Word; status : System.Word; config_command : constant String := "BV"; begin clrscr; Put_Line("im_get_config_info example:"); New_line; --
Set config request for Beeper Volume config_string(1..2) := config_command; im_get_config_info(config_string, config_length, status);
Put("Beep Volume: "); for i in Integer range 1..300 loop exit when config_string(i) = Ascii.NUL; Put(config_string(i)); end loop; New_line; Put("Length : "); Put(config_length); New_line; Put("Status : "); Print_status_code(status); New_line; end CONINFO;
3-19
Page 60
im_get_contrast im_get_contrast Purpose:
This procedure retrieves the reader’s display contrast level. There are eight levels of contrast from very light (level 0) to very dark (level 7).
Syntax:
With Intrmecd_IO, Intrmecp_IO; Use Intrmecd_IO, Intrmecp_IO; procedure im_get_contrast ( contrast : OUT System.Byte; status_code : OUT System.Word);
IN Parameter:
None.
OUT Parameter:
The contrast parameter is a number from 0 to 7 or is one of the following constants: IM_MIN_CONTRAST IM_MAX_CONTRAST
0 1 minimum contrast maximum contrast
The status_code parameter is a standard status code listed 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 shows the equivalent values for the 0 to 7 scale. Scale 0 to 7
Scale 0 to 31
Level
0 1 2 3 4 5 6 7
10 12 14 16 18 20 22 24
Very light
Very dark
This function has no effect on the JANUS 2050.
3-20