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

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

Pages 155 to 164 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 155

Chapter 5, PSK Function Descriptions

IN Parameters port_id length data_buffer timeout comm_length

Return Value

Communications port: IM_COM1 COM1 input: 241X, 242X, 243X, and 2455 - Port on bottom end of terminal, 2475 and 248X - Physical port labeled COM1 IM_COM2 COM2 input: 248X - Physical port labeled COM2 on enhanced I/O board IM_COM3 COM3 input: 2420 - Modem IM_NET 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_ RS-232 port input: 242X - Serial interface PORT module, 2455 - Adapter cable, 248X Physical port labeled COM4 on enhanced I/O board Maximum number of bytes to receive and must be 1024 bytes. Far pointer to the data array where you want to place the received data. This buffer must hold at least the number of bytes passed in as length (1024 or more). Receive timeout period and is one of these values: 1 to 4,294,966 ms Numeric range IM_ZERO_TIMEOUT No wait IM_INFINITE_NET_ Wait forever. The function TIMEOUT does not return until the end of message character has been received. Far pointer to the variable that holds the actual number of bytes received upon completion of the call. This variable is valid only if a successful status code is returned. Otherwise, no data is received.

This function returns one of these codes: IM_SUCCESS IM_NET_BAD_CTRL_BLOCK IM_NET_BAD_DATA IM_NET_CONFIG_ERROR IM_NET_NOT_READY

Trakker Antares PSK Reference Manual

Successfully received data Net control block pointer is null Data pointer is null or invalid data length Incorrect RF configuration Network not active or not properly configured

135

Page 156

Chapter 5, PSK Function Descriptions im_receive_buffer (continued) Notes

This function does not return until an end of message, a buffer is full, a timeout occurs, or an error occurs. For COM input, if no EOM character is defined, the function returns after a character is received. For TCP/IP communications, individual records can get combined into one packet during transmission. As a result, you can use im_set_eom to detect the end of data in each TCP/IP message by: (1) reading the one or two EOM characters at the end of the message or (2) reading a two-byte binary number at the beginning of the message to identify the message length. Data in the receive buffer is appended with a null character unless the data is 1024 bytes in length, in which case the null character is not appended to the data.

See Also im_cancel_rx_buffer, im_receive_field, im_receive_file, im_transmit_buffer

Example /********************* im_receive_buffer *****************************/ #include <string.h> #include <conio.h> #include "imstdio.h" #include "imt24lib.h" void main ( void ) { char szRxBuffer[1024]; IM_STATUS iStatus; IM_USHORT iCommLength; im_clear_screen(); iStatus = im_receive_buffer ( IM_NET, 1024, szRxBuffer, 10000, &iCommLength ); if(iStatus == IM_SUCCESS) printf("\nData Receive: %s, Length: %u\n", szRxBuffer, iCommLength); else { printf("\nReceive Buffer Err:\nStatus Code#: %x\n", iStatus); im_message(iStatus); } getch(); }

136

Trakker Antares PSK Reference Manual

Page 157

Chapter 5, PSK Function Descriptions im_receive_field Purpose Syntax

IN Parameters

This function works on an input field area on the screen. You can specify display attributes for the field and control the length of the input data. #include "imt24lib.h" IM_STATUS im_receive_field (IM_ORIGIN allowed, IM_UINT timeout, IM_ATTRIBUTES attrib, IM_USHORT flags, IM_SHORT length, IM_ORIGIN far *source, IM_UCHAR *received);

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_COM4_SELECT Means IM_NET_SELECT and is provided for compatibility with past systems 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 IM_KEYBOARD_ Keypad input SELECT IM_ALL_SELECT All input sources

137

Page 158

Chapter 5, PSK Function Descriptions im_receive_field (continued) timeout

Receive timeout period and is one of these values: 1 to 65,534 ms Numeric range IM_ZERO_TIMEOUT No wait IM_INFINITE_NET_ Wait forever. The function TIMEOUT will not return until the end of message character has been received, a return is entered, or one of the conditions set with the flags parameter is met. When you select COM1 or the Network port, the value IM_INFINITE_TIMEOUT and the value 0xFFFF are treated as IM_INFINITE_NET_TIMEOUT. attrib flags

138

Display attributes and can be any combination of these constants: IM_NORMAL Normal characters IM_BLINK Blinking characters IM_BOLD Bold characters IM_INVERSE Reverse video for characters IM_UNDERLINE Underlined characters Controls the field action and is one or more of these constants: IM_ERASE_FIELD Clear field data, but display any attributes in the field area. If this flag is not set, the old data is displayed and the attributes are applied to the field. IM_RETURN_ON_ Directs im_receive_field to BACK_TAB return if the BACK TAB key is pressed. IM_RETURN_ON_ Directs im_receive_field to TAB return if the TAB key is pressed. IM_RETURN_ON_ Directs im_receive_field to FULL return if the field becomes full. IM_RETURN_ON_ Directs im_receive_field to FUNCTION return if a function key (F1 F10) is pressed. IM_RETURN_ON_ Directs im_receive_field to ESC return if the ESC key is pressed.

Trakker Antares PSK Reference Manual

Page 159

Chapter 5, PSK Function Descriptions

IM_RETURN_ON_ UD_ARROWS length OUT Parameters source

Trakker Antares PSK Reference Manual

Directs im_receive_field to return if the up or down arrow key is pressed. IM_DISPLAY_ONLY Display the field and its attributes without waiting for input. IM_AT_END Move the cursor to the end of the data already in the field. IM_NO_DISPLAY Receive input but do not echo the input to the display. IM_UPCASE Changes input to uppercase. IM_LOCASE Changes input to lowercase. IM_STAY_IN_FIELD Cursor stays in the input field upon field exit. IM_START_IN_ Line editing mode is set to OVERSTRIKE overstrike. IM_START_IN_ Line editing mode is set to insert INSERT (default value). Note: If both IM_UPCASE and IM_LOCASE are set, then IM_UPCASE is used. If neither flag is set, keys are interpreted as pressed. Display field size. The buffer needs to be at least one byte larger than the display field size. Far 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 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

139

Page 160

Chapter 5, PSK Function Descriptions im_receive_field (continued) IM_SCAN_PORT_ SELECT

IM_LABEL_ SELECT received Return Value

IM_OPTICAL_ SELECT IM_KEYBOARD_ Keypad input SELECT IM_NO_SELECT No input source selected Pointer to IM_UCHAR. This function places the received data at this location.

This function returns one of these codes: IM_SUCCESS IM_TIMEDOUT IM_INPUT_FULL

IM_RETURN_F1 IM_RETURN_F2 IM_RETURN_F3 IM_RETURN_F4 IM_RETURN_F5 IM_RETURN_F6 IM_RETURN_F7 IM_RETURN_F8 IM_RETURN_F9 IM_RETURN_F10 IM_RETURN_TAB IM_RETURN_BACK_TAB IM_RETURN_ESC IM_RETURN_UP_ARROW IM_RETURN_DOWN_ARROW

140

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

Successfully received input. Timeout occurred. Maximum number of characters was received and input was stopped. All characters entered are returned. F1 was received. F2 was received. F3 was received. F4 was received. F5 was received. F6 was received. F7 was received. F8 was received. F9 was received. F10 was received. Tab was received. Backtab was received. ESC character was received. Up arrow was received. Down arrow was received.

Trakker Antares PSK Reference Manual

Page 161

Chapter 5, PSK Function Descriptions

Notes

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

Example See also the example getflds.c in the \intermec\imt24\examples\psk directory. /********************* im_receive_field*******************************/ /*Example of doing a data input screen using im_receive_field */ /* Also validates input for length and draws box. */

#include "imt24lib.h" #include "string.h" /* Fields and prompts */ char sBadge[10] ={0}, sPart[26]={0}, sOrderNo[10]={0}; char Lable0[] ="Job Setup", Lable1[]="Enter Badge:", Lable2[] ="Scan Part Number:", Lable3[] = "Enter Order Number:"; #define FIELD_FLAGS IM_RETURN_ON_TAB | IM_RETURN_ON_FULL | IM_AT_END #define H1 0xC4 #define V1 0xB3 #define UL1 0xDA #define UR1 0xBF #define LL1 0xC0 #define LR1 0xD9 /* Table of information to drive display and data input */ struct screen{ char * pszText; IM_USHORT iRow, iCol, iLength, iMinLength; IM_ATTRIBUTES iAttribute; IM_USHORT iFlags; } aScreen[] = { { Lable0 , 1, 5, sizeof(Lable0)-1, 0, IM_BOLD, { Lable1 , 4, 1, sizeof(Lable1)-1, 0, IM_BOLD,

Trakker Antares PSK Reference Manual

IM_DISPLAY_ONLY }, IM_DISPLAY_ONLY },

141

Page 162

Chapter 5, PSK Function Descriptions im_receive_field (continued) { Lable2 , 7, 1, sizeof(Lable2)-1, 0, IM_BOLD, IM_DISPLAY_ONLY }, { Lable3 , 12, 1, sizeof(Lable3)-1, 0, IM_BOLD, IM_DISPLAY_ONLY }, { sBadge , 5, 1, 9, 3, IM_INVERSE, FIELD_FLAGS }, { sPart , 8, 1, 25, 0, IM_INVERSE, FIELD_FLAGS }, { sOrderNo, 13, 1, 9, 7, IM_INVERSE, FIELD_FLAGS }, {(void *)0,0,0,0,0,0} /*Termination line*/ }; /*note that sizeof includes the null terminator and we pass in the displayable size*/ void DrawBox ( IM_USHORT iRow1, IM_USHORT iCol1, IM_USHORT iRow2, IM_USHORT iCol2 ) { IM_USHORT ii; im_set_cursor_xy( iRow1, iCol1 ); for ( ii = iCol1+1; ii <= iCol2; ii++) im_putchar ( H1, IM_BOLD ); im_set_cursor_xy( iRow2, iCol1 ); for ( ii = iCol1+1; ii <= iCol2; ii++) im_putchar ( H1, IM_BOLD ); for ( ii = iRow1+1; ii < iRow2 ; ii++) { im_set_cursor_xy( ii, iCol1 ); im_putchar ( V1, IM_BOLD ); im_set_cursor_xy( ii, iCol2 ); im_putchar ( V1, IM_BOLD ); }; /* do the corners */ im_set_cursor_xy( iRow1, iCol1 ); im_putchar ( UL1, IM_BOLD im_set_cursor_xy( iRow1, iCol2 ); im_putchar ( UR1, IM_BOLD im_set_cursor_xy( iRow2, iCol1 ); im_putchar ( LL1, IM_BOLD im_set_cursor_xy( iRow2, iCol2 ); im_putchar ( LR1, IM_BOLD }

); ); ); );

/* call this function when keypad is entered in the fields with im_set_validation_callback */ void callsound(void) { im_sound(IM_HIGH_PITCH,100,IM_NORMAL_VOLUME); } /* Simple example validation routine. */ IM_BOOL DoValidation ( char * szField, IM_USHORT iMinLength ) { if ( (IM_USHORT)strlen( szField ) >= iMinLength ) return IM_TRUE; else { im_status_line("Input to short", IM_TRUE, 50); return IM_FALSE; } }

142

Trakker Antares PSK Reference Manual

Page 163

Chapter 5, PSK Function Descriptions void main (void) { IM_ULONG iSetup = IM_DISPLAY_ONLY, iPassFlags, ii=0; IM_STATUS iStatus; IM_ORIGIN iSource; VALCALLBACK pFun = callsound; //setup for im_set_validation_callback() /* set up display */ im_clear_screen(); im_set_viewporting (IM_DISABLE); DrawBox( aScreen[0].iRow -1, aScreen[0].iCol -1, aScreen[0].iRow +1, aScreen[0].iCol +sizeof(Lable0) ); im_set_validation_callback(pFun); //call sound if keypad is entered in the field /***********************************************************************/ /* loops through once to display prompts and fields then comes back */ /* through to gather input. If validation fails stays in field until */ /* validation passes. */ /***********************************************************************/ do { im_set_cursor_xy( aScreen[ii].iRow, aScreen[ii].iCol ); iPassFlags = aScreen[ii].iFlags | iSetup ; iStatus = im_receive_field( IM_KEYBOARD_SELECT | IM_LABEL_SELECT, IM_INFINITE_TIMEOUT, aScreen[ii].iAttribute, iPassFlags,aScreen[ii].iLength, &iSource, aScreen[ii].pszText); /* Validate if not display pass */ if (iPassFlags & IM_DISPLAY_ONLY) { ii++; } else if (DoValidation(aScreen[ii].pszText, aScreen[ii].iMinLength ) ) { ii++; iSetup = iSetup & !IM_AT_END; } else /* Must have been error, go to end of same field */ iSetup = iSetup | IM_AT_END; /*See if display pass done and if is, turn into data input pass. */ if ((iSetup & IM_DISPLAY_ONLY) && ( aScreen[ii].pszText == (void *)0 ) ) { iSetup = iSetup & !IM_DISPLAY_ONLY ; /*reset the display only bit */ ii = 0;

/* and start again at the top

*/ } } while ( aScreen[ii].pszText != (void *)0 ) ; }

Trakker Antares PSK Reference Manual

143

Page 164

Chapter 5, PSK Function Descriptions im_receive_file Purpose

Syntax

This function receives a file from the Intermec Gateway or the DCS 30X or from a TFTP server via TCP/IP direct connect and writes the file to disk on the terminal. #include "imt24lib.h" IM_STATUS im_receive_file (IM_UCHAR far *con_file, IM_UCHAR far *trakker_file);

IN Parameters con_file trakker_file

OUT Parameters Return Value

Path and filename for the file on the Intermec Gateway, DCS 30X, or the TFTP server you want to download. This parameter can be a string in quotes or a far pointer to a variable containing the filename. Note: If you are using UDP Plus, the file you want to download must reside on a path relative to D:\USERDATA on the Intermec Gateway or the DCS 30X. If you are using TCP/IP, you can use an absolute or true path to download the file you want from the TFTP server. Is the drive letter and filename for saving the file on the Trakker Antares terminal. This parameter can be a string in quotes or a far pointer to a variable containing the filename. The Trakker Antares terminals do not use directories. All file names use this format: drive:abcdefgh.ext.

None This function returns one of these codes: IM_SUCCESS IM_NET_BAD_CTRL_ BLOCK IM_NET_BAD_DATA IM_GENERR IM_NET_NOT_READY

Notes

Successfully transferred file to the terminal. Net control block pointer is null. Data pointer is null or invalid data length. Error occurred. View the error log from the Trakker Antares menu system. Network not active or not properly configured.

You can use a literal string for either filename. Use a statement in this format: im_receive_file( (IM_UCHAR *) "c:\\apps\\vtxxx.bin", (IM_UCHAR *) "c:vtxxx.bin")

144

Trakker Antares PSK Reference Manual