The text of a manual · part 18 of 36
Trakker Antares Application Development Tools System Manual: Part I - Trakker Antares PSK Reference Manual, pages 165 to 174
Pages 165 to 174 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 165
Chapter 5, PSK Function Descriptions
See Also im_cancel_rx_buffer, im_receive_buffer, im_receive_field, im_receive_input
Example See example for im_transmit_file on page 187.
im_receive_input Purpose
Syntax
This function gets input from the specified sources and places it into the specified location. You can use the im_get_length function after this function to get the input length. #include "imt24lib.h" IM_STATUS im_receive_input (IM_ORIGIN allowed, IM_UINT timeout, IM_ORIGIN *source, IM_CHAR *received);
IN Parameters allowed
Trakker Antares PSK Reference Manual
Available input source and is one or more 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 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, and 2455 - Integrated scan module or module for cabled scanners, 2475 - any attached scanner, 248X - Badge scanner or any attached scanner IM_OPTICAL_ 248X - Optical sensor input SELECT
145
Page 166
Chapter 5, PSK Function Descriptions im_receive_input (continued)
timeout
OUT Parameters source
146
IM_KEYBOARD_ Keypad input SELECT IM_ALL_SELECT All input sources Use these variables to modify the input by performing a logical OR with the previous input sources. IM_KEYCODE_ Overrides the current input ENABLE mode by temporarily placing the terminal in a unique mode for this call only. While the terminal is in this mode, keyboard and scanned label input is returned one character per call to im_receive_input. A character is returned as 4 bytes. The first byte is the ASCII code, the second byte is the scan code, and the last 2 bytes are flags for modifier keys (Shift and Control). Receive timeout period and is one of these values: 1 to 65,534 ms Numeric range IM_ZERO_TIMEOUT No wait IM_INFINITE_ Wait forever. The function will TIMEOUT not return until the end of message character has been received. If you select COM1 or the Network port, IM_INFINITE_TIMEOUT and 0xFFFF are treated as IM_INFINITE_NET_ TIMEOUT. Pointer to IM_ORIGIN. This function places the actual source of received data at this location and is one 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
Trakker Antares PSK Reference Manual
Page 167
Chapter 5, PSK Function Descriptions
IM_NET_SELECT
IM_SCAN_PORT_ SELECT
IM_LABEL_SELECT received Return Value
IM_OPTICAL_SELECT IM_KEYBOARD_ SELECT IM_NO_SELECT No input sources selected Pointer to where the data is to be placed.
This function returns one of these codes: IM_SUCCESS IM_TIMEDOUT
Notes
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 RS-232 port input: 242X Serial interface module, 2455 - Adapter cable, 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
Success Timeout occurred
If input from more than one source is received before this function is called, the first available input is returned in this order: label, keypad, optical sensor input, COM1, COM2, COM3, scanner port, and network. For optical sensor input, the first byte in the input buffer is the current optical sensor state for each sensor and the second byte is the optical sensor state change for each sensor since the last read. For each byte - Bit 0 represents sensor 1, bit 1 represents sensor 2, bit 2 represents sensor 3, and bit 3 represents sensor 4. First byte (Sensor State) 0 Sensor off 1 Sensor on Second byte (Sensor Change) 0 1
Sensor state has not changed since the last call Sensor state has changed since the last call
See Also im_cancel_rx_buffer, im_receive_buffer, im_receive_field, im_receive_file
Trakker Antares PSK Reference Manual
147
Page 168
Chapter 5, PSK Function Descriptions im_receive_input (continued)
Example /********************* im_receive_input ******************************/ #include "imstdio.h" #include <stdlib.h> #include "imt24lib.h" IM_UCHAR input[1024];
void main (void) { IM_USHORT length; IM_ORIGIN source; IM_STATUS status; im_clear_screen();
/* Clear the screen
*/ printf("Demo \nim_receive_input\n'Q' to quit\n\'C' to clear screen\n"); /* Input loop */ do { /* Set up input source */ source = IM_LABEL_SELECT | IM_KEYBOARD_SELECT | IM_NET_SELECT; /* Request input from label, keypad or NET */ status = im_receive_input(source, IM_INFINITE_TIMEOUT, &source, input); length = im_get_length(source); if (IM_ISGOOD(status)) { /* Show the input source */ if (source == IM_LABEL_SELECT) printf("\nLabel input:\n"); else if (source == IM_KEYBOARD_SELECT) printf("\nKeybd input:\n"); else if ( source == IM_NET_SELECT) printf("\nNet input:\n"); /* Display input data */ printf("%s\nInput length: %d\n", input, length); } else /* input error */ printf("input error\n"); /* 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');
/* First number in string is 'Q', then stop */
}
148
Trakker Antares PSK Reference Manual
Page 169
Chapter 5, PSK Function Descriptions im_set_cursor_style Purpose Syntax
IN Parameters
OUT Parameters Return Value
Defines the style used to draw the cursor. #include "imt24lib.h" IM_STATUS im_set_cursor_style (IM_CURS_TYPE cursor);
cursor
Flag that is one of these constants: IM_BLINKING_BLOCK IM_BLINKING_UNDERLINE IM_BLOCK IM_UNDERLINE IM_NO_CURSOR
None This function returns one of these codes: IM_SUCCESS IM_NOT_SUPPORTED
Notes
Blinking block Single blinking underline Block Single underline No cursor displayed
Success Not supported for the current firmware level or the current font type
Use this function to reduce screen flicker and speed up repainting a full screen a character at a time. Turn off the cursor before painting the screen, then restore the cursor after all the text is displayed.
Example See example for im_get_display_mode on page 72.
im_set_cursor_xy Purpose
Syntax
This function sets the current cursor position. If viewporting is disabled, the cursor position is relative to the terminal display. If viewporting is enabled, the cursor position is relative to the virtual display. #include "imt24lib.h" IM_STATUS far im_set_cursor_xy (IM_USHORT row, IM_USHORT col)
IN Parameters row col OUT Parameters
Current vertical position. The top of the display is 0. Current horizontal position. The left edge of the display is 0.
None
Trakker Antares PSK Reference Manual
149
Page 170
Chapter 5, PSK Function Descriptions im_set_cursor_xy (continued) Return Value
This function returns one of these codes: IM_SUCCESS IM_X_RANGE IM_Y_RANGE IM_BOTH_RANGE
Notes
Success col value out of range, cursor moved to right edge row value out of range, cursor moved to bottom col and row values out of range, cursor moved to lower right corner
If viewporting is enabled: col Cursor at X-position in virtual display mode. row Cursor at Y-position in virtual display mode. If viewporting is disabled: row Cursor at X-position in physical display mode. col Cursor at Y-position in physical display mode. If you call im_set_thai_cursor_mode and enable ThaiCursorMode, the cursor moves to display Thai characters.
Example See example for im_receive_field on page 141.
im_set_display_mode Purpose Syntax
This function sets the scroll mode, wrap mode, and character height of the display. #include "imt24lib.h" IM_STATUS im_set_display_mode (IM_FONT_TYPE font, IM_BOOL scroll IM_BOOL wrap);
IN Parameters font
150
Font type code and is one of these constants: IM_FONT_STANDARD Text is 8 x 8 pixels and the scroll boundary is line 25 and the wrap boundary is column 80 IM_FONT_5X6 Text is 5 x 6 pixels IM_FONT_6X8 Text is 6 x 8 pixels IM_FONT_8X10 Text is 8 x 10 pixels IM_FONT_12X16 Text is 12 x 16 pixels
Trakker Antares PSK Reference Manual
Page 171
Chapter 5, PSK Function Descriptions
IM_FONT_LARGE scroll wrap
OUT Parameters Return Value
Text is 8 x 16 pixels and the scroll boundary is line 12 and the wrap boundary is column 40 IM_FONT_SPECIAL Text is 16 x 16 pixels Determines if the text scrolls at the bottom of the screen and is one of these values: 0 (zero) No scrolling Nonzero Scroll at bottom of screen Determines if the text wraps at the right edge of the screen and is one of these values: 0 (zero) No wrapping Nonzero Wrap at right edge of screen
None This function returns one of these codes: IM_SUCCESS IM_INVALID_PARAM_1
Notes
Success Invalid font parameter
If scroll and wrap are set to true and viewporting is disabled, then scrolling or wrapping occur at the viewport boundaries. If scroll and wrap are set to true and viewporting is enabled, then scrolling or wrapping occur at the virtual window boundaries. The Application Simulator cannot simulate this feature if you have compiled the application as a DOS .EXE application for terminals.
See Also im_get_display_mode, im_set_follow_cursor
Example See example for im_viewport_setxy on page 204.
im_set_eom Purpose
Syntax
This function determines the end of data in each TCP/IP message by reading the one or two EOM characters at the end of the message or by reading a two-byte binary number at the beginning of the message that identifies the message length. #include "imt24lib.h" IM_STATUS im_set_eom (IM_TCP_DELINEATION eom, IM_CHAR eom1, IM_CHAR eom2, IM_COM_PORT port_id)
Trakker Antares PSK Reference Manual
151
Page 172
Chapter 5, PSK Function Descriptions im_set_eom (continued) IN Parameters eom eom1 eom2 port_id
OUT Parameters Return Value
Pointer to the message delimiter and is one of these constants: IM_NO_EOM No EOM character in the message. IM_ONE_EOM EOM1 character at end of message. IM_TWO_EOMS EOM1 and EOM2 characters at end of message. IM_TCP_LENGTH Two-byte message length value at start of message. IM_TCP_LEN_NETORDER From top to bottom in network order. First EOM character appended to the message. Second EOM character appended to the message. Pointer to IM_COM_PORT and is this constant: IM_NET Network input (TCP/IP): 241X, 242X, 2455, 2475, and 248X - RF port
None This function returns one of these codes: IM_SUCCESS IM_INVALID_PARAM_1
Notes
Success Invalid parameter specified
This function notifies IM_RECEIVE_BUFFER and IM_TRANSMIT_BUFFER which delineation method to use to determine the end of message when TCP/IP records have been concatenated. Intermec does not recommend using this approach for COM ports. If you set EOM detection for a serial COM port, this setting is not the same as the configurable protocol that is done by using reader commands or by using the Trakker Antares menu system. You should use the configurable protocol because it supports configuration command via serial port, handshake, and LRC. The delineation characters specified with this function are not the same as the lower level EOMs set in the serial communications configuration.
See Also im_receive_buffer, im_transmit_buffer
152
Trakker Antares PSK Reference Manual
Page 173
Chapter 5, PSK Function Descriptions im_set_follow_cursor Purpose Syntax
This function enables or disables the follow-the-cursor feature. #include "imt24lib.h" IM_STATUS im_set_follow_cursor (IM_CONTROL follow);
IN Parameters follow
OUT Parameters Return Value
One of these constants: IM_ENABLE Enable follow-the-cursor mode IM_DISABLE Disable follow-the-cursor mode
None This function returns one of these codes: IM_SUCCESS IM_DISABLED
Notes
Successfully locked Viewporting not enabled, but follow the cursor is set for when viewporting is enabled
When follow the cursor is enabled and the application is receiving input from the keyboard or a label, the viewport moves to ensure that the cursor is within the viewport. This function does not work on terminals that are running DOS .EXE applications if you use standard C functions to write to the screen. The 2460 and 2461 terminals do not support this function.
See Also im_get_follow_cursor
Example See example for im_get_follow_cursor on page 76.
im_set_input_mode Purpose Syntax
This function sets the device input mode to Wedge, Programmer, or Desktop. These modes affect how the device interprets and stores input. #include "imt24lib.h" void im_set_input_mode (IM_MODE mode);
Trakker Antares PSK Reference Manual
153
Page 174
Chapter 5, PSK Function Descriptions im_set_input_mode (continued) IN Parameters mode
One of these constants: IM_PROGRAMMER Input is returned as a string (default). Line editing is permitted. IM_WEDGE Input is returned as a string. Use Backspace for simple line editing. IM_DESKTOP Keyboard characters are returned as 4 bytes. The first byte is the ASCII code. The second byte is the scan code, and the last 2 bytes are flags for modifier keys (Shift and Control). Labels are returned as a string of all the characters in the label. Make sure you pass in a buffer large enough to receive the scanned data.
OUT Parameters
None
Return Value
None.
Notes
For more information on input modes, see Chapter 2, “Programming Guidelines.”
See Also im_get_input_mode, im_receive_input
Example See example for im_irl_a on page 106.
im_set_mixed_mode Purpose Syntax
This function sets the display to use single- and double-byte characters. #include "imt24lib.h" IM_STATUS im_set_mixed_mode (IM_UCHAR EnableDisable)
IN Parameters EnableDisable
OUT Parameters Return Value
IM_UCHAR and is one of these constants: IM_ENABLE Enable mixed mode IM_DISABLE Disable mixed mode
None This function returns one of these codes: IM_SUCCESS IM_ACCESS_DENIED
154
Success Mixed mode not allowed
Trakker Antares PSK Reference Manual