The text of a manual · part 5 of 25
JANUS PSK for Ada Reference Manual, pages 41 to 50
Pages 41 to 50 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 41
nugget code39 helconital
3 Ada Library
Page 42
nugget code39 helconital
Page 43
Ada Library
3
This chapter explains the functions and procedures available in the Intermec Ada library and provides samples and notes to help you write application programs.
Using the Ada Library Functions In Ada, a procedure differs from a function in two major ways: A Procedure
A Function
Can pass output parameters.
Can not pass output parameters.
Does not a return a result when called.
Returns a result when called.
The Intermec Ada library uses the following conventions to determine when to use a function and when to use a procedure. • A subroutine that only needs to pass out the status code without any other output variables is a function. The status code is returned as the function return value. • A subroutine that needs to pass values as output variables is a procedure. The status code is returned as one of the output parameters. Note: Do not run programs that use PSK library functions on your PC, unless you have the JANUS Application Simulator installed. If you attempt to run these programs without the Simulator, you will receive an error message and the program will not run.
CAUTION
Caution Do not run programs that use Intermec-specific interrupt extensions on your PC, unless you have the JANUS Application Simulator installed. If you attempt to run these programs without the Simulator, they will cause your PC to lock up and possibly corrupt your system BIOS. Conseil N’exécutez pas de programmes utilisant des extensions d’interruption spécifiques à Intermec sur votre PC, à moins que JANUS Application Simulator soit installé. Si vous tentez de les exécuter sans le Simulator, ces programmes risquent de verrouiller votre PC et d’altérer le BIOS de votre système.
3-3
Page 44
JANUS PSK for Ada Reference Manual
Ada Library Functions Listed by Category Communications im_cancel_rx_buffer, 3-11 im_cancel_tx_buffer, 3-12 im_link_comm, 3-73, 3-137 im_protocol_extended_status, 3-83 im_receive_buffer, 3-85 im_receive_buffer_no_wait, 3-89 im_receive_buffer_noprot, 3-93 im_receive_byte, 3-97 im_receive_input, 3-100 im_rx_check_status, 3-104 im_serial_protocol_control, 3-105 im_transmit_buffer, 3-129 im_transmit_buffer_no_wait, 3-131 im_transmit_buffer_noprot, 3-132 im_transmit_byte, 3-134
Display im_backlight_off, 3-8 im_backlight_on, 3-9 im_backlight_toggle, 3-10 im_decrease_contrast, 3-16 im_get_contrast, 3-20 im_get_display_mode, 3-24 im_get_display_type, 3-27 im_get_follow_cursor, 3-29 im_increase_contrast, 3-43 im_set_contrast, 3-108 im_set_display_mode, 3-112 im_set_follow_cursor, 3-115
Input im_get_label_symbology, 3-33 im_get_length, 3-35 im_input_status, 3-45 im_receive_input, 3-100 im_set_input_mode, 3-117
3-4
IRL im_irl_a, 3-47 im_irl_k, 3-51 im_irl_n, 3-55 im_irl_v, 3-59 im_irl_y, 3-64
Keypad im_get_control_key, 3-22 im_get_keyclick, 3-32 im_get_warm_boot, 3-42 im_number_pad_off, 3-76 im_number_pad_on, 3-78 im_set_control_key, 3-110 im_set_keyclick, 3-119 im_set_warm_boot, 3-123
Program Control im_appl_break_status, 3-6 im_standby_wait, 3-127
Sound im_sound, 3-125
Status macros im_iserror, 3-69 im_isgood, 3-70 im_issuccess, 3-71 im_iswarn, 3-72
System im_command, 3-13 im_get_config_info, 3-18 im_get_postamble, 3-36 im_get_preamble, 3-38 im_message, 3-75 im_power_status, 3-80 im_rs_installed, 3-103
Page 45
Ada Library
3
Viewport im_cursor_to_viewport, 3-15 im_get_viewport_lock, 3-40 im_set_follow_cursor, 3-115 im_set_viewport_lock, 3-121 im_viewport_end, 3-138 im_viewport_getxy, 3-139 im_viewport_home, 3-141 im_viewport_move, 3-142 im_viewport_page_down, 3-145 im_viewport_page_up, 3-146 im_viewport_setxy, 3-147 im_viewport_to_cursor, 3-148
Note: The following syntax descriptions refer to many named constant variables, such as IM_COM1. These variables always appear in uppercase in this manual and are described in IM20ADAD.LIB.
3-5
Page 46
im_appl_break_status im_appl_break_status Purpose:
This function checks whether the application break sequence has been pressed. All PSK functions are terminated when the application break sequence is keyed in. Place calls to this function at strategic locations in your program to detect when a user wants to break out of a loop. Your program can determine what action to take when the break sequence is detected.
Syntax:
With Intrmecd_IO, Intrmecp_IO; Use Intrmecd_IO, Intrmecp_IO; procedure im_appl_break_status ( break_status : Out IM_APPBREAK_STATUS; status_code : Out System.Word);
IN Parameter:
None.
OUT Parameter:
The break_status parameter is one of the following constants: IM_REQUEST_NOT_MADE
Request for an application break has not been made
IM_REQUEST_MADE
Request for an application break has been made
The status_code is one of the standard status codes defined in Appendix A, “Status Codes.” Return Value:
None.
Notes:
The break_status flag is reset each time this routine is called. Because this function is also called during the input routines provided in the library, you should check the return code from input functions for the hex value 8515H. This value indicates that the input function has terminated because the application break sequence was entered. In this case, the break_status flag is cleared by the input function’s call to im_appl_break_status.
3-6
Page 47
im_appl_break_status
3
To enter an application break sequence 1. Press 2. Press 3. Press 4. Press q n2g 1 q to turn off the reader. -
- at the same time.
. This sets the reader’s application break bit.
to turn on the reader.
Example With System, Text_IO, Intrmecd_IO, Intrmecp_IO; Use System, Text_IO, Intrmecd_IO, Intrmecp_IO; procedure appl_br Is package SYSWORD_IO is new INTEGER_IO (System.Word); package IM_APPBREAK_STATUS_IO is new ENUMERATION_IO (enum => IM_APPBREAK_STATUS); break : IM_APPBREAK_STATUS; status : System.Word; in_char : Character := ' '; begin Put_Line ("Appl Brk Status"); Put_Line ("Set brk bit and then"); Put_Line ("press any key & return"); Get (in_char); -- Press the following sequence at this pause (to set application break bit): -- 1/0 key (Turn OFF the reader) -- F3-2-Left Arrow (Press F3, 2 and left arrow at the same time) -- 1 (Press the 1 (one) key to set application break bit) -- 1/0 key (Turn ON the reader) -- set break to known value break := IM_REQUEST_MADE; im_appl_break_status (break, status); if break = IM_REQUEST_MADE then Put_Line ("Break status ON"); Put ("return status : "); SYSWORD_IO.Put (status, WIDTH => 4); New_Line; Put ("break_status : "); IM_APPBREAK_STATUS_IO.Put (break); elsif break = IM_REQUEST_NOT_MADE then Put_Line ("Break status OFF"); Put ("return status : "); SYSWORD_IO.Put (status, WIDTH => 4); New_Line; Put ("break_status : "); IM_APPBREAK_STATUS_IO.Put (break); end if; New_Line; end appl_br;
3-7
Page 48
im_backlight_off im_backlight_off Purpose:
This procedure turns the display backlight off. Turn off the backlight to prolong the reader’s battery life.
Syntax:
With Intrmecd_IO, Intrmecp_IO; Use Intrmecd_IO, Intrmecp_IO; procedure im_backlight_off;
Parameters:
None.
Return Value:
None.
Notes:
You can program the backlight to automatically turn off after a specified time to save battery power. The length of time depends on the backlight timeout configuration parameter. The configuration parameter is set in 1-second increments. The default is 10 seconds. This procedure has no effect on the JANUS 2050.
See Also:
im_backlight_on, im_backlight_toggle
Example With System, Text_IO, Intrmecd_IO, Intrmecp_IO; Use System, Text_IO, Intrmecd_IO, Intrmecp_IO; procedure lightoff Is begin im_backlight_off; Put_Line ("Backlight off"); end lightoff;
3-8
Page 49
im_backlight_on
3 im_backlight_on Purpose:
This procedure turns the JANUS display backlight on to help you see the reader display in dimly lit environments.
Syntax:
With Intrmecd_IO, Intrmecp_IO; Use Intrmecd_IO, Intrmecp_IO; procedure im_backlight_on;
Parameters:
None.
Return Value:
None.
Notes:
You can program the backlight to automatically turn off after a specified time to save battery power. The length of time depends on the backlight timeout configuration parameter. The configuration parameter is set in 1-second increments. The default is 10 seconds. This procedure has no effect on the JANUS 2050.
See Also:
im_backlight_off, im_backlight_toggle
Example With System, Text_IO, Intrmecd_IO, Intrmecp_IO; Use System, Text_IO, Intrmecd_IO, Intrmecp_IO; procedure lighton Is begin im_backlight_on; Put_Line ("Backlight on"); end lighton;
3-9
Page 50
im_backlight_toggle im_backlight_toggle Purpose:
This function toggles the LCD display backlight on and off.
Syntax:
With Intrmecd_IO, Intrmecp_IO; Use Intrmecd_IO, Intrmecp_IO; function im_backlight_toggle return System.Word;
Parameters:
None.
Return Value:
This function returns one of the standard status codes listed in Appendix A, “Status Codes.”
Notes:
You can program the backlight to automatically turn off after a specified time to save battery power. The length of time depends on the backlight timeout configuration parameter. The configuration parameter is set in 1-second increments. The default is 10 seconds. This procedure has no effect on the JANUS 2050.
See Also:
im_backlight_on, im_backlight_off
Example With System, Bit, Text_IO, Intrmecd_IO, Intrmecp_IO; Use System, Bit, Text_IO, Intrmecd_IO, Intrmecp_IO; procedure lightogl Is package SYSWORD_IO is new INTEGER_IO (System.Word); status : System.Word; begin status := im_backlight_toggle; Put_Line ("Backlt toggled"); if Tstbit(status, 15) then Put ("Backlight toggle error = "); SYSWORD_IO.Put (status, WIDTH => 8); New_Line; end if; end lightogl;
3-10