Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeEnglishEspañolContact

The text of a manual · part 6 of 28

6400 PSK Reference Manual, pages 51 to 60

Pages 51 to 60 of 272

The original document is the PDF (1.1 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.

For the Intermec 6400

Page 51

Converting Trakker Antares and JANUS Applications to 6400 Applications

4

Compatible Functions (continued) im_fmalloc im_free_mem im_free_space im_get_config_info im_get_cursor_xy im_get_display_mode im_get_display_size_physical im_get_display_size_virtual im_get_display_type im_get_input_mode vim_get_label_symbology im_get_label_symbologyid im_get_length im_get_tx_status im_input_status im_set_cursor_xy im_set_display_mode im_set_input_mode im_set_time_event im_sound im_standby_wait im_status_line im_transmit_buffer im_transmit_buffer_no_wait_t im_viewport_home im_xm_receive_file im_xm_transmit_file im_xm1k_receive_file im_xm1k_transmit_file

Note: Incompatible functions and suggested alternatives are listed later in this chapter. For more information, see “Converting Trakker Antares Applications to 6400 Applications” and “Converting JANUS Applications to 6400 Applications” later in this chapter.

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. This example tests for success or failure and then provides an action for each condition. /* 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);

4-5

Page 52

6400 PSK Reference Manual

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 Macro

Return Value

Meaning

IM_ISERROR(status)

nonzero zero (0)

error success or warning

IM_ISSUCCESS(status)

nonzero zero (0)

success error

IM_ISGOOD(status)

nonzero zero (0)

success warning or error

IM_ISWARN nonzero zero (0)

warning success

Creating Your Own Include File You can handle the JANUS and Trakker Antares PSK library differences by creating a compatibility file (compat.h) to redefine the incompatible functions. Use a #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.

Renaming a Function The Trakker Antares PSK replaces some C functions with Intermec functions. For example, im_clear_screen() in the Trakker Antares 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 “Microsoft C/C++ Version Requirements” in Chapter 1. To rename the clrscr() function to work with the Trakker Antares 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.

4-6

Page 53

Converting Trakker Antares and JANUS Applications to 6400 Applications

4

For example, many JANUS PSK functions require that the im_link function has been called. There is no equivalent function in the Trakker Antares 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 Antares PSK programs, add this line to the compatibility file: #define im_link(x,x,x) atoi(“0”)

Converting Applications This section explains how to convert Trakker Antares and JANUS applications to 6400 applications.

Converting Trakker Antares Applications to 6400 Applications To convert a Trakker Antares application to a 6400 application, rebuild the application using the 6400 library file, IM64PSK.LIB. For help, see Chapter 3, “Building Applications.”

Converting JANUS Applications to 6400 Applications The JANUS PSK library provides many functions that are not part of the 6400 PSK. If you use any of the incompatible functions, you must change your program or create an include file that traps the unsupported functions. To convert a JANUS application to a 6400 application, rebuild the application using the 6400 library file, IM64PSK.LIB. For help, see Chapter 3, “Building Applications.” This table lists the functions from the JANUS PSK that you must modify to use with the 6400 PSK. JANUS PSK Function

6400 PSK Differences and Solutions im_appl_break_status

6400 use a hot key to break out of an application.

im_backlight_toggle

Use im_command(“%.”)

im_cancel_tx_buffer

The 6400 PSK returns different return codes. Change your code to accept or test against these values: IM_SUCCESS, IM_NET_ERROR, IM_PORT_INACTIVE, TRANSMIT_COMPLETE im_clear_abort_callback

Not supported on 6400. Use the hot key to control the application instead.

4-7

Page 54

6400 PSK Reference Manual

JANUS PSK Functions That Must be Modified (continued) JANUS PSK Function

6400 PSK Differences and Solutions im_get_contrast

Use im_get_config_info(“DJ”).

im_get_control_key

Use im_get_config_info(“KB”).

im_get_display_mode

6400 PSK passes different arguments. See “Changing Display Modes” later in this chapter.

im_get_input_mode

See “Using Input Modes” later in this chapter.

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 6400. Do not use.

im_get_warmboot

Not supported on 6400. Do not use.

im_increase_contrast

Not supported on 6400. Use the hot key to control the application instead.

im_input_status

6400 PSK does not support COM2. References to COM4 are treated as NET port by the IM64PSK.H include file.

im_link_comm

6400 do not need to link or unlink to use communications ports. Do not use.

im_number_pad_off

Not supported on 6400. Do not use.

im_number_pad_on

Not supported on 6400. Do not use.

im_parse_host_response

Not supported on 6400. Do not use.

im_protocol_extended_status

Use im_get_config_info(“command”) to retrieve the a specific configuration setting where command is the configuration command for the setting. For a list of configuration commands, see Chapter 7, “Configuration Command Reference.” im_receive_buffer

6400 PSK has a larger receive buffer and uses a larger maximum for timeout. See “Setting Timeout Values” later in this chapter.

im_receive_buffer_noprot

Not supported on 6400. 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 6400. This function is not used.

im_rx_check_status

Use im_input_status.

im_serial_protocol_control

Use im_get_config_info(“command”) to retrieve the a specific configuration setting where command is the configuration command for the setting. For a list of configuration commands, see Chapter 7, “Configuration Command Reference.” im_set_abort_callback

Not supported on 6400. Use the hot key to control the application instead.

im_set_contrast

Not supported on 6400. Use the contrast keys to change the contrast.

im_set_control_key

Not supported on 6400. Use the menu to reboot the terminal.

4-8

Page 55

Converting Trakker Antares and JANUS Applications to 6400 Applications

4

JANUS PSK Functions That Must be Modified (continued) JANUS PSK Function

6400 PSK Differences and Solutions im_set_display_mode

6400 PSK passes different arguments. See “Changing Display Modes” later in this chapter.

im_set_input_mode

See “Using Input Modes” later in this chapter.

im_set_keyclick

Use im_command(“KCdata”), where data is 0 (disable) or 1 (enable). For more information, see Chapter 7, “Configuration Command Reference.” im_set_warmboot

Not supported on 6400. Use the hot key to control application instead.

im_setup_trx

Not supported on 6400. Do not use.

im_standard_trx

Not supported on 6400. Do not use.

im_transmit_buffer

6400 PSK has a larger maximum for timeout. See “Setting Timeout Values” later in this chapter.

im_transmit_buffer_noprot

Not supported on 6400. Do not use.

im_transmit_byte

Use im_transmit_buffer.

im_unlink_com

6400 do not need to link or unlink to use communications ports. Do not use.

Changing Display Modes The JANUS devices use different display modes than the 6400. 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. JANUS PSK Display Mode Syntax

6400 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);

#include “im64psk.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 6400 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 6400.

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.

4-9

Page 56

6400 PSK Reference Manual

When the JANUS 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 6400, 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 6400, and it works with all of the keypad input functions. The 6400 does 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. 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 IM64PSK.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 6400 PSK uses two different maximum timeout values, but the JANUS PSK uses only one maximum value. 6400 PSK functions that access the network port use a much larger value and use the data type IM_LTIME. JANUS PSK Values

6400 PSK Values

Numeric range: 1 to 65,534 ms Wait forever: IM_INFINITE_TIMEOUT

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 6400 PSK •

Add this line to your include file: #define IM_INFINITE_TIMEOUT

4-10

IM_INFINITE_NET_TIMEOUT

Page 57

5 PSK Function Descriptions

Page 58

blank

Page 59

function_name

5

This chapter describes the syntax and parameters for each function in the 6400 Programmer’s Software Kit (PSK) library.

Understanding the Function Descriptions The function descriptions in this chapter use these conventions: •

The descriptions refer to many named constant variables, such as IM_COM1. These variables always appear in uppercase and are described in IM64PSK.H. The descriptions use common C/C++ notation.

•

Italic type indicates a variable that you replace with a real value.

•

Straight quotation marks (" ") indicate literal string entries. Include the quotation marks in the command, such as: char *high_trast ="$+DJ7";

•

You can indent program statements with leading spaces to make your program easier to read.

•

C/C++ is case sensitive. Follow the capitalization used in the descriptions.

The following example (function_name) explains the parts of the function descriptions.

function_name Purpose:

Briefly describes the function and its typical use.

Syntax:

Lists the C-language function prototype and the required include file.

IN Parameters:

Describes the input parameters for the function and lists acceptable values.

OUT Parameters:

Describes the output parameters for the function and lists acceptable values.

IN/OUT Parameters: Return Value: Notes: See Also:

Describes the parameters that are passed into and then back out of the function. Lists acceptable values. The function usually changes the value before returning. Describes the value returned by the function and lists acceptable values. Describes any additional information about the function. Lists similar PSK functions.

Example /* A short code segment showing how to use the function.

*/

5-3

Page 60

im_backlight_off im_backlight_off Purpose:

This function turns the display backlight off. Turn off the backlight to prolong the 6400’s battery life.

Syntax:

#include “im64psk.h” void im_backlight_off(void);

IN Parameters:

None.

OUT Parameters:

None.

Return Value:

None.

Notes:

See Also:

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. im_backlight_on

Example /******************** im_backlight_off *****************************/ #include <stdio.h> #include "im64psk.h" void main (void) { im_backlight_off(); printf("Backlight off\n"); }

5-4