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 9 of 36

Trakker Antares Application Development Tools System Manual: Part I - Trakker Antares PSK Reference Manual, pages 75 to 84

Pages 75 to 84 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 75

Chapter 5, PSK Function Descriptions

IN Parameters string attrib

OUT Parameters Return Value

Far pointer to the text string to be displayed. Attribute mask and is any combination of these constants: IM_NORMAL Plain text IM_BLINK Blinking text IM_BOLD Bold text IM_INVERSE Inverse color text IM_UNDERLINE Underlined text

None This function returns one of these codes: IM_SUCCESS IM_BAD_ADDRESS IM_INVALID_PARAM_1

Notes

Success Invalid string address Invalid attribute value

This function is similar to im_puts, except that it does not append a carriage return or line feed (CR LF) to the string.

See Also im_get_screen_char, im_get_text, im_putchar, im_puts

Example See example for im_get_display_mode on page 72.

im_cursor_to_viewport Purpose

Syntax

This function moves the cursor to the center of the current viewport. Since the viewport can move around with or without the cursor, you can use this function to center the cursor. #include "imt24lib.h" void im_cursor_to_viewport(void);

IN Parameters

None

OUT Parameters

None

Return Value

None

Notes

The 2460 and 2461 terminals do not support this function.

See Also im_viewport_end, im_viewport_home, im_viewport_page_down, im_viewport_page_up, im_viewport_to_cursor, im_viewport_move

Example See example for im_viewport_setxy on page 204.

Trakker Antares PSK Reference Manual

55

Page 76

Chapter 5, PSK Function Descriptions im_dbyte_symbology_set Purpose Syntax

This function determines if you are scanning a double-byte symbology. #include "imt24lib.h" IM_BOOL im_dbyte_symbology_set( )

IN Parameters

None

OUT Parameters

None

Return Value

This function returns one of these codes: IM_TRUE IM_FALSE

Notes

Double-byte symbology was scanned Single-byte symbology was scanned

A double-byte symbology encodes data that may contain a Chinese, Japanese, or Korean font. These international fonts require two bytes to present a character in the font. When a double-byte symbology is scanned, you need to double the length of the buffer to store the double-byte character. Currently, the Application Simulator cannot simulate double-byte symbologies. The 2460 and 2461 terminals do not support this function.

im_display_thai_char Purpose Syntax

56

This function displays a Thai character on the terminal screen. #include "imt24lib.h" IM_STATUS far im_display_thai_char (IM_USHORT basechar, IM_SHORT phonetic1, IM_SHORT phonetic2, IM_SHORT phonetic4, IM_ATTRIBUTES attrib)

Trakker Antares PSK Reference Manual

Page 77

Chapter 5, PSK Function Descriptions

IN Parameters basechar phonetic1 phonetic2 phonetic4 attrib

OUT Parameters Return Value

Base Thai character that appears at level 3. Phonetic character that appears at level 1. Phonetic character that appears at level 2. Phonetic character that appears at level 4. Attributes mask and is any combination of these constants: IM_NORMAL Plain text IM_BLINK Blinking text IM_INVERSE Inverse color text IM_UNDERLINE Underlined text

None This function returns one of these codes: IM_SUCCESS IM_INVALID_COLUMN IM_INVALID_ROW IM_ACCESS_DENIED

Notes

Success Invalid column set for phonetic1, phonetic2, or phonetic4 Invalid row set for basechar Thai character set not found

You must have the Thai character set installed on the host and enable mixed mode in order to use this function. The Thai language is a singlebyte character set in which the characters can occupy four zones or levels. Most Thai characters are consonants that occupy the middle level 3. Tone and vowel characters occupy the upper levels 1 and 2 and the lower level 4. As a result, Thai words are composed of multiple characters that can occupy several zones of the same character space. If you set phonetic1, phonetic2, or phonetic4 to -1, the parameter is ignored.

im_erase_display Purpose Syntax

This function erases a portion of the display. #include "imt24lib.h" void im_erase_display (IM_ERASE_CONTROL erase);

IN Parameters erase

Flag that specifies the area to erase and is one of these constants: IM_ALL Erases the entire screen IM_CURS_TO_END Erases from the current cursor position to the end of the display IM_START_TO_CURS Erases from the start of the display to the current cursor position

Trakker Antares PSK Reference Manual

57

Page 78

Chapter 5, PSK Function Descriptions im_erase_display (continued) OUT Parameters

None

Return Value

None

Notes

If viewporting is enabled, this function erases to the beginning or end of the virtual display. The “erased” portion of the display is filled with spaces without display attributes.

See Also im_clear_screen, im_erase_line

Example See example for im_erase_line on page 59.

im_erase_line Purpose Syntax

This function erases a portion of the current line. #include "imt24lib.h" void im_erase_display (IM_ERASE_CONTROL erase);

IN Parameters erase

OUT Parameters

None

Return Value

None

Notes

Flag that specifies the area to erase and is one of these constants: IM_ALL Erases the entire line IM_CURS_TO_END Erases from the current cursor position to the end of the line IM_START_TO_CURS Erases from the start of the line to the current cursor position

If viewporting is enabled, this function erases to the beginning or end of the virtual line. The “erased” portion of the display is filled with spaces without display attributes.

See Also im_clear_screen; im_erase_display

58

Trakker Antares PSK Reference Manual

Page 79

Chapter 5, PSK Function Descriptions

Example /********************* im_erase_line *********************************/ #include "imt24lib.h" #include "imstdio.h" IM_ERASE_CONTROL fErase;

void main(void) { int x; im_clear_screen(); /* Clear the screen */ /* Print sample lines to be erased */ for(x=0;x<16;x++) printf("ABCDEFGHIJKLMOPQRST\n"); /* Move cursor to desire position Row,Col */ im_set_cursor_xy(5,5); /* Set fErase flag */ /* IM_CURS_TO_END - delete from cursor to end of line */ /* IM_START_TO_CURS - delete from start to end of line */ /* IM_ALL - delete entire line */ fErase = IM_START_TO_CURS; /* Erase line as specified by fErase flag */ im_erase_line(fErase); getch(); im_erase_display(IM_START_TO_CURSOR); getch(); }

Trakker Antares PSK Reference Manual

59

Page 80

Chapter 5, PSK Function Descriptions im_event_wait Purpose Syntax

This function waits for one or more events and returns a flag indicating that the event occurred or a timeout occurred. #include "imt24lib.h" IM_STATUS im_event_wait (IM_UINT timeout, IM_ORIGIN far *source);

IN Parameters timeout

IN/OUT Parameters source

60

Numeric value or a constant: 1 to 65,534 ms Numeric range IM_INFINITE_TIMEOUT Wait forever IM_ZERO_TIMEOUT No wait Passes in the sources allowed and passes out 0 (zero) or the first source with a complete event. The source passed in is any combination of these constants: 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 or TCP/IP): 2415, 2425, 2435, 2455, and 2475 - RF port, 248X - RF port or Ethernet port on enhanced I/O board Does not know if a socket was opened using a BSD sockets interface function. 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 IM_LABEL_SELECT Label input: 241X, 242X, 243X, 2455, and 2475 - Integrated scan module or module for cabled scanners, 2475 - any attached scanner, 248X - Badge scanner or any attached scanner

Trakker Antares PSK Reference Manual

Page 81

Chapter 5, PSK Function Descriptions

IM_OPTICAL_ 248X - Optical sensor input SELECT IM_KEYBOARD_ Keypad input SELECT IM_ALL_SELECT All input sources IM_TIMER_SELECT Timer expired The source passed out is any one of the above constants. OUT Parameters Return Value

None This function returns one of these codes: IM_SUCCESS IM_TIMEDOUT

Notes

Success Timeout occurred before receiving data

This function is not required for any of the input or output functions. This function does not clear the source state flags. To clear the flags, call an input function such as im_receive_buffer or im_receive_input. Use IM_TIMER_SELECT for the source to act on a timed event instead of waiting for a keyboard, COM port, optical sensor, or network event. Because no events are assigned to serial data transmission, im_event_wait is not valid for transmits using serial ports.

Example /********************* im_event_wait *********************************/ #include "imt24lib.h" #include "imstdio.h" #include "ctype.h" #include "conio.h" void main (void) { IM_UCHAR inChar='x', szNetBuffer[1024]; IM_USHORT iLength, iCountMinutes=0; IM_ORIGIN iSource; IM_STATUS iStatus; im_set_time_event (60000); while ( toupper (inChar != 'Q') ) { iSource = IM_KEYBOARD_SELECT | IM_TX_NET_SELECT | IM_TIMER_SELECT; iStatus = im_event_wait(3000, &iSource); if (IM_ISGOOD (iStatus) ) { if (iSource == IM_KEYBOARD_SELECT) inChar = getch ( ); if (iSource == IM_TX_NET_SELECT) iStatus = im_receive_buffer( IM_NET, 1024, szNetBuffer, 600, &iLength);

Trakker Antares PSK Reference Manual

61

Page 82

Chapter 5, PSK Function Descriptions im_event_wait (continued) if (iSource == IM_TIMER_SELECT) /* Get this once per minute even if receive messages in between */ { iCountMinutes++; im_set_time_event (60000); } } else { im_puts((IM_UCHAR *)"Timeout on event wait", IM_BOLD); } } printf ("Ran %d minutes\n\r", iCountMinutes); } im_file_duplicate Purpose

This function copies an existing file.

Syntax

#include "imstdio.h" #include "imt24lib.h" IM_STATUS im_file_duplicate (IM_UCHAR *source, IM_UCHAR *destination)

IN Parameters source destination OUT Parameters Return Value

Pointer to the source file name. The file name must contain the drive letter and the name. Pointer to the destination file name. The file name must contain the drive letter and the name.

None This function returns one of these codes: IM_SUCCESS IM_INVALID_FILE

Notes

62

File copy was successful Invalid file specified or destination file already exists

This function does not overwrite an existing file and will fail if the destination file exists.

Trakker Antares PSK Reference Manual

Page 83

Chapter 5, PSK Function Descriptions

Example /*********************** im_file_duplicate *********************/ /* im_free_space, im_file_size, im_file_time */ #include <string.h> #include <time.h> #include "imstdio.h" #include "imt24lib.h" #include <conio.h> void main( void) { int iStatus; long lDisk_space = 0L; time_t ltime; im_clear_screen(); /* Check available free space of file system */ iStatus = im_free_space("c:", &lDisk_space); printf("Free Space: %ld\n", lDisk_space); getch(); /* Duplicate the current executable file */ iStatus = im_file_duplicate("c:filesys.bin", "c:im_xxx.bin"); printf("copy: %x\n", iStatus); getch(); /* Check new available free space of file system */ iStatus = im_free_space("c:", &lDisk_space); printf("New free Space: %ld\n", lDisk_space); getch(); /* Display file's time stamp */ iStatus = im_file_time("c:filesys.bin", &ltime); printf("time: %x\n", iStatus); printf("%s\n", ctime(&ltime)); getch(); /* display file's date stamp */ iStatus = im_file_size("c:filesys.bin", &lDisk_space); printf("size: %x\n", iStatus); printf("%ld\n", lDisk_space); getch(); }

Trakker Antares PSK Reference Manual

63

Page 84

Chapter 5, PSK Function Descriptions im_file_size Purpose Syntax

This function returns the size of the target file. #include "imstdio.h" #include "imt24lib.h" IM_STATUS im_file_size (IM_CHAR *fname, IM_LONG *size)

IN Parameters fname OUT Parameters size Return Value

A pointer to IM_CHAR. This variable points to a string that must include the drive letter and filename. A pointer to IM_LONG. im_file_size places the size of the specified file here.

This function returns one of these codes: IM_SUCCESS IM_INVALID_FILE

Success Invalid file specified

Example See example for im_file_duplicate on page 63.

im_file_time Purpose Syntax

This function returns the time stamp of the target file. #include "imstdio.h" #include "imt24lib.h" IM_STATUS im_file_time (IM_CHAR *fname, time_t far *ltime)

IN Parameters fname

OUT Parameters ltime

Return Value

Pointer to IM_CHAR. This variable points to a string that must contain a drive letter and a file name. Far pointer to standard C-type time variable. im_file_time places the time stamp here.

This function returns one of these codes: IM_SUCCESS IM_INVALID_FILE

Notes

Success Target file not found or does not exist

The time_t variable is the same as the one used in the MS-DOS C standard time definition and is defined as: typedef long time_t;

64

Trakker Antares PSK Reference Manual