The text of a manual · part 15 of 36
Trakker Antares Application Development Tools System Manual: Part I - Trakker Antares PSK Reference Manual, pages 135 to 144
Pages 135 to 144 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 135
Chapter 5, PSK Function Descriptions
Example /********************* im_irl_v **************************************/ #include "imstdio.h" #include <conio.h> #include <stdlib.h> #include "immsg.h" #include "imt24lib.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 */ printf("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') clrscr(); } while (input[0] != 'Q'); /* 'Q' for quit */ im_set_beep_control(IM_WEDGE_BEEP); }
Trakker Antares PSK Reference Manual
115
Page 136
Chapter 5, PSK Function Descriptions im_irl_y Purpose
Syntax
IN Parameters
The im_irl_y function receives input from the designated communications port the same as IRL command Y (ASCII input). This function receives a single block, not an entire file. This function always clears input from the host and checks the data for terminal commands from input. Unlike the other IRL-type instructions, the data is not automatically displayed. For more information on IRL and command Y, refer to the IRL Programming Reference Manual (P/N 048609). #include "imt24lib.h" IM_STATUS im_irl_y (IM_USHORT timeout, IM_COM_PORT port_id, IM_UCHAR *eom_char, IM_PROTOCOL_CMD protocol, IM_UCHAR *instring, IM_USHORT *cmd_count);
timeout port_id
116
Receive timeout period. The return status indicates whether the function was successful or a timeout occurred. The timeout parameter is a numeric value or one of these constants: 1 to 65,534 ms Numeric range IM_ZERO_ No wait TIMEOUT IM_INFINITE Wait forever. The function does _TIMEOUT not return until the end of message character has been received. 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
Trakker Antares PSK Reference Manual
Page 137
Chapter 5, PSK Function Descriptions
IM_COM3_SELECT eom_char protocol
OUT Parameters instring cmd_count Return Value
COM3 input: 2420 Modem IM_NET_SELECT 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 IM_SCAN_PORT_ RS-232 port input: 242X SELECT Serial interface module, 2455 - Adapter cable, 248X Physical port labeled COM4 on enhanced I/O board Provides compatibility with the JANUS PSK. This parameter is ignored on the Trakker Antares terminals. Provides compatibility with the JANUS PSK. This parameter is ignored on the Trakker Antares terminals. Use the Trakker Antares menu system or im_command to control protocol on the terminal. Input string. You must allocate at least 1024 bytes for instring if the input source includes the network port, COM1, or COM2. Returns a 0.
This function returns one of these codes: IM_SUCCESS IM_TIMEDOUT
Notes
Successfully received input A timeout occurred
Trakker Antares terminals do not support IRL. This function provides compatibility with the JANUS PSK functions. For more information on IRL and command Y, refer to the IRL Programming Reference Manual (P/N 048609). Protocol is ignored for IM_COM4 and IM_NET input.
See Also im_irl_a, im_irl_k, im_irl_n, im_irl_v
Trakker Antares PSK Reference Manual
117
Page 138
Chapter 5, PSK Function Descriptions im_irl_y (continued)
Example /********************* im_irl_y **************************************/ #include "imstdio.h" #include <conio.h> #include <stdlib.h> #include "immsg.h" #include "imt24lib.h" void main (void) { IM_UCHAR input[1024]; IM_USHORT cc; IM_USHORT status; im_clear_screen();
/* Clear the screen
*/ printf("Demo IRL Y Bar Code\n'Q' to quit\n\'C' to clear screen\n"); /* Using protocol by passing IM_PROTOCOL_ON */ printf("\nUsing protocol\n"); status = im_irl_y(IM_INFINITE_TIMEOUT, IM_NET, &eom_null, IM_PROTOCOL_ON, input, &cc); /* Display input data */ printf("\nstatus: %x\n%s", status, input); /* im_irl_y input loop */ do { } while (input[0] != 'Q');
/* 'Q' to stop */
}
IM_ISERROR Purpose Syntax
This macro determines if the return status code from another PSK function is an error (either fatal or nonfatal). #include "imt24lib.h" IM_ISERROR(status);
IN Parameters status
OUT Parameters
None
Return Value
Any PSK function that returns a status code.
This function returns one of these codes: 0 Nonzero
Success or warning Error (either fatal or nonfatal)
See Also For more information, see “Status Code Macros” on page 12. IM_ISGOOD, IM_ISSUCCESS, IM_ISWARN
118
Trakker Antares PSK Reference Manual
Page 139
Chapter 5, PSK Function Descriptions
Example /********************* IM_ISERROR ************************************/ #include "imt24lib.h" #include "imstdio.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 printf("Beep success or warning!");
IM_ISGOOD Purpose
Syntax
This macro determines if the return status code from another PSK function is a success. For more information, see “Status Code Macros” on page 12. #include "imt24lib.h" IM_ISGOOD(status);
IN Parameters status
OUT Parameters
None
Return Value
Any PSK function that returns a status code.
This function returns one of these codes: 0 Nonzero
Warning or error Success
See Also IM_ISERROR, IM_ISSUCCESS, IM_ISWARN
Example /********************* IM_ISGOOD ************************************/ #include "imt24lib.h" #include "imstdio.h" printf("IM_ISGOOD example:") status = im_sound(IM_LOW_PITCH, IM_BEEP_DURATION, IM_NORMAL_VOLUME) if IM_ISGOOD(status) printf(“Beep Successful!”); else printf(“Beep warning or error!”);
Trakker Antares PSK Reference Manual
119
Page 140
Chapter 5, PSK Function Descriptions
IM_ISSUCCESS Purpose Syntax
This macro determines if the return status code from another PSK function is either success or warning. #include "imt24lib.h" IM_ISSUCCESS(status);
IN Parameters status
OUT Parameters
None
Return Value
Any PSK function that returns a status code.
This function returns one of these codes: 0 Nonzero
Error Success or warning
See Also For more information, see “Status Code Macros” on page 12. IM_ISERROR, IM_ISGOOD, IM_ISWARN
Example /********************* IM_ISSUCCESS ************************************/ #include "imt24lib.h" #include "imstdio.h" printf("IM_ISSUCCESS example:") status = im_sound(IM_LOW_PITCH, IM_BEEP_DURATION, IM_NORMAL_VOLUME) if IM_ISSUCCESS(status) printf(“Beep success or warning!”); else printf(“Beep error!”);
IM_ISWARN Purpose Syntax
120
This macro determines if the return status code from another PSK function is a warning. #include "imt24lib.h" IM_ISWARN(status);
IN Parameters status
OUT Parameters
None
Any PSK function that returns a status code.
Trakker Antares PSK Reference Manual
Page 141
Chapter 5, PSK Function Descriptions
Return Value
This function returns one of these codes: 0 Nonzero
Success or an error (either fatal or nonfatal) Warning
See Also For more information, see “Status Code Macros” on page 12. IM_ISERROR, IM_ISGOOD, IM_ISSUCCESS
Example /********************* IM_ISWARN *************************************/ #include "imt24lib.h" include "imstdio.h" printf("IM_ISWARN example:") status = im_sound(IM_LOW_PITCH, IM_BEEP_DURATION, IM_NORMAL_VOLUME) if IM_ISWARN(status) printf("Beep warning!"); else printf("Beep success or error!");
im_message Purpose
Syntax IN Parameters
This function displays the error message associated with a specific status code returned by a PSK function. Use this function to display additional information about status codes during application development. #include "imt24lib.h" void im_message(IM_USHORT status_code);
status_code
OUT Parameters
None
Return Value
None
Notes
Standard status code returned from various PSK functions.
The status message is displayed at the current cursor location without any formatting. This function links all the error messages into your application and increases the program size about 5K.
Example See example for im_receive_buffer on page 136.
Trakker Antares PSK Reference Manual
121
Page 142
Chapter 5, PSK Function Descriptions im_offset_dbyte Purpose
This function sets an internal global value that is used as an offset to adjust a double-byte font table address.
Syntax
#include "imt24lib.h" void im_offset_dbyte (IM_USHORT iDByteOffset);
Notes
The Intermec customized double-byte font table does not exactly match the BIG5 font table. As a result, this function sets an internal global value to offset the starting character address between the two font tables. For example, if the first character in the Intermec double-byte font table starts at 0xA440 in the BIG5 font table, use this function to set the internal global value to 0xA440. The PSK double-byte display functions will subtract 0xA440 from each double-byte character in the table so that the proper character appears on the terminal. Intermec recommends that you use the default input parameter of 0. Currently, the Application Simulator cannot simulate double-byte characters. The 2460 and 2461 terminals do not support this function.
im_opendir Purpose Syntax
This function opens a directory in the terminal file system. This function must be called before im_readdir. #include "imstdio.h" IM_READDIR far *im_opendir (IM_UCHAR *drive)
IN Parameters drive
OUT Parameters
None
Pointer to IM_UCHAR. This variable points to a terminal drive letter.
Return Value
Far pointer to the IM_READDIR directory structure. This pointer is the input argument to pass to im_readdir. See imstdio.h for a definition of IM_READDIR.
Notes
This function opens a directory on the terminal. Use im_readdir to read the contents of the directory. You can continually repeat the call to im_readdir to read each successive entry in the directory.
See Also im_closedir, im_readdir
122
Trakker Antares PSK Reference Manual
Page 143
Chapter 5, PSK Function Descriptions
Example /*********************** im_opendir ***************************/ /* Example of reading file information from a directory chain */ #include <string.h> #include "imstdio.h" #include "imt24lib.h" #include <conio.h> void main(void) { IM_READDIR *pzReadDir; IM_DIR *pzDir; if ( (pzReadDir = im_opendir("c:")) != NULL) { /* Walking down the directory chain */ while ( (pzDir = im_readdir(pzReadDir) ) != NULL) { printf("File Name: %s\n", pzDir->name); /* Display file name */ printf("File Size: %ld", pzDir->size); /* Display file size */ getch(); } im_closedir(pzReadDir); } else { printf("Invalid Drive.\n"); } } im_overlay_setup Purpose Syntax
IN Parameters
This function superimposes glyph font characters at the same character position. #include "imt24lib.h" IM_STATUS im_overlay_setup (IM_UCHAR start_font_scan_row, IM_UCHAR start_video_scan_row, IM_UCHAR scan_lines) ;
start_font_scan_row start_video_scan_row scan_lines
OUT Parameters
The starting scan row (0 to 15) of the glyph font to be displayed. The starting scan row (0 to 15) of the 16 by 16 area of the display panel. The number of scan rows (1 to 16) of the font to be displayed. To cancel overlay mode, set this parameter to 0.
None
Trakker Antares PSK Reference Manual
123
Page 144
Chapter 5, PSK Function Descriptions im_overlay_setup (continued) Return Value
This function returns one of these codes: IM_SUCCESS IM_INVALID_ROW
Notes
Success Value for an input parameter is out of range
Overlay mode can be used only when the terminal is in 16 x 16 display mode. You can set up overlay mode while the terminal is in another display mode (8 x 8 or 8 x 16), but overlay mode will not become active until the terminal is in 16 x 16 display mode. To cancel overlay mode, issue the im_overlay_setup function with the scan_lines input parameter set to 0. The 2460 and 2461 terminals do not support this function.
See Also im_overlay_status
Example /*********************** im_overlay_setup ***************************/ // Example of printing upper and lower part of a slash // by setting up the overlay mode. #include
"imt24lib.h" void main(void) { // turn off cursor im_set_cursor(CURSOR_OFF); //clear character location where overlaying will occur im_putchar(‘ ‘, HOLD_CURSOR); //print the upper part of a slash starting at top of the character position im_overlay_setup(0, 0, 8); im_putchar(‘/’, HOLD_CURSOR); //print the lower part of a slash starting at top of the character position im_overlay_setup(7,0,8); im_putchar(‘/’, HOLD_CURSOR); //cancel the overlay mode im_overlay_setup(0,1,0); }
124
Trakker Antares PSK Reference Manual