The text of a manual · part 13 of 36
Trakker Antares Application Development Tools System Manual: Part I - Trakker Antares PSK Reference Manual, pages 115 to 124
Pages 115 to 124 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 115
Chapter 5, PSK Function Descriptions
IN Parameters digitsinyear
OUT Parameters text_array
Return Value
Number of digits in year (0-4). start_col Starting column. start_row Starting row. end_col Ending column. end_row Ending row. 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] Contains the character, where m is an even number.
This function returns one of these codes: IM_SUCCESS IM_INVALID_END IM_INVALID_PAIR
IM_INVALID_START Notes
Successfully returned text and attributes The ending location is outside the virtual display. No data returned. The end row/column combination are before the start row/column combination. No data returned. The starting location is outside the virtual display. No data returned.
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.
See Also im_get_screen_char, im_put_text, im_putchar, im_puts
Trakker Antares PSK Reference Manual
95
Page 116
Chapter 5, PSK Function Descriptions im_get_text (continued)
Example /********************* im_get_text ***********************************/ #include "imt24lib.h" #include "imstdio.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",2); im_puts("BbBbBbBbBbBb",4); im_cputs("CcC",3); im_puts("DdDdDdDdDdDd",4); } /* Get text at specified location including attributes */ im_get_text(3,0,7,6,tArray); im_set_cursor_xy(5,0); puts("Press enter to see"); printf("marked text moved."); getch(); im_clear_screen(); /* Display the text and attribute at position specified */ im_set_cursor_xy(0,0); puts("Block of Text chosen"); puts("to be move was.."); status = im_put_text(0,5,4,11,tArray); /* Display return status of the calling function */ // im_message(status); getch(); }
96
Trakker Antares PSK Reference Manual
Page 117
Chapter 5, PSK Function Descriptions im_get_tx_status Purpose Syntax
This function returns the status of the last call to im_transmit_buffer. #include "imt24lib.h" IM_USHORT im_get_tx_status (IM_COM_PORT portid);
IN Parameters portid
OUT Parameters
None
Return Value
Desired communications port: IM_COM1_SELECT COM1 input: 241X, 242X, 243X, and 2455 - Port on bottom end of terminal, 2475 and 248X - Physical port labeled COM1 IM_COM2_SELECT COM2 input: 248X - Physical port labeled COM2 on enhanced I/O board IM_COM3_SELECT COM3 input: 2420 - Modem IM_NET_SELECT Network input (UDP Plus only): 2415, 2425, 2435, 2455, and 2475 RF port, 248X - RF port or Ethernet port on enhanced I/O board IM_SCAN_PORT_ RS-232 port input: 242X - Serial SELECT interface module, 2455 - Adapter cable, 248X Physical port labeled COM4 on enhanced I/O board
This function returns one of these codes: IM_COMM_INUSE IM_NS_COMPLETE IM_NS_CANCELLED IM_NS_ERROR IM_INVALID_PORT
Trakker Antares PSK Reference Manual
Communications port in use Transmission completed Transmission canceled Communications error Invalid network port (terminal is configured for TCP/IP instead of UDP Plus)
97
Page 118
Chapter 5, PSK Function Descriptions im_get_tx_status (continued) 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. Do not use this function with im_transmit_buffer_no_wait.
See Also im_get_rx_status, im_transmit_buffer, im_transmit_buffer_no_wait_t, im_transmit_buffer_no_wait
Example /********************** im_get_tx_status *****************************/ #include <string.h> #include "imstdio.h" #include "imt24lib.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 */ printf("Transmit buffer error\n"); printf("The status is %i\n",iStatus); im_message(xStatus); } }
98
Trakker Antares PSK Reference Manual
Page 119
Chapter 5, PSK Function Descriptions im_get_viewport_lock Purpose
Syntax
IN Parameters OUT Parameters
Return Value
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. #include "imt24lib.h" IM_STATUS im_get_viewport_lock (IM_CONTROL far *view_lock);
None view_lock
One of these constants: IM_ENABLE Viewport is locked IM_DISABLE Viewporting is not enabled, but the viewport is locked for when viewporting is enabled
This function returns one of these codes: IM_SUCCESS IM_VP_DISABLED
Notes
Success Viewporting is not enabled, but the viewport is locked for when viewporting is enabled
When the viewport is “locked,” the viewport movement keys do not move the viewport. The viewport can still move if follow-the-cursor mode is enabled. The Trakker Antares terminals default to viewport unlocked when viewporting is enabled. This function is meaningless if viewporting is disabled. The 2460 and 2461 terminals do not support this function.
See Also im_set_viewport_lock, im_get_follow_cursor, im_set_follow_cursor
Trakker Antares PSK Reference Manual
99
Page 120
Chapter 5, PSK Function Descriptions im_get_tx_status (continued)
Example /********************* im_get_viewport_lock **************************/ #include <conio.h> #include <ctype.h> #include <stdlib.h> #include "imstdio.h" #include "imt24lib.h" #define
ESC_CHAR
0x1B void main (void) { IM_UCHAR IM_CONTROL ch, user_option; current_viewport_lock;
im_clear_screen(); /* clear screen */
/* Have to enable viewporting before using any viewport display functions */ im_set_viewporting ( IM_ENABLE ); /* Get the current status of viewport lock for restore later */ im_get_viewport_lock(¤t_viewport_lock); /* Get user's input option, 'y' for disable viewport lock */ printf("\nEnable viewport\nlock(y)?"); user_option = getche(); user_option = toupper( user_option); if (user_option == 'Y') { /* Enable viewport lock */ im_set_viewport_lock(IM_ENABLE); printf("\n\n'ESC' to quit!\nType _f and arrow keys\n"); printf("to see viewport lock!\n"); } else { /* Disable viewport lock */ im_set_viewport_lock(IM_DISABLE); printf("\n'ESC' to quit\nType _f and arrow keys\n"); printf("to see viewport unlock!\n"); } /* Enter characters loop to check viewport movement until 'ESC' key. */ while ( (ch = getche()) != ESC_CHAR ) ; /* Restore viewport lock */ im_set_viewport_lock(current_viewport_lock); }
100
Trakker Antares PSK Reference Manual
Page 121
Chapter 5, PSK Function Descriptions im_get_viewporting Purpose Syntax
This function determines if viewporting is enabled or if the terminal is treated as a device with a small screen. #include "imt24lib.h" void im_get_viewporting (IM_CONTROL viewport);
IN Parameters viewport
OUT Parameters
None
Return Value
None
Notes
Flag and is one of these constants: IM_ENABLE Viewporting is enabled IM_DISABLE Viewporting is disabled
If viewporting is enabled, the terminal accepts viewport movement commands, including follow-the-cursor mode. All cursor positioning is relative to the virtual display. Scrolling and wrapping occur at the virtual screen (80 x 25) boundaries. If viewporting is disabled, the terminal does not accept any viewport movement commands. All cursor positioning is relative to the viewport upper left corner. Scrolling and wrapping occur at the viewport edges. The 2460 and 2461 terminals do not support this function.
See Also im_get_viewport_lock, im_set_follow_cursor, im_set_viewport_lock, im_set_viewporting
Example /***************** im_get_viewporting *******************/ #include "imt24lib.h" #include "imstdio.h" #include <ctype.h> #include <conio.h> #include <stdlib.h> IM_CONTROL IM_UCHAR viewport; ch;
char ii; void main(void) { char cChoice,exit; do { /* Display a new screen */ im_clear_screen();
Trakker Antares PSK Reference Manual
101
Page 122
Chapter 5, PSK Function Descriptions im_get_viewporting (continued) /* Print the header */ printf("Get Viewport Test\n\n"); printf("Enable Viewporting? Y/N\n"); cChoice = getch(); cChoice = toupper(cChoice); /* Set the viewporting parameter */ if(cChoice == 'Y') { 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(); printf("The viewport is now enabled\n"); printf("Move cursor off screen to\n"); printf("check viewport movement.\n"); printf("Press 'Q' to quit\n\n"); im_set_follow_cursor(viewport); while ((ch = getche()) != 'Q'); } else { im_clear_screen(); printf("The viewport is now disabled\n"); printf("Move cursor off screen to\n"); printf("check viewport movement.\n"); printf("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'); }
102
Trakker Antares PSK Reference Manual
Page 123
Chapter 5, PSK Function Descriptions im_input_status Purpose
Syntax
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. #include "imt24lib.h" IM_ORIGIN im_input_status (void);
IN Parameters
None
OUT Parameters
None
Return Value
This function returns one or more of these constants: IM_NO_SELECT IM_COM1_SELECT
IM_COM2_SELECT IM_NET_SELECT
IM_SCAN_PORT_ SELECT IM_LABEL_SELECT
IM_OPTICAL_SELECT IM_KEYBOARD_ SELECT IM_ALL_SELECT IM_TIMER_SELECT Notes
No input buffer has data COM1 input: 241X, 242X, 243X, and 2455 - Port on bottom end of terminal, 2475 and 248X - Physical port labeled COM1 COM2 input: 248X - Physical port labeled COM2 on enhanced I/O board Network input (UDP Plus or TCP/IP): 2415, 2425, 2435, 2455, and 2475 - RF port, 248X - RF port or Ethernet port on enhanced I/O board RS232 port input: 248X - Physical port labeled COM4 on enhanced I/O board Label input: 241X, 242X, 243X, and 2455 - Integrated scan module or module for cabled scanners, 2475 - any attached scanner, 248X - Badge scanner or any attached scanner 248X - Optical sensor input Keypad input All input sources Timer expired on an event set with im_set_time_event
To avoid entering a battery-wasting infinite loop waiting for input, use an input function instead or use im_event_wait.
See Also im_receive_input, im_receive_field, im_event_wait
Example No example. This function provides compatibility with the JANUS PSK functions. Trakker Antares PSK Reference Manual
103
Page 124
Chapter 5, PSK Function Descriptions im_irl_a Purpose
Syntax
IN Parameters
This function returns input from bar code labels or the keypad in the same manner as IRL command A (ASCII input). This function returns the input data to the buffer and displays the data. #include "imt24lib.h" IM_USHORT im_irl_a (IM_USHORT timeout, IM_LENGTH_SPEC test_table[], IM_UCHAR mask_string[], IM_UCHAR *instring, IM_USHORT *cmd_count, IM_DECTYPE *symbology);
timeout test_table a
104
Receive timeout period and is a 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. Specifies acceptable lengths for input. Data is returned only if its length matches one of the five lengths specified in the test_table. The test_table parameter is a matrix in this form: {a, b, c, d}, {a, b, c, d}, {a, b, c, d}, {a, b, c, d}, {a, b, c, d}, This position in the matrix is one of these values: IM_NO_ Accept data of any length. Set any LENGTH unused table entries to {IM_NO_LENGTH,0,0,0}. IM_LENGTH Accept data with a specific length. The actual length of the data string is placed in the d position (and b and c are not used). IM_RANGE Accept data within a length range. The data length must be within the range of b and c (and d is not used).
Trakker Antares PSK Reference Manual