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

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

Pages 215 to 224 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 215

Chapter 5, PSK Function Descriptions im_set_display_mode(IM_FONT_STANDARD, scroll, wrap); im_clear_screen(); im_set_input_mode(IM_PROGRAMMER);

/* prompt for host name printf("Enter Host Name:\n"); source = IM_KEYBOARD_SELECT; im_receive_input(IM_KEYBOARD_SELECT, IM_INFINITE_TIMEOUT, &source, (IM_UCHAR far *) host_name);

*/

/* prompt for port number printf("\nEnter Port Number:\n"); im_receive_input(IM_KEYBOARD_SELECT, IM_INFINITE_TIMEOUT, &source, (IM_UCHAR far *) port_number_str); port_num = (IM_USHORT) atoi(&port_number_str[0]);

*/

/* prompt for session ID printf("\nEnter Session ID:\n"); im_receive_input(IM_KEYBOARD_SELECT, IM_INFINITE_TIMEOUT, &source, (IM_UCHAR far *) session_id_str); session_id = (IM_UCHAR) atoi(&session_id_str[0]);

*/

/* call the Direct Sockets OPEN function */ iStatus = im_udp_open_socket(session_id, port_num, host_name, 500); /* put reader in DESKTOP mode (single keypress) and simulate /* a dumb terminal im_set_input_mode(IM_DESKTOP); while (1) { /* check to see if anything waiting at the net port */ iStatus = im_udp_receive_data((struct im_udp_packet *) &packet, 200); /* if there was data from the net port */ if (iStatus == IM_SUCCESS) { /* if the OPEN was successful if (packet.message_type == IM_UDP_OPEN_ACK) printf("Session %d Opended\n", session_id);

*/ */

*/

/* else if NOT Successful */ else if (packet.message_type == IM_UDP_OPEN_NAK) { printf("Error Code: %d\n", packet.remaining_packet.error.error_code); printf("%s\n", packet.remaining_packet.error.error_text); } /* else if data was received */ else if (packet.message_type == IM_UDP_DATA_CMD) { printf("%s", packet.remaining_packet.data_text); }

Trakker Antares PSK Reference Manual

195

Page 216

Chapter 5, PSK Function Descriptions im_udp_receive_data (continued) /* else if the CLOSE command received */ else if (packet.message_type == IM_UDP_CLOSE_CMD) { printf("Socket Closed: %d\n", packet.remaining_packet.error.error_code); printf("%s\n", packet.remaining_packet.error.error_text); } else /* else an invalid packet was received printf("\nReceived Invalid Packet\n");

*/

} /* check for other than timeout status */ else if (iStatus != IM_TIMEDOUT) printf("\nError: %x\n", iStatus); /* check to see if a key has been pressed */ iStatus = im_receive_input(IM_KEYBOARD_SELECT, 200, &source, key_buf); /* if there was a keypress */ if (iStatus == IM_SUCCESS) { ch=key_buf[0]; /* get the key */ /* if the ESC key, get out */ if(ch == ESC_KEY) break; /* send the key out the Network port */ iStatus = im_udp_send_data(session_id, (IM_UCHAR far *) &ch, 1, 200); /* check for other than success or timeout status */ if ((iStatus != IM_SUCCESS) && (iStatus != IM_TIMEDOUT)) printf("\nError:%x\n", iStatus); } } /* send the socket close command, error code and text will */ /* appear in 0200 error log */ strcpy(close_str, "Client Closed Session"); iStatus = im_udp_close_socket(session_id, 9876, (IM_UCHAR far *) &close_str[0], 500); /* if anything other than success if (iStatus != IM_SUCCESS) { printf("\nError: %x\n%s\n", packet.remaining_packet.error.error_code, packet.remaining_packet.error.error_text); getch(); }

*/

}

196

Trakker Antares PSK Reference Manual

Page 217

Chapter 5, PSK Function Descriptions im_udp_send_data Purpose

Syntax

This function requests the Intermec Gateway or the DCS 30X to send data to the host specified by the session ID on behalf of the client application. This function should only be used on terminals with UDP Plus. Do not use this function on terminals running TCP/IP. #include "imt24lib.h" IM_STATUS im_udp_send_data (IM_UCHAR session_id, IM_UCHAR far *data, IM_USHORT data_length, IM_LTIME timeout);

IN Parameters session_id data data_length timeout

OUT Parameters Return Value Notes

Session number of the connection where the Intermec Gateway or the DCS 30X sends the data. Far pointer to the data to be sent. Length of the data. Since the data can be binary, the length must be specified. Number in the range of 1 to 65,534 ms or one of these constants: IM_ZERO_TIMEOUT No wait IM_INFINITE_TIMEOUT Wait forever

None This function returns a status code that is defined in Appendix A. It is not recommended that you use IM_INFINITE_TIMEOUT because this function will never return if the unit cannot send the data.

See Also im_udp_close_socket, im_udp_receive_data, im_udp_open_socket

Example See example for im_udp_receive_data on page 193.

im_viewport_end Purpose Syntax

This function sets the viewport to the lower right corner (end) of the virtual display. #include "imt24lib.h" void im_viewport_end(void);

IN Parameters

None

OUT Parameters

None

Trakker Antares PSK Reference Manual

197

Page 218

Chapter 5, PSK Function Descriptions

Return Value Notes

None This function is valid only when viewporting is enabled. The 2460 and 2461 terminals do not support this function.

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

Example See example for im_viewport_setxy on page 204.

im_viewport_getxy Purpose Syntax

IN Parameters

This function retrieves the column and row of the upper left corner of the viewport. #include "imt24lib.h" IM_STATUS im_viewport_getxy (IM_USHORT far *row, IM_USHORT far *col);

None

OUT Parameters row col Return Value

Returns the row value (Y-coordinate) of the viewport. Returns the column value (X-coordinate) of the viewport.

This function returns one of these codes: IM_SUCCESS IM_VP_DISABLED

Notes

Success Viewporting currently disabled

This function is valid only when viewporting is enabled. The 2460 and 2461 terminals do not support this function.

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

Example See example for im_viewport_setxy on page 204.

198

Trakker Antares PSK Reference Manual

Page 219

Chapter 5, PSK Function Descriptions im_viewport_home Purpose Syntax

This function sets the viewport to the upper left corner (home) of the virtual display. #include "imt24lib.h" void im_viewport_home(void);

IN Parameters

None

OUT Parameters

None

Return Value

None

Notes

This function is valid only when viewporting is enabled. The 2460 and 2461 terminals do not support this function.

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

Example See example for im_viewport_setxy on page 204.

im_viewport_move Purpose Syntax

This function moves the viewport the specified distance and direction. #include "imt24lib.h" IM_STATUS im_viewport_move (IM_VIEWPORT_DIRECTION direction, IM_USHORT distance, IM_USHORT far *row, IM_USHORT far *col);

IN Parameters direction distance

Trakker Antares PSK Reference Manual

One of these constants: IM_VIEWPORT_LEFT Move left IM_VIEWPORT_RIGHT Move right IM_VIEWPORT_UP Move up IM_VIEWPORT_DOWN Move down Number of units to move the viewport. This distance is either a numeric value between 1 and 70 or IM_DEFAULT_DISTANCE. If the distance parameter is IM_DEFAULT_DISTANCE, the default step size is used.

199

Page 220

Chapter 5, PSK Function Descriptions im_viewport_move (continued) OUT Parameters row col Return Value

Pointer to the row number to which the viewport has moved. Pointer to the column number to which the viewport has moved.

This function returns one of these codes: IM_SUCCESS IM_VP_DISABLED IM_INVALID_DIRECTION IM_TO_LARGE

Notes

Success Viewporting currently disabled Invalid direction was passed in Distance was too large for that direction, moved as far as possible

The (row, col) pair represents the upper left corner of the viewport being displayed. This function is valid only when viewporting is enabled. 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_cursor_to_viewport

Example See example for im_viewport_setxy on page 204.

im_viewport_page_down Purpose

Syntax

This function moves the viewport down one page size on the virtual screen. The viewport cannot move beyond the bottom edge of the virtual screen. #include "imt24lib.h" IM_STATUS im_viewport_page_down (void);

IN Parameters

None

OUT Parameters

None

Return Value

This function returns one of these codes: IM_SUCCESS IM_AT_EDGE IM_VP_DISABLED

200

Success Moved to edge of virtual display Viewporting currently disabled

Trakker Antares PSK Reference Manual

Page 221

Chapter 5, PSK Function Descriptions

Notes

This function is valid only when viewporting is enabled. The 2460 and 2461 terminals do not support this function.

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

Example See example for im_viewport_setxy on page 204.

im_viewport_page_left Purpose Syntax

This function moves the viewport left one page size on the virtual screen. The viewport cannot move beyond the left edge of the virtual screen. #include "imt24lib.h" IM_STATUS im_viewport_page_left (void);

IN Parameters

None

OUT Parameters

None

Return Value

This function returns one of these codes: IM_SUCCESS IM_AT_EDGE IM_VP_DISABLED

Notes

Success Moved to edge of virtual display Viewporting currently disabled

This function is valid only when viewporting is enabled. The 2460 and 2461 terminals do not support this function.

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

Example See example for im_viewport_setxy on page 204.

im_viewport_page_right Purpose Syntax

This function moves the viewport right one page size on the virtual screen. The viewport cannot move beyond the right edge of the virtual screen. #include "imt24lib.h" IM_STATUS im_viewport_page_right (void);

Trakker Antares PSK Reference Manual

201

Page 222

Chapter 5, PSK Function Descriptions im_viewport_page_right (continued) IN Parameters

None

OUT Parameters

None

Return Value

This function returns one of these codes: IM_SUCCESS IM_AT_EDGE IM_VP_DISABLED

Notes

Success Moved to edge of virtual display Viewporting currently disabled

This function is valid only when viewporting is enabled. The 2460 and 2461 terminals do not support this function.

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

Example See example for im_viewport_setxy on page 204.

im_viewport_page_up Purpose Syntax

This function moves the viewport up one page size on the virtual screen. The viewport cannot move beyond the top edge of the virtual screen. #include "imt24lib.h" IM_STATUS im_viewport_page_up (void);

IN Parameters

None

OUT Parameters

None

Return Value

This function returns one of these codes: IM_SUCCESS IM_AT_EDGE IM_VP_DISABLED

Notes

Success Moved to edge of virtual display Viewporting currently disabled

This function is valid only when viewporting is enabled. The 2460 and 2461 terminals do not support this function.

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

Example See example for im_viewport_setxy on page 204.

202

Trakker Antares PSK Reference Manual

Page 223

Chapter 5, PSK Function Descriptions im_viewport_setxy Purpose Syntax

IN/OUT Parameters

This function sets the viewport row and column to a specific value when moving between two screens. #include "imt24lib.h" IM_STATUS im_viewport_setxy (IM_USHORT row, IM_USHORT col);

row

Sets the row value (Y-coordinate) of the viewport. The top of the virtual screen equals 0. col Sets the column value (X-coordinate) of the viewport. The left edge of virtual screen equals 0. As input parameters, row and col set the desired location for the viewport. As output parameters, row and col return the actual location.

Return Value

This function returns one of these codes: IM_SUCCESS IM_VP_DISABLED IM_INVALID_ROW IM_INVALID_COLUMN IM_INVALID_BOTH

Notes

Success. Viewporting currently disabled. Row number out of range, moved as far as possible. Column number out of range, moved as far as possible. Row and column out of range, moved to lower right corner.

The (row, col) pair represents the upper left corner of the viewport being displayed. The minimum values for both the row and col are (0,0), which is the upper left corner of the virtual window. For the 20 x 16 display character size, the maximum value of row is 9 (25 minus 16) and the maximum value of col is 60 (80 minus 20). This function is similar to the JANUS PSK function, except that this function passes a value rather than a variable containing a value. This function is valid only when viewporting is enabled. The 2460 and 2461 terminals do not support this function.

See Also im_viewport_move

Trakker Antares PSK Reference Manual

203

Page 224

Chapter 5, PSK Function Descriptions im_viewport_setxy (continued)

Example /********************* im_viewport_setxy #include <dos.h> #include <conio.h> #include <stdlib.h> #include "imstdio.h" #include "imt24lib.h" #define

SOUND_TIME void main (void) { IM_USHORT IM_FONT_TYPE IM_UCHAR IM_BOOL

200

***************************/

/* 200 milliseconds */ row, col; std_font_size, cfont_size; cphy_width, cphy_height; cpf_scroll, cpf_wrap, std_scroll, std_wrap;

/* Have to enable viewporting before using any viewport display function */ im_set_viewporting( IM_ENABLE ); /* Must disable viewport follow cursor before doing any viewport movement */ im_set_follow_cursor( IM_DISABLE ); std_font_size = IM_FONT_STANDARD; std_scroll = IM_TRUE; std_wrap = IM_TRUE; im_set_display_mode(std_font_size, std_scroll, std_wrap); /* Set up mark for viewport operation functions */ im_set_cursor_xy( 0, 0 ); cputs("1-viewport_home"); /* viewport_home mark*/ im_set_cursor_xy( 0, 1 ); cputs(" row:0, col:0"); im_set_cursor_xy( 9, 20 ); cputs("2-viewport_page_right");/* viewport_right */ im_set_cursor_xy( 10, 20 ); cputs(" row:9, col:20"); im_set_cursor_xy( 9, 0 ); cputs("3-Viewport_page_left"); /* viewport_left */ im_set_cursor_xy( 10, 0 ); cputs(" row:9, col:0"); im_set_cursor_xy( 23, 60 ); cputs("4-viewport_end"); im_set_cursor_xy( 24, 60 ); cputs(" row:23, col:60"); im_set_cursor_xy( 0, 60 ); cputs("5-viewport_page_up"); im_set_cursor_xy( 1, 60 ); cputs(" row:0, col:60");

204

/* viewport_end mark*/

/* viewport_page_up */

Trakker Antares PSK Reference Manual