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 3 of 28

6400 PSK Reference Manual, pages 21 to 30

Pages 21 to 30 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 21

Getting Started

1

You can order Microsoft Visual C/C++ Enterprise Edition v1.52 from Intermec (Part No. 590224). Microsoft Version

16-Bit Support v1.0

' v1.5x

' v4.x

' Includes a disk for v1.52 v5.x

& Order Microsoft Visual C/C++ v1.52, Enterprise Edition from Intermec (Part No. 590224)

You can use the 6400 PSK to develop programs for 6400s with version 2.x firmware. However, the new features will not work with the older firmware. Call your Intermec representative for information on upgrading your 6400 firmware.

What’s Next? Once you have installed the PSK library functions, you can begin creating your programs. Use this table to help you decide what to do next. To learn about this task or concept

See this chapter

•

Designing programs that use PSK functions

Chapter 2, “Programming Guidelines”

•

Using status code macros to check function results

•

Using tested C/C++ functions with the PSK library

•

Compiling and building programs

•

Customizing Visual C/C++ to work with the PSK

•

Downloading applications to the 6400 with FileCopy

•

Converting Trakker Antares applications to run on a 6400

•

Converting JANUS applications to run on a 6400

Chapter 3, “Building Applications”

Chapter 4, “Converting Trakker Antares and JANUS Applications to 6400 Applications”

1-5

Page 22

6400 PSK Reference Manual

What’s Next (continued) To learn about this task or concept

See this chapter

•

Correct syntax for each function

Chapter 5, “PSK Function Descriptions”

•

Examples of functions

•

Explanation of reader commands

•

Correct syntax for reader commands

•

Explanation of configuration commands

•

Correct syntax for configuration commands

1-6

Chapter 6, “Reader Command Reference”

Chapter 7, “Configuration Command Reference”

Page 23

nugget

39 helconital

2 Programming Guidelines

Page 24

39 helconital nugget blank

Page 25

Programming Guidelines

2

This chapter explains the types of functions included in the PSK library and lists the Intermec-certified C runtime library functions. Refer to this chapter for guidance in selecting Intermec functions and valid Microsoft C functions.

What Is the PSK Library? The 6400 PSK is a library of C functions for programming the 6400. You can program a 6400 to display prompts and error messages, to collect and display data, and to transmit data to a DCS 300 or a host. You can also design beep sequences for audio feedback. The PSK functions work with most standard Microsoft C functions. You can create complex applications that collect, store, manipulate, and transmit data to meet your system needs.

Communications Functions Use the communications functions to send or receive data through a communications port, to check the buffer status for a port, or to cancel a transmission. You can transmit and receive the contents of a buffer or a file. You can also receive data or one or more characters from the keyboard, scanner, or communications port. You can specify several input sources, and then test for a specific source before acting on the input. You can transmit a maximum of 1024 bytes in one record. The PSK includes these communications functions: im_cancel_tx_buffer im_transmit_buffer im_cancel_rx_buffer im_transmit_buffer_no_wait_t im_get_tx_status im_xm_receive_file im_irl_v im_xm_transmit_file im_receive_buffer im_xm1k_receive_file im_receive_field im_xm1k_transmit_file im_receive_input

Example: Receiving Data from the NET Port or from the Keyboard // This segment waits for input, and then makes it available by calling // im_receive_input( ). // // Use this method when you want to receive input from multiple sources and you // don't know the input source. #include "im64psk.h" void main() {

2-3

Page 26

6400 PSK Reference Manual

Example: Receiving Data from the NET Port or from the Keyboard (continued) char input[1024]; // Input buffer (input from network must be 1024 characters) IM_ORIGIN source; // Source(s) where input is to come from IM_STATUS status; // Results of call // Wait for input from either the keyboard or from NET status = im_receive_input (IM_KEYBOARD_SELECT | IM_NET_SELECT, IM_INFINITE_TIMEOUT, &source, input); // Data is now available in the buffer input // if (status == IM_SUCCESS) // Add your code segment here }

Display Functions Use the display functions to change or retrieve the display attributes. You can define screen size and font size. You can also send text to the screen, erase all or part of the display, and relocate the cursor. The PSK includes these display functions: im_clear_screen im_get_display_size_virtual im_cputs im_get_display_type im_cputs_ex im_putchar im_erase_line im_puts im_get_cursor_xy im_set_cursor_xy im_get_display_mode im_set_display_mode im_get_display_size_physical

Example: Clearing the Screen // This segment clears the display and returns the cursor to the upper left corner. // Next, it sets the cursor to an underline. // #include "im64psk.h" void main() { IM_STATUS status;

// Results of call im_clear_screen(); // Add your code segment here }

2-4

Page 27

Programming Guidelines

2

Input Functions Use the input functions to receive data or to retrieve the length or bar code symbology of previous input. You can receive a file, a field, a buffer, or one or more characters from the keyboard, scanner, or communications port. For compatibility with JANUS devices, the PSK supports input mode functions. For more information on input modes, see Chapter 4, “Converting Trakker Antares and JANUS Applications to 6400 Applications.” The PSK includes these input functions: im_get_input_mode im_receive_buffer im_get_label_symbology im_receive_field im_get_label_symbologyid im_receive_input im_get_length im_set_input_mode im_input_status

Example: Setting Input Mode and Source // This segment sets the 6400 in programmer mode to accept a string of characters. // The string is NOT sent until you press Enter, and you can use backspace to // make a correction before pressing Enter. // #include "imstdio.h" #include "im64psk.h" void main() { IM_UCHAR input [1024]; IM_STATUS status; // Results of call IM_USHORT source; // Input sources im_clear_screen(); im_set_input_mode(IM_PROGRAMMER); printf("Scan or Type data.\nPress Enter to \nend line.\n"); /* Request input from label or keypad*/ source = IM_LABEL_SELECT | IM_KEYBOARD_SELECT; status = im_receive_input(source, IM_INFINITE_TIMEOUT, &source, input); }

2-5

Page 28

6400 PSK Reference Manual

Sound Function Use the im_sound function anytime to make the 6400 beep. You can use this function to control the volume, pitch, and duration of the 6400 beep.

Example: Sound // This segment beeps a high note, pauses 5 seconds, and then beeps a low note. #include "im64psk.h" void main() { im_sound( IM_HIGH_PITCH, IM_BEEP_DURATION, IM_NORMAL_VOLUME); im_standby_wait(5000); im_sound( IM_LOW_PITCH, IM_BEEP_DURATION, IM_NORMAL_VOLUME); }

Status Code Macros Use the status code macros to determine the success of a function without testing for an explicit value. Each PSK library function returns a specific status value. For most functions, you only need to know if the result was a success or failure. Your program is easier to maintain, update, and port to another 6400 type when you check for success or failure instead of checking for a specific value. Status Code Macro

Return Value

Meaning

IM_ISERROR(status)

nonzero zero (0)

error success or warning

IM_ISSUCCESS(status)

nonzero zero (0)

success or warning error

IM_ISGOOD(status)

nonzero zero (0)

success warning or error

IM_ISWARN nonzero zero (0)

warning success or error

For more information, see Chapter 5, “PSK Function Descriptions.” Note: For compatibility with other Intermec products, use the status code macros. You can use the exact status code for debugging programs, but you need to adjust the routines before you attempt porting the application to a JANUS device. For help, see Chapter 4, “Converting Trakker Antares and JANUS Applications to 6400 Applications.”

2-6

Page 29

Programming Guidelines

2

Example: Status Code Macros /* This segment requests label input and then checks for success. */ /* If successful, then retrieve the label symbology. */ /* If an error occurs, then displays the error message */ #include "im64psk.h" void main() { char input[1024]; IM_ORIGIN source; IM_STATUS status; IM_DECTYPE symbol;

// Input buffer (input from network must be 1024 characters) // Source(s) where input is to come from // Results of call // Symbology 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); }

System Functions Use the system functions to control the 6400 configuration or to set an event timer. im_command im_event_wait im_set_time_event

Example: Configuring the 6400 // This segment turns on the 6400 backlight and raises the volume. #include "im64psk.h" void main() { char IM_USHORT

*setlite_vol="%.1$+BV9"; length=8;

// //

Turn on backlight and raise beep volume Command is 8 characters long im_command(setlite_vol, length); }

2-7

Page 30

6400 PSK Reference Manual

Certified Microsoft C Functions This table lists all Microsoft C functions that work with the PSK library functions. The PSK does not support C++, classes, application-wide constructors or destructors, or Windows functions. Note: The PSK requires Microsoft Visual C/C++, Professional Edition v1.0 or v1.5x, which can create 16-bit DOS applications. See “Microsoft C/C++ Version Requirements” in Chapter 1 for more information.

2-8

_cabs

_fstrcmp

_getch

_nstrdup

_cputs

_fstrcpy

_getchar

_onexit

_ecvt

_fstrcspn

_getche

_putch

_fabs

_fstricmp

_hypot

_rotl

_fatexit

_fstrlen

_int86x

_rotr

_fcloseall

_fstrlwr

_isascii

_strdup

_fcvt

_fstrncat

_iscsym

_stricmp

_ffree

_fstrncmp

_iscsymf

_strlwr

_fmalloc

_fstrnicmp

_itoa

_strnicmp

_fmemccpy

_fstrnset

_lfind

_strnset

_fmemchr

_fstrpbrk

_lrotl

_strrev

_fmemcmp

_fstrrchr

_lrotr

_strset

_fmemcpy

_fstrrev

_lsearch

_strupr

_fmemicmp

_fstrset

_ltoa

_swab

_fmemmove

_fstrspn

_matherr

_toascii

_fmemset

_fstrtok

_max

_tolower

_FP_OFF

_fsts

_memccpy

_toupper

_FP_SEG

_ftime

_memicmp

_ultoa

_fstrcat

_gcvt

_min

_ungetch