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

6400 PSK Reference Manual, pages 101 to 110

Pages 101 to 110 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 101

im_get_tx_status

5 im_get_tx_status (continued) Example /********************** im_get_tx_status *****************************/ #include <string.h> #include "im64psk.h" void main(void) { char szBuffer[1024]; IM_STATUS iStatus, xStatus; IM_USHORT iCommLength; IM_COM_PORT portid; im_clear_screen();

/* clear the display screen */ portid = IM_NET;

/* set port to network */

/* transmit buffer and get return status */ xStatus = im_transmit_buffer(portid, strlen(szBuffer),szBuffer,IM_ZERO_TIMEOUT); /* get status of the last call to im_transmit_buffer */ iStatus = im_get_tx_status(portid); if( iStatus == IM_SUCCESS) { /* if successful, display data in buffer and data length */ printf("Data receive is:%s\n\n",szBuffer); printf("Length of data is:%u\n\n",iCommLength); } else { /* if not successful, print error values and code */ im_cputs("Transmit buffer error\n", IM_NORMAL); printf("The status is %i\n",iStatus); im_message(xStatus); } }

5-45

Page 102

im_get_viewport_lock im_get_viewport_lock Purpose:

This function retrieves the current setting of the viewport lock. The viewport lock enables or disables moving the viewport with the keyboard. Your application program may require the viewport to be locked or unlocked.

Syntax:

#include " im64psk.h " IM_STATUS im_get_viewport_lock (IM_CONTROL *viewport_lock);

IN Parameters: OUT Parameters:

None. The viewport_lock parameter is one of these constants: IM_ENABLE

Viewport is locked.

IM_DISABLE Viewport is unlocked. Return Value:

This function returns one of these codes: IM_SUCCESS Success IM_VP_DISABLED

Notes:

See Also:

Viewporting is not enabled, and viewport is locked.

When the viewport is "locked," the viewport movement keys do not move the viewport. The 6400 terminals default to viewport unlocked when viewporting is enabled. im_set_viewport_lock, im_get_follow_cursor, im_set_follow_cursor

Example /******************** im_get_viewport_lock *******************************/ /* Also with: im_set_viewport_lock */ #include <stdio.h> #include <conio.h> #include <ctype.h> #include "im64psk.h" #define

ESC_CHAR

0x1B void main (void) { IM_UCHAR ch, user_option; IM_CONTROL current_viewport_lock; im_clear_screen();

/* Clear screen */

/* Get the current status of viewport lock for restore later */ im_get_viewport_lock(&current_viewport_lock); /* Get user's input option, 'y' for disable viewport lock */ im_cputs("\nEnable viewport\nlock(y)?", IM_NORMAL);

5-46

Page 103

im_get_viewport_lock

5 im_get_viewport_lock (continued) user_option = toupper( getch()); if (user_option == 'Y') { /* Enable viewport lock */ im_set_viewport_lock(IM_ENABLE); im_cputs("\n\n'ESC' to quit!\nType f and arrow keys\n" , IM_NORMAL); printf("See viewport lock!"); } else { /* Disable viewport lock */ im_set_viewport_lock(IM_DISABLE); im_cputs("\n'ESC' to quit\nType f and arrow keys\n", IM_NORMAL); im_cputs("See viewport unlock!", IM_NORMAL); } /* Enter characters loop to check viewport movement until 'ESC' key. */ while ( (ch = getch()) != ESC_CHAR ) putch(ch); /* Restore viewport lock */ im_set_viewport_lock(current_viewport_lock); }

5-47

Page 104

im_get_viewporting im_get_viewporting Purpose:

This function determines if viewporting is enabled or if the terminal is treated as a device with a small screen.

Syntax:

#include "im64psk.h" void im_get_viewporting (IM_CONTROL viewport);

IN Parameters:

viewport Flag and is one of these constants: IM_ENABLE

Viewporting is enabled.

IM_DISABLE

Viewporting is disabled.

OUT Parameters:

None

Return Value:

None

Notes:

See Also:

If viewporting is enabled, the terminal accepts viewport movement commands, including follow-the-cursor mode. All cursor positioning is relative to the virtual display. im_get_viewport_lock, im_set_follow_cursor, im_set_viewport_lock, im_set_viewporting

Example /***************** im_get_viewporting *******************/ #include "im64psk.h" #include <ctype.h> #include <conio.h> IM_CONTROL viewport; IM_UCHAR ch; char ii; void main(void) { char cChoice,exit; do { /* Display a new screen */ im_clear_screen(); /* Print the header */ im_cputs("Get Viewport Test\n\n"); im_cputs("Enable Viewporting? Y/N\n"); cChoice = getch(); cChoice = toupper(cChoice); /* Set the viewporting parameter */ if(cChoice == 'Y')

5-48

Page 105

im_get_viewporting

5 im_get_viewporting (continued) { im_set_viewporting(IM_ENABLE); printf("hi howdy"); } else if(cChoice == 'N') { im_set_viewporting(IM_DISABLE); printf("ho ho ho"); } else printf("Choose Y or N"); /* Get viewport mode set */ viewport = im_get_viewporting(); printf("setting viewport"); if (viewport == IM_ENABLE) { im_clear_screen(); im_cputs("The viewport is now enabled\n"); im_cputs("Move cursor off screen to\n"); im_cputs("check viewport movement.\n"); im_cputs("Press 'Q' to quit\n\n"); im_set_follow_cursor(viewport); while ((ch = getche()) != 'Q'); } else { im_clear_screen(); im_cputs("The viewport is now disabled\n"); im_cputs("Move cursor off screen to\n"); im_cputs("check viewport movement.\n"); im_cputs("Press 'Q' to quit\n\n"); im_set_follow_cursor(viewport); while ((ch = getche()) != 'Q'); } printf("\n\nExit?"); exit = getch(); exit = toupper(exit); }while(exit != 'Y'); }

5-49

Page 106

im_input_status im_input_status Purpose:

This function provides compatibility with the JANUS PSK functions. This function checks to see if any input buffers have data and returns the buffer identification.

Syntax:

#include "im64psk.h" IM_ORIGIN im_input_status ();

IN Parameters:

None.

OUT Parameters:

None.

Return Value:

This function returns one or more of these constants: IM_NO_SELECT

No input buffer has data

IM_KEYBOARD_SELECT

Notes:

See Also:

5-50

Key was pressed

IM_COM1_SELECT

COM1 selected

IM_NET_SELECT

Network received data

IM_ALL_SELECT

All input buffers are selected

To avoid entering a battery-wasting infinite loop waiting for input, use an input function instead. im_receive_input, im_receive_field

Page 107

im_irl_v

5 im_irl_v Purpose:

This function receives input from any specified source in any format, in the same manner as an IRL command V (universal input). For more information on IRL and command V, refer to the IRL Programming Reference Manual.

Syntax:

#include "im64psk.h" IM_USHORT im_irl_v (IM_USHORT timeout, IM_CONTROL edit, IM_LABEL_BEEP_CONTROL beep, IM_CONTROL display, IM_ORIGIN *source, IM_UCHAR *instring, IM_USHORT *cmd_count, IM_DECTYPE *symbology);

IN Parameters:

timeout Receive timeout period. The return status indicates whether the function was successful or a timeout occurred. Numeric value or one of these constants: 1 to 65,534 ms

Numeric range

IM_ZERO_TIMEOUT

No wait

IM_INFINITE_TIMEOUT Wait forever. The function does not return until the end of message character has been received. edit Determines whether the wedge reader parses reader commands. Use one of these constants: IM_DISABLE data.

Disable reader command parsing. Reader commands are treated as

IM_ENABLE

Enable reader command parsing beep Determines whether the IRL V command beeps or not when data is entered. This parameter is one of these constants: IM_APPLI_BEEP Application controls the beep. You code the application to sound a beep when your program design requires one. IM_WEDGE_BEEP entered.

Beeps occur automatically. The 6400 always beeps when data is display Determines if the data is displayed as it is entered. The display parameter is one of these constants: IM_DISABLE

Disable display of data

IM_ENABLE

Enable display of data

5-51

Page 108

im_irl_v im_irl_v (continued) IN/OUT Parameters:

source Determines which input sources are allowed. When the IRL V command returns, source indicates where the data came from. When both keypad and label inputs are allowed, the source always returns keypad because it is possible for keyed and scanned data to be intermixed. Although intermixing is possible, it is not likely to occur. If you have both the keypad and scanner enabled, and you want to know where the data came from, first check • if the symbology is IM_UNKNOWN_DECODE, then the data came from the keypad.

• if the symbology is one of the other values (such as IM_CODE_39), then some or all of the data came from the scanner.

if only the scanner is enabled, then all of the data came from the scanner. source can be one of these constants: IM_NO_SELECT

No input source selected

IM_COM1_SELECT

COM1 input

IM_COM2_SELECT

COM2 input

IM_COM4_SELECT with past systems

Means IM_NET_SELECT and is provided for compatibility

IM_NET_SELECT

Network input RF port or Ethernet port on enhanced I/O board

IM_SCAN_PORT_SELECT RS-232 port input IM_LABEL_SELECT

Label input: integrated scan module or any attached scanner

IM_KEYBOARD_SELECT IM_ALL_SELECT OUT Parameters:

Keypad input

All input sources instring Input string. You must allocate at least 1024 bytes for instring if the input source includes the network port, COM1, or COM2. cmd_count Returns a 0. symbology

One of these constants:

IM_UNKNOWN_DECODE Unknown bar code IM_CODABAR Codabar bar code IM_CODE_11 Code 11 bar code IM_CODE_16K

Code 16K bar code

IM_CODE_39 Code 39 bar code IM_CODE_49 Code 49 bar code IM_CODE_93 Code 93 bar code

5-52

Page 109

im_irl_v

5 im_irl_v (continued) IM_CODE_128 Code 128 bar code IM_I_2_OF_5

Interleaved 2 of 5

IM_MSI MSI bar code IM_PLESSEY IM_UPC Return Value:

Plessey bar code

Universal Product code

This function returns one of these codes: IM_SUCCESS Successfully received input IM_TIMEDOUT

A timeout occurred

Example /********************* im_irl_v **************************************/ #include <conio.h> #include "im64psk.h" #define

COM_BUFSIZE 1024

/* allocate 1024 bytes for comm buffer */ void main (void) { IM_UCHAR *com_buffer; IM_UCHAR COM_BUFSIZE[1024]; IM_ORIGIN source; IM_USHORT cc; IM_DECTYPE symbol; /* FUNCTION BODY */ im_clear_screen(); /* Clear the screen */ im_cputs("Demo IRL V Bar code\n'C' to clear screen\n'Q' to quit\n"); do { /* Display IRL V test */ printf("IRL V test\n"); /* Set up input source with labels, keypad, and NET */ source = IM_LABEL_SELECT | IM_KEYBOARD_SELECT | IM_NET_SELECT; /* Request input from Reader Wedge */ im_irl_v(IM_INFINITE_TIMEOUT, IM_ENABLE, IM_WEDGE_BEEP, IM_ENABLE, &source, input, &cc, &symbol); /* Display input data */ printf("\n%s\n", input); /* Upper case first char of input for simplifying to test input */ input[0] = toupper(input[0]); /* If the first char in string is 'C', then clear screen.*/ if (input[0] == 'C') im_clear_screen(); } while (input[0] != 'Q'); /* 'Q' for quit */ }

5-53

Page 110

im_iserror im_iserror Purpose:

This macro determines if the return status code from another PSK function is an error (either fatal or nonfatal).

Syntax:

#include "im64psk.h" IM_ISERROR(status);

IN Parameters:

status

OUT Parameters:

None.

Return Value:

See Also:

Any PSK function that returns a status code.

This function returns one of these codes: 0

Success

Nonzero

Error (either fatal or nonfatal)

IM_ISGOOD, IM_ISSUCCESS, IM_ISWARN

Example /********************* IM_ISERROR ************************************/ #include "im64psk.h" printf("IM_ISERROR Example") status = im_sound(IM_LOW_PITCH, IM_BEEP_DURATION, IM_NORMAL_VOLUME) if IM_ISERROR(status) printf("Beep error!"); else im_cputs("Beep success or warning!", IM_NORMAL);

5-54