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

6400 PSK Reference Manual, pages 91 to 100

Pages 91 to 100 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 91

im_get_label_symbology

5 im_get_label_symbology Purpose:

This function gets the symbology, such as Code 39, from the most recently scanned label. Call this function after receiving data using im_receive_input or im_receive_field.

Syntax:

#include "im64psk.h" IM_STATUS im_get_label_symbology (IM_DECTYPE far *symb);

IN Parameters: OUT Parameters:

None. symb Identifies the label symbology and is one of these constants: IM_UNKNOWN_DECODE Unknown bar code IM_CODABAR Codabar bar code IM_CODE_39 Code 39 bar code IM_CODE_128 Code 128 bar code IM_I_2_OF_5

Interleaved 2 of 5

IM_MSI MSI bar code IM_UPC Return Value:

Universal Product code

This function returns one of these codes: IM_SUCCESS

Successfully retrieved

IM_NO_SYMBOLOGY See Also:

No symbology code available, or no scans received im_receive_input, im_receive_field, im_get_label_symbologyid

Example /********************* im_get_label_symbology **********************/ #include <conio.h> #include "stdio.h" #include "im64psk.h" static char *bar_code[] = { "unknown", "Code 39", /* See typedef enum { ...} IM_DECTYPE in Im64psk.h*/ "I 2 of 5", "Codabar", "UPC and EAN", "Code 128", "MSI" }; void main (void) { IM_UCHAR input[256]; IM_ORIGIN source; IM_DECTYPE symbol;

5-35

Page 92

im_get_label_symbology im_get_label_symbology (continued) im_clear_screen(); /* Clear the screen */ im_cputs("Demo im_get_label_symbology\n'q' to quit\n"); /* Input loop */ do { source = IM_LABEL_SELECT | IM_KEYBOARD_SELECT; im_receive_field(source, IM_INFINITE_TIMEOUT, IM_INVERSE, IM_RETURN_ON_FULL, 10, &source, input); printf("\nReceive Field:\n"); printf("%s\n", input); im_get_label_symbology( &symbol); /* Display symbology */ printf("\nSYMBOLOGY: %d\n%s\n", symbol, bar_code[symbol]); } while (input[0] != 'q' && input[0] != 'Q'); /* 'q' to quit */ }

5-36

Page 93

im_get_label_symbologyid

5 im_get_label_symbologyid Purpose:

This function gets the AIM symbology ID, such as ]A0, from the most recently scanned label. Call this function after receiving data using im_receive_input or im_receive_field.

Syntax:

#include "im64psk.h" IM_STATUS im_get_label_symbologyid (IM_UCHAR far *symb);

IN Parameters: OUT Parameters:

Return Value:

None. symb Pointer to the buffer for the label symbology ID string and must be at least 6 bytes in length. This function returns one of these codes: IM_SUCCESS

Successfully retrieved

IM_NO_SYMBOLOGY See Also:

No symbology code available, or no scans received im_receive_input, im_receive_field, im_get_label_symbology

5-37

Page 94

im_get_length im_get_length Purpose:

This function returns the length of the string received from the designated source by the most recent input function (im_receive_input, im_receive_field, or im_receive_buffer).

Syntax:

#include "im64psk.h" IM_USHORT im_get_length (IM_ORIGIN source);

IN Parameters:

source

Specifies the source of the input. Choose one of these constants:

IM_LABEL_SELECT

Label selected

IM_KEYBOARD_SELECT

OUT Parameters:

Keypad selected

IM_COM1_SELECT

COM1 selected

IM_NET_SELECT

Network selected

None.

Return Value:

This function returns the length of the last input string read from the designated source.

Notes:

All input from the keypad or labels has a null termination character added to the end of the string so that it can be used as a normal C string. However, some data might contain embedded null characters, such as data from COM or NET sources. If so, this function supplies the true data length.

See Also:

im_receive_input, im_receive_field

Example See example for im_receive_input.

5-38

Page 95

im_get_postamble

5 im_get_postamble Purpose:

This function retrieves the current postamble.

Syntax:

#include "im64psk.h" IM_STATUS im_get_postamble (IM_UCHAR *post_string, IM_USHORT *length);

IN Parameters: OUT Parameters:

None. The post_string parameter is the buffer containing the postamble. The length parameter is the length of the postamble.

Return Value: Notes: See Also:

IM-SUCCESS The buffer must be large enough to contain the postamble string. im_get_postamble, im_get_config_info

Example /******************** im_get_postamble *******************************/ #include <stdio.h> #include <string.h> #include "im64psk.h" void main(void) { IM_STATUS status; IM_USHORT length; IM_UCHAR post_string[128]; // Use im_get_postamble to get the Postamble string im_cputs("\nim_get_postamble Example \n", IM_NORMAL); status = im_get_postamble(post_string, &length); // Print the results printf("\nPostamble: %s", post_string); printf("\nlength : %d", length); printf("\nstatus : %d\n", status); }

5-39

Page 96

im_get_preamble im_get_preamble Purpose:

This function retrieves the current preamble.

Syntax:

#include "im64psk.h" IM_STATUS im_get_preamble (IM_UCHAR *pre_string, IM_USHORT *length);

IN Parameters: OUT Parameters:

None. The pre_string parameter is the buffer containing the preamble. The length parameter is the length of the preamble.

Return Value: Notes: See Also:

IM_SUCCESS The buffer must be large enough to contain the preamble string. im_get_postamble, im_get_config_info

Example /******************** im_get_preamble *******************************/ #include <stdio.h> #include <string.h> #include "im64psk.h" void main(void) { IM_STATUS status; IM_USHORT length; IM_UCHAR pre_string[128]; // Use im_get_preamble to get the Preamble string im_cputs("\nim_get_preamble Example \n", IM_NORMAL); status = im_get_preamble(pre_string, &length); // Print the results printf("\nPreamble: %s", pre_string); printf("\nlength : %d", length); printf("\nstatus : %d", status); }

5-40

Page 97

im_get_screen_char

5 im_get_screen_char Purpose:

This function returns the character at the current cursor position in the 80x25 virtual display.

Syntax:

#include "im64psk.h" IM_STATUS im_get_screen_char (IM_UCHAR far *char); None

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

char

Pointer to the variable for the retrieved character.

IM_SUCCESS Success This function returns only the character. Use im_get_text to retrieve the character and its attributes. im_get_text, im_putchar, im_puts

Example /********************* im_get_screen_char ****************************/ #include " im64psk.h " IM_UCHAR value;

void main() { int x = 1; /* Row Value */ int y = 10; /* Column Value */ im_clear_screen(); /* Clear display screen */ /* Display letters and numbers to chose from */ im_cputs("ABCDEFGHIJKLMNOPQRST\n", IM_NORMAL); printf("UVWXYZ-0123456789\n"); /* Chose character by setting Row and Col values */ im_set_cursor_xy(x,y); /* Retrieve character at position specified */ im_get_screen_char(&value); /* State which character was chosen */ im_set_cursor_xy(3,0); printf("The character chosen:\n"); printf("is: %1c",value); /* Wait for user input before exiting */ im_set_cursor_xy(14,0); im_puts("Press any key to", IM_NORMAL); im_puts("exit.", IM_NORMAL); /* Move cursor to character chosen */ im_set_cursor_xy(x,y); getch(); }

5-41

Page 98

im_get_text im_get_text Purpose:

This function returns a rectangular section of text and its attributes from the 80 x 25 virtual display. You specify a starting row and column and ending row and column.

Syntax:

#include “im64psk.h” IM_STATUS im_get_text (IM_USHORT start_col, IM_USHORT start_row, IM_USHORT end_col, IM_USHORT end_row, IM_DISPLY_TEXT_S far *text_array);

IN Parameters:

start_col

Starting column.

start_row

Starting row.

end_col

Ending column.

end_row Ending row. OUT Parameters:

text_array Array of type display text large enough to receive the data represented by the screen section. text_array[n] Contains the attribute, where n is an odd number. text_array[m]

Return Value:

Contains the character, where m is an even number.

This function returns one of these codes: IM_SUCCESS

Successfully returned text and attributes

IM_INVALID_END returned.

The ending location is outside the virtual display. No data

IM_INVALID_PAIR The end row/column combination is before the start row/column combination. No data returned. IM_INVALID_START The starting location is outside the virtual display. No data returned. Notes:

See Also:

5-42

The retrieved data includes a one-byte attribute and a one-byte character. The order is character, attribute, character, attribute, and so on. The buffer size must be larger than (end_col – start_col + 1) × (end_row – start_row+ 1) × 2. im_get_screen_char, im_put_text, im_putchar, im_puts

Page 99

im_get_text

5 im_get_text (continued) Example /********************* im_get_text ***********************************/ #include “im64psk.h” IM_DISPLAY_TEXT_S tArray[100]; IM_UCHAR sArray[100];

/* Array containing char. and attr. */ /* for each char. pos. in the range.*/

IM_STATUS

/* Return status of calling function */ status;

void main() { int x; im_clear_screen();

/* Display a clean screen */

/* Print text to be retrieved and put at different location */ for (x = 0; x < 2; x++) { im_cputs("AaA",IM_NORMAL); im_puts("BbBbBbBbBbBb",IM_NORMAL); im_cputs("CcC",IM_NORMAL); im_puts("DdDdDdDdDdDd",IM_NORMAL); } /* Get text at specified location including attributes */ im_get_text(3,0,7,6,tArray); im_set_cursor_xy(5,0); im_puts("Press enter to see",IM_NORMAL); printf("marked text moved."); getch(); im_clear_screen(); /* Display the text and attribute at position specified */ im_set_cursor_xy(0,0); im_puts("Block of Text chosen", IM_NORMAL); im_puts("to be move was..", IM_NORMAL); status = im_put_text(0,5,4,11,tArray); /* Display return status of the calling function */ // im_message(status); getch(); }

5-43

Page 100

im_get_tx_status im_get_tx_status Purpose:

This function returns the status of the last call to im_transmit_buffer.

Syntax:

#include "im64psk.h" IM_STATUS im_get_tx_status (IM_COM_PORT comport);

IN Parameters:

comport Desired communications port: IM_COM1 COM1 input IM_NET

OUT Parameters: Return Value:

Network input

None. This function returns one of these codes: IM_COMM_INUSE

Communications port in use

IM_NS_COMPLETE Transmission completed IM_NS_CANCELLED Transmission canceled IM_NS_ERROR Communications error Notes:

If you need to determine if the buffer is empty, use im_event_wait or im_input_status instead of this function. The status is invalid until you call im_transmit_buffer or im_transmit_buffer_nowait_t.

See Also:

5-44 im_transmit_buffer, im_transmit_buffer_nowait_t