The text of a manual · part 7 of 36
Trakker Antares Application Development Tools System Manual: Part I - Trakker Antares PSK Reference Manual, pages 55 to 64
Pages 55 to 64 of 340, from Trakker Antares Application Development Tools System Manual
The original document is the PDF (1.6 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
Filed in the catalog under the Intermec 2420, Intermec 2425, Intermec 2435 and Intermec 2481
Page 55
Chapter 4, Converting Trakker Antares and JANUS Applications compiler option. For help, see one of the Project Settings Checklists in Chapter 3, “Building Applications.”
Compatible Functions These functions work with both PSKs without modifications. Compatible Functions for the JANUS and Trakker PSKs im_command im_set_follow_cursor im_cursor_to_viewport im_set_input_mode im_get_config_info im_sound im_get_display_type im_standby_wait im_get_follow_cursor im_transmit_buffer im_get_label_symbology im_transmit_buffer_no_wait im_get_length im_viewport_end im_get_viewport_lock im_viewport_getxy im_input_status im_viewport_home im_irl_a im_viewport_move im_irl_k im_viewport_page_down im_irl_n im_viewport_page_up im_irl_v im_viewport_setxy im_irl_y im_viewport_to_cursor im_message im_viewport_setxy im_receive_buffer im_viewport_to_cursor im_receive_input im_set_viewport_lock
Note: Incompatible functions and suggested alternatives are listed later in this chapter. See “Converting Applications: Trakker Antares to JANUS” on page 37, and “Converting Applications: JANUS to Trakker Antares ” on page 40.
Using Status Code Macros Each PSK library function returns a specific status value. The PSK provides status code macros that determine the success of the function without testing for an explicit value. For most functions, you only need to know if the result was success or failure. Your program is easier to maintain, update, and port to another terminal type when you check for success or failure instead of a specific value. The next example tests for success or failure and then provides an action for each condition.
Trakker Antares PSK Reference Manual
35
Page 56
Chapter 4, Converting Trakker Antares and JANUS Applications
Example: Using Status Code Macros /* This segment requests label input, then checks for success */ /* If successful, then retrieve the label symbology
*/
/* If an error occurred, display the error message
*/
/* Request input */ status = im_receive_input(IM_LABEL_SELECT, IM_INFINITE_TIMEOUT, &source, input); if ( IM_ISSUCCESS(status)) im_get_label_symbology( &symbol); if ( IM_ISERROR(status)) im_message(status);
You may want to take different actions depending on the type of error. You can test for success with IM_ISSUCCESS and provide more detailed tests for a specific returned status code. You can use the exact status code for debugging programs, but you need to adjust the routines before you attempt to port the application. For more information, see Chapter 5, “PSK Function Descriptions.” Status Code Macros to Determine Success or Failure of a Function Status Code Macro IM_ISERROR(status) IM_ISSUCCESS(status) IM_ISGOOD(status) IM_ISWARN
Return Value nonzero
Meaning error zero (0)
success or warning nonzero success zero (0)
error nonzero success zero (0)
warning or error nonzero warning zero (0)
success
Creating Your Own Include File You can handle the JANUS and Trakker PSK library differences by creating a compatibility file (compat.h) to redefine the incompatible functions. Use an #include statement at the beginning of your program to reference this file. The include file provides a reusable filter that you can customize for your needs. The include file needs to rename some functions and assign specific values to other functions.
36
Trakker Antares PSK Reference Manual
Page 57
Chapter 4, Converting Trakker Antares and JANUS Applications
Renaming a Function
The Trakker PSK replaces some C functions with Intermec functions. For example, im_clear_screen() in the Trakker PSK replaces the Borland C clrscr() function. Note: The JANUS PSK supports Borland C/C++ and Microsoft C/C++. The Trakker Antares PSK only supports Microsoft Visual C/C++, Professional Edition v1.0 or v1.5x, which can create 16-bit DOS applications. For more information, see “Trakker Antares PSK Version Requirements” on page 4. To rename the clrscr() function to work with the Trakker PSK, add this line to the compatibility file (compat2t.h): #define clrscr() im_clear_screen()
Use the tables later in this chapter to determine the changes you need to make.
Defining Function Values
Some PSK functions do not have a clear replacement function. For these functions, you can assign a success value or another significant value. For example, many JANUS PSK functions require that the im_link function has been called. There is no equivalent function in the Trakker PSK. You can assign the success value to im_link so that your program handles the function without disrupting your program. To assign a success value to im_link for Trakker PSK programs, add this line to the compatibility file: #define im_link(x,x,x) atoi("0")
Converting Applications: Trakker Antares to JANUS Since most of the Trakker PSK functions are a subset of the JANUS PSK function library, converting applications is usually easy. Some Trakker PSK functions are not part of the JANUS PSK. If you use any of the incompatible functions, you must change your program or create an include file that traps the newer functions. This table lists the Trakker PSK functions that you must modify to use with the JANUS PSK.
Trakker Antares PSK Reference Manual
37
Page 58
Chapter 4, Converting Trakker Antares and JANUS Applications
Trakker PSK Functions That Need to be Modified for the JANUS PSK Trakker PSK Function im_clear_screen
JANUS PSK Differences and Solutions Not supported on JANUS devices. Use standard C functions.
im_cputs
Not supported on JANUS devices. Use standard C functions.
im_erase_display
Not supported on JANUS devices. Use standard C functions.
im_erase_line
Not supported on JANUS devices. Use standard C functions.
im_event_wait
Similar to im_input_wait on JANUS devices.
im_get_cursor_style
Not supported on JANUS devices.
im_get_cursor_xy
Not supported on JANUS devices.
im_get_screen_char
Not supported on JANUS devices. Use standard C functions.
im_get_text
Not supported on JANUS devices. Use standard C functions.
im_get_tx_status
Not supported on JANUS devices.
im_get_viewporting
Not supported on JANUS devices. See “Changing Viewport Functions” on page 39.
im_put_text
Not supported on JANUS devices. Use standard C functions.
im_putchar
Not supported on JANUS devices. Use standard C functions.
im_puts
Not supported on JANUS devices. Use standard C functions.
im_receive_buffer
JANUS devices use a smaller buffer and a smaller maximum timeout value. See “Setting Timeout Values” on page 44.
im_receive_field
Not supported on JANUS devices. Use im_receive_input.
im_receive_file
Not supported on JANUS devices. Use the Communications Manager to receive ASCII files.
im_set_cursor_style
Not supported on JANUS devices.
im_set_cursor_xy
Not supported on JANUS devices.
im_set_time_event
Not supported on JANUS devices.
im_set_viewporting
Not supported on JANUS devices. See “Changing Viewport Functions” on page 39.
im_setup_follow_cursor
Not supported on JANUS devices.
im_setup_manual_viewporting
Not supported on JANUS devices. Use im_command with the appropriate viewport configuration commands. See your Trakker Antares terminal user’s manual or JANUS device user’s manual.
im_transmit_buffer
JANUS devices use a smaller maximum timeout value. See “Setting Timeout Values” on page 44.
im_transmit_buffer_no_wait_t
Not supported on JANUS devices. Use im_transmit_buffer_no_wait.
im_transmit_file
Not supported on JANUS devices. Use the Communications Manager to transmit ASCII files.
im_viewport_page_left
Not supported on JANUS devices. Use im_viewport_move.
im_viewport_page_right
Not supported on JANUS devices. Use im_viewport_move.
38
Trakker Antares PSK Reference Manual
Page 59
Chapter 4, Converting Trakker Antares and JANUS Applications
Changing Viewport Functions JANUS devices and Trakker Antares terminals both support a 25x80 virtual display. However, you use different functions to turn the viewport on and off. The Trakker PSK also contains two additional functions: im_viewport_page_left and im_viewport_page_right. Changing Viewport Functions for the JANUS PSK Trakker PSK Method im_set_viewporting (IM_ENABLE)
JANUS PSK Method im_set_display_mode (IM_SIZE_MODE_80X25, video, scroll, char_ht)
im_set_viewporting (IM_DISABLE)
im_set_display_mode (other_size, video, scroll, char_ht)
im_get_viewporting (mode)
im_get_display_mode scroll, char_ht)
where: mode is IM_ENABLE or IM_DISABLE.
(size, video, where: video scroll char_ht size other_size is the video mode parameter. is the scrolling mode parameter. is the character height parameter. is the screen size. is the screen size, other than 80x25.
im_viewport_move (IM_VIEWPORT_LEFT, distance, row, col) Or im_viewport_page_left()
im_viewport_move (IM_VIEWPORT_LEFT, distance, row, col)
im_viewport_move (IM_VIEWPORT_RIGHT, distance, row, col) Or im_viewport_page_right()
im_viewport_move (IM_VIEWPORT_RIGHT, distance, row, col) where: distance row col is the width of one screen, from 1 to 70 is a returned parameter is a returned parameter
Changing Display Modes The JANUS devices use different display modes than the Trakker Antares terminals. Both use im_get_display_mode and im_set_display_mode, but they pass a different number of parameters and set different attributes. You need to rewrite program segments that set or check for display mode values.
Trakker Antares PSK Reference Manual
39
Page 60
Chapter 4, Converting Trakker Antares and JANUS Applications
Changing Display Modes for the JANUS PSK Trakker PSK Display Mode Syntax #include "imt24lib.h" IM_STATUS im_get_display_mode (IM_FONT_TYPE far *font, IM_UCHAR far *phys_width, IM_UCHAR far *phys_height, IM_BOOL far *scroll, IM_BOOL far *wrap);
JANUS PSK Display Mode Syntax #include "im20lib.h" IM_USHORT im_get_display_mode (IM_STD_SIZE_MODE *size_mode, IM_STD_VIDEO_MODE *video_mode, IM_SCROLL_MODE *scroll_mode, IM_CHARACTER_HEIGHT *char_ht);
Converting Applications: JANUS to Trakker Antares The JANUS PSK library provides many functions that are not part of the Trakker PSK. If you use any of the incompatible functions, you must change your program or create an include file that traps the unsupported functions. This table lists the functions from the JANUS PSK that you must modify to use with the Trakker PSK. JANUS PSK Functions That Need to be Modified for the Trakker PSK JANUS PSK Function im_appl_break_status
Trakker PSK Differences and Solutions Trakker Antares terminals use a hot key to break out of an application.
im_backlight_off
Use im_command("%.0").
im_backlight_on
Use im_command("%.1").
im_backlight_toggle
Use im_command("%.")
im_cancel_rx_buffer
Not supported on Trakker Antares terminals. Do not use.
im_cancel_tx_buffer
Not supported on Trakker Antares terminals. Do not use.
im_clear_abort_callback
Not supported on Trakker Antares terminals. Use the hot key to control the application instead.
im_decrease_contrast
Use im_command("DJ9").
im_get_contrast
Use im_get_config_info("DJ").
im_get_control_key
Use im_get_config_info("KB").
im_get_display_mode
Trakker PSK passes different arguments. See “Changing Display Modes” on page 42.
im_get_input_mode
See “Using Input Modes” on page 43.
im_get_keyclick
Use im_get_config_info("KC").
im_get_postamble
Use im_get_config_info("AE").
im_get_preamble
Use im_get_config_info("AD").
im_get_reboot_flag
Not supported on Trakker Antares terminals. Do not use.
im_get_warmboot
Not supported on Trakker Antares terminals. Do not use.
im_increase_contrast
Use im_command("DJ8").
40
Trakker Antares PSK Reference Manual
Page 61
Chapter 4, Converting Trakker Antares and JANUS Applications
JANUS PSK Functions That Need to be Modified for the Trakker PSK (continued) JANUS PSK Function im_input_status
Trakker PSK Differences and Solutions Trakker PSK does not support COM2. References to COM4 are treated as NET port by the IMT24LIB.H include file.
im_link_comm
Trakker Antares terminals do not need to link or unlink to use communications ports. Do not use.
im_number_pad_off
Not supported on Trakker Antares terminals. Do not use.
im_number_pad_on
Not supported on Trakker Antares terminals. Do not use.
im_parse_host_response
Not supported on Trakker Antares terminals. Do not use.
im_power_status
Not supported on Trakker Antares terminals. Do not use.
im_protocol_extended_status
Use im_get_config_info("PS") to retrieve the protocol settings. Use im_command("PSdata") to set the protocol. Refer to your Trakker Antares terminal user’s manual for valid data values.
im_receive_buffer
Trakker PSK has a larger receive buffer and uses a larger maximum for timeout. See “Setting Timeout Values” on page 44.
im_receive_buffer_noprot
Not supported on Trakker Antares terminals. Do not use.
im_receive_buffer_no_wait
Use im_receive_input or im_receive_buffer and set the timeout to 0.
im_receive_byte
Use im_receive_input.
im_rs_installed
Reader services are built into Trakker Antares terminals. This function is not used.
im_rx_check_status
Use im_input_status.
im_serial_protocol_control
Use im_get_config_info(PS) to retrieve the protocol settings. Use im_command("PSdata") to set the protocol. Refer to your Trakker Antares terminal user’s manual for valid data values.
im_set_abort_callback
Not supported on Trakker Antares terminals. Use the hot key to control the application instead.
im_set_contrast
Use im_command("DJdata"), where data is the contrast level from 0 to 7. Refer to your Trakker Antares terminal user’s manual for valid data values.
im_set_control_key
Not supported on Trakker Antares terminals. Use the menu to reboot the terminal.
im_set_display_mode
Trakker PSK passes different arguments. See “Changing Display Modes” on page 42.
im_set_input_mode
See “Using Input Modes” on page 43.
im_set_keyclick
Use im_command("KCdata"), where data is 0 (disable) or 1 (enable). Refer to your Trakker Antares terminal user’s manual.
im_set_warmboot
Not supported on Trakker Antares terminals. Use the hot key to control application instead.
im_setup_trx
Not supported on Trakker Antares terminals. Do not use.
im_standard_trx
Not supported on Trakker Antares terminals. Do not use.
im_transmit_buffer
Trakker PSK has a larger maximum for timeout. See “Setting Timeout Values” on page 44.
im_transmit_buffer_noprot
Not supported on Trakker Antares terminals. Do not use.
im_transmit_byte
Use im_transmit_buffer.
im_unlink_com
Trakker Antares terminals do not need to link or unlink to use communications ports. Do not use.
Trakker Antares PSK Reference Manual
41
Page 62
Chapter 4, Converting Trakker Antares and JANUS Applications
Changing Viewport Functions The JANUS devices and Trakker Antares terminals both support a 25x80 virtual display. However, you use different functions to turn the viewport on and off. If your JANUS program uses viewporting, you need to use the Trakker PSK functions im_get_viewporting and im_set_viewporting. Changing Viewport Functions for the Trakker PSK JANUS PSK Method im_set_display_mode (IM_SIZE_MODE_80X25, video, scroll, char_ht)
Trakker PSK Method im_set_viewporting (IM_ENABLE)
im_set_display_mode (other_size, video, scroll, char_ht)
im_set_viewporting (IM_DISABLE)
im_get_display_mode scroll, char_ht)
im_get_viewporting (mode)
(size, video, where:
where: video scroll char_ht size other_size mode is IM_ENABLE or IM_DISABLE.
is the video mode parameter. is the scrolling mode parameter. is the character height parameter. is the screen size. is the screen size, other than 80x25.
im_viewport_move (IM_VIEWPORT_LEFT, distance, row, col)
im_viewport_move (IM_VIEWPORT_LEFT, distance, row, col) Or im_viewport_page_left()
im_viewport_move (IM_VIEWPORT_RIGHT, distance, row, col)
im_viewport_move (IM_VIEWPORT_RIGHT, distance, row, col) Or im_viewport_page_right()
where: distance row col is the width of one screen, from 1 to 70. is a returned parameter. is a returned parameter.
Changing Display Modes The JANUS devices use different display modes than the Trakker Antares terminals. Both use im_get_display_mode and im_set_display_mode, but they pass a different number of parameters and set different attributes. You need to rewrite program segments that set or check for display mode values.
42
Trakker Antares PSK Reference Manual
Page 63
Chapter 4, Converting Trakker Antares and JANUS Applications
Changing Display Modes for the Trakker PSK JANUS PSK Display Mode Syntax #include "im20lib.h" IM_USHORT im_get_display_mode (IM_STD_SIZE_MODE *size_mode, IM_STD_VIDEO_MODE *video_mode, IM_SCROLL_MODE *scroll_mode, IM_CHARACTER_HEIGHT *char_ht);
Trakker PSK Display Mode Syntax #include "imt24lib.h" IM_STATUS im_get_display_mode (IM_FONT_TYPE far *font, IM_UCHAR far *phys_width, IM_UCHAR far *phys_height, IM_BOOL far *scroll, IM_BOOL far *wrap);
Using Input Modes The Trakker PSK and JANUS PSK support three different input modes: Wedge mode, Programmer mode, and Desktop mode. The differences between these modes are more important on JANUS devices than on Trakker Antares terminals.
Wedge Mode
In Wedge mode, keypad and label inputs go directly into the keyboard buffer. Any reader commands are executed and saved. For JANUS devices, Wedge mode is the default mode at the DOS prompt after you load reader services (RSERVICE.EXE). Use Wedge mode when your program uses Microsoft C functions on the JANUS device. When the reader is in Wedge mode, use standard input functions such as getch to retrieve keypad or label input. Keypad input terminates when you press the Enter key. On the Trakker Antares terminals, Wedge mode works with all of the keypad input functions.
Programmer Mode
In Programmer mode, keypad input is echoed to the screen as the keys are pressed, and any reader commands are executed and saved. Keypad input terminates when you press the Enter key. JANUS devices require Programmer mode to use the PSK functions and to execute Interactive Reader Language (IRL) commands. Programmer mode is the default mode for Trakker Antares terminals, and it works with all of the keypad input functions. Trakker Antares terminals do not support IRL commands.
Desktop Mode
In Desktop mode, your application is responsible for retrieving and displaying keypad input. The input terminates with each keystroke, and Desktop mode returns detailed information about each key pressed.
Trakker Antares PSK Reference Manual
43
Page 64
Chapter 4, Converting Trakker Antares and JANUS Applications
Use the input function im_receive_input to capture the keys pressed. Each character returned uses the structure IM_KEYCODE, described in IM20LIB.H and IMT24LIB.H. This structure consists of four bytes: the ASCII code, the scan code, and two bytes of keyboard flags (Shift, Control, Alt).
Setting Timeout Values The Trakker PSK uses two different maximum timeout values, but the JANUS PSK uses only one maximum value. Trakker PSK functions that access the network port use a much larger value and use the data type IM_LTIME. Setting Timeout Values for the Trakker PSK JANUS PSK Values Numeric range: 1 to 65,534 ms Wait forever: IM_INFINITE_TIMEOUT
Trakker PSK Values Numeric range: 0 to 4,294,967,294 ms Wait forever: IM_INFINITE_NET_TIMEOUT
To convert the JANUS PSK values to work with the Trakker PSK • Add this line to your include file: #define IM_INFINITE_TIMEOUT
44
IM_INFINITE_NET_TIMEOUT
Trakker Antares PSK Reference Manual