The text of a manual · part 24 of 36
Trakker Antares Application Development Tools System Manual: Part I - Trakker Antares PSK Reference Manual, pages 225 to 234
Pages 225 to 234 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 225
Chapter 5, PSK Function Descriptions im_set_cursor_xy( 0, 20 ); cputs("6-viewport_setxy"); im_set_cursor_xy( 1, 20 ); cputs(" row:0, col:20"); im_set_cursor_xy( 0, 40 ); cputs("7-viewport_move"); im_set_cursor_xy( 1, 40 ); cputs(" row:0, col:40");
/* viewport_setxy */
/* viewport_move */ im_set_cursor_xy( 18, 40 ); cputs("8-viewport_page_down"); /* vewport_page_down */ im_set_cursor_xy( 19, 40 ); cputs(" row:18, col:40"); im_set_cursor_xy( 18, 20 ); cputs("9-viewport_to_cursor"); /* viewport_to_cursor*/ im_set_cursor_xy( 19, 20 ); cputs(" row:18, col:20"); /* Bring cursor back so that viewport will stay with it */ im_set_cursor_xy( 0, 0); /* Action 1: Set viewport back to Home */ im_viewport_home(); im_sound(IM_LOW_PITCH,SOUND_TIME,IM_LOUD_VOLUME); getch(); /* Action 2: Set viewport page right */ im_viewport_page_right(); im_sound(IM_LOW_PITCH,SOUND_TIME,IM_LOUD_VOLUME); getch(); /* Action 3: Set viewport page left */ im_viewport_page_left(); im_sound(IM_LOW_PITCH,SOUND_TIME,IM_LOUD_VOLUME); getch(); /* Action 4: Viewport End */ im_viewport_end(); im_sound(IM_LOW_PITCH,SOUND_TIME,IM_LOUD_VOLUME); getch(); /* Action 5: Viewport Page Up */ im_viewport_page_up(); im_sound(IM_LOW_PITCH,SOUND_TIME,IM_LOUD_VOLUME); getch(); /* Action 6: Viewport Setxy */ row = 0; col = 20; im_viewport_setxy(&row, &col); im_sound(IM_LOW_PITCH,SOUND_TIME,IM_LOUD_VOLUME); getch(); /* Action 7: Viewport Move */ im_viewport_move(IM_VIEWPORT_RIGHT, 20, &row, &col); im_sound(IM_LOW_PITCH,SOUND_TIME,IM_LOUD_VOLUME);
Trakker Antares PSK Reference Manual
205
Page 226
Chapter 5, PSK Function Descriptions im_viewport_setxy (continued) getch(); /* Action 8: Viewport Page Down */ im_viewport_page_down(); im_sound(IM_LOW_PITCH,SOUND_TIME,IM_LOUD_VOLUME); getch(); /* Action 9: set cursor at row:18, column:10 and viewport_to_cursor */ /* Note: Cursor at the center of viewport */ im_set_cursor_xy( 18, 10); /* Need offset 10 to let cursor at center*/ im_viewport_to_cursor(); im_sound(IM_LOW_PITCH,SOUND_TIME,IM_LOUD_VOLUME); getch(); /* Action 10: Viewport Getxy */ im_viewport_end(); /* Force viewport to end */ /* In 80X25 mode, viewport_end causes the viewport move at (9,60) */ /* You should see value is row:9, col:60 */ im_viewport_getxy(&row, &col); im_viewport_home(); /* Force viewport to home */ im_set_cursor_xy(0, 0 ); cputs ("10-viewport_getxy"); /* Start at home again */ im_set_cursor_xy(1, 0 ); printf(" Row:%d, Col:%d", row, col); im_sound(IM_LOW_PITCH,SOUND_TIME,IM_LOUD_VOLUME); getch(); /* Action 11: Mark ref. c->v */ im_clear_screen(); im_set_cursor_xy( 9, 50 ); cputs("Ref. C->V"); /* viewport_to_cursor*/ im_set_cursor_xy( 0, 0); cputs("11-C->V"); im_set_cursor_xy( 1, 0 ); cputs("Cursor at Ref."); getch(); /* Action 12: Move viewport to end, then Do cursor_to_viewport */ row = 1; col = 39; im_viewport_setxy(&row, &col); im_viewport_end(); /* Force viewport to end */ im_cursor_to_viewport(); /* Cursor go to center */ im_sound(IM_LOW_PITCH,SOUND_TIME,IM_LOUD_VOLUME); getch(); /* Action 13: Get Display Mode */ im_get_display_mode(&cfont_size, &cphy_width, &cphy_height, &cpf_scroll, &cpf_wrap); if ( (std_font_size == cfont_size) && (std_scroll == cpf_scroll) && (std_wrap == cpf_wrap) ) printf("\nDisplay mode setup ok\n"); else printf("\nError in display_mode\nsetup\n"); im_sound(IM_LOW_PITCH,SOUND_TIME,IM_LOUD_VOLUME); getch(); }
206
Trakker Antares PSK Reference Manual
Page 227
Chapter 5, PSK Function Descriptions im_viewport_to_cursor Purpose Syntax
This function attempts to center the viewport around the cursor. #include "imt24lib.h" IM_STATUS im_viewport_to_cursor (void);
IN Parameters
None
OUT Parameters
None
Return Value
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. When the cursor is not displayed, use this function to move the viewport to the cursor. Movement of the viewport is limited by the virtual display boundaries. If the cursor is near any edge, the viewport will contain the cursor, but it may not be centered in the viewport. 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
Example See example for im_viewport_setxy on page 204.
Trakker Antares PSK Reference Manual
207
Page 228
Chapter 5, PSK Function Descriptions im_xm_receive_file Purpose Syntax
This function sets the terminal to receive a file from the host using XMODEM protocol. #include "imt24lib.h" IM_STATUS im_xm_receive_file (IM_CHAR far *filename, IM_COM_PORT port_id)
IN Parameters filename port_id
OUT Parameters Return Value
Far pointer to IM_CHAR and is the filename in the terminal. The terminal filename has the format drive:filename. 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_SCAN_ RS-232 port input: 242X - Serial PORT_SELECT interface module, 2455 - Adapter cable, 248X - Physical port labeled COM4 on enhanced I/O board
None This function returns one of these codes: IM_SUCCESS IM_NET_PORT_HANDLE
Notes
Success Port handle is unknown
The host must be set up to send a file (using XMODEM protocol) to the terminal for this function to execute successfully.
See Also im_xm_transmit_file
Example /************************* im_xm_receive_file *********************/ #include <time.h> #include <string.h> #include <stdio.h> #include <stdlib.h> #include <conio.h> #include "imt24lib.h" void main() {
208
Trakker Antares PSK Reference Manual
Page 229
Chapter 5, PSK Function Descriptions
// char Rxfilename[] = "e:\\works\\h3test\\xtest\\getvp2.bin"; char Rxfilename[] = "c:getvp2.bin"; char Txfilename[] = "c:getvp.bin"; IM_STATUS istatus; im_clear_screen(); printf("Enter any character for beginning\n"); printf("of receive file.\n"); getch(); //
Test im_xm_receive_file function istatus = im_xm_receive_file(Rxfilename,IM_COM1); printf("\nistatus for receive is %x \n", istatus); im_message(istatus); if(istatus == IM_OK) { printf("\nReceive file success\n"); im_message(istatus); } else { printf("\nReceive File Error: "); im_message(istatus); } getch(); im_clear_screen(); printf("Enter any character for beginning\n"); printf("of transmit file.\n"); getch(); //
Test im_xm_transmit_file function istatus = im_xm_transmit_file(Txfilename,IM_COM1); printf("\nistatus for transmit is %x \n",istatus);
if(istatus == IM_OK) { printf("\nTransmit file success\n"); } else { printf("\nTransmit File Error: "); im_message(istatus); } getch(); return; }
Trakker Antares PSK Reference Manual
209
Page 230
Chapter 5, PSK Function Descriptions im_xm_transmit_file Purpose Syntax
IN Parameters
This function sets the terminal to transmit a file to the host using XMODEM protocol. #include "imt24lib.h" IM_STATUS im_xm_transmit_file (IM_CHAR far *filename, IM_COM_PORT port_id)
filename port_id
OUT Parameters Return Value
Far pointer to IM_CHAR and is the filename in the terminal. The terminal filename has the format drive:filename. 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_SCAN_PORT_ RS-232 port input: 242X - Serial SELECT interface module, 2455 - Adapter cable, 248X - Physical port labeled COM4 on enhanced I/O board
None This function returns one of these codes: IM_SUCCESS IM_NET_PORT_HANDLE
Notes
Success Port handle is unknown
The host must be set up to receive a file (using XMODEM protocol) from the terminal for this function to execute successfully.
See Also im_xm_receive_file
Example See example for im_xm_receive_file on page 208.
210
Trakker Antares PSK Reference Manual
Page 231
Chapter 5, PSK Function Descriptions im_xm1k_receive_file Purpose Syntax
IN Parameters
This function sets the terminal to receive a file from the host using XMODEM-1K protocol. #include "imt24lib.h" IM_STATUS im_xm1k_receive_file (IM_CHAR far *filename, IM_COM_PORT port_id);
filename port_id
OUT Parameters Return Value
Far pointer to IM_CHAR and is the filename in the terminal. The terminal filename has the format drive:filename. 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_SCAN_PORT_ RS-232 port input: 242X - Serial SELECT interface module, 2455 - Adapter cable, 248X - Physical port labeled COM4 on enhanced I/O board
None This function returns one of these values: IM_SUCCESS IM_NET_PORT_HANDLE
Notes
Success Port handle is unknown
The host must be set up to send a file (using XMODEM-1K protocol) to the terminal for this function to execute successfully.
See Also im_xm1k_transmit_file
Example /************************* im_xm1k_receive_file *********************/ #include <time.h> #include <string.h> #include <stdio.h> #include <stdlib.h> #include <conio.h> #include "imt24lib.h" void main()
Trakker Antares PSK Reference Manual
211
Page 232
Chapter 5, PSK Function Descriptions im_xm1k_receive_file (continued) { // char Rxfilename[] = "e:\\works\\h3test\\xtest\\getvp2.bin"; char Rxfilename[] = "c:getvp2.bin"; char Txfilename[] = "c:getvp.bin"; IM_STATUS istatus; im_clear_screen(); printf("Enter any character for beginning\n"); printf("of receive file.\n"); getch(); //
Test im_xm1k_receive_file function istatus = im_xm1k_receive_file(Rxfilename,IM_COM1); printf("\nistatus for receive is %x \n", istatus); im_message(istatus); if(istatus == IM_OK) { printf("\nReceive file success\n"); im_message(istatus); } else { printf("\nReceive File Error: "); im_message(istatus); } getch(); im_clear_screen(); printf("Enter any character for beginning\n"); printf("of transmit file.\n"); getch(); // Test im_xm1k_transmit_file function istatus = im_xm1k_transmit_file(Txfilename,IM_COM1); printf("\nistatus for transmit is %x \n",istatus); if(istatus == IM_OK) { printf("\nTransmit file success\n"); } else { printf("\nTransmit File Error: "); im_message(istatus); } getch(); return; }
212
Trakker Antares PSK Reference Manual
Page 233
Chapter 5, PSK Function Descriptions im_xm1k_transmit_file Purpose Syntax
IN Parameters
This function sets the terminal to transmit a file to the host using XMODEM-1K protocol. #include "imt24lib.h" IM_STATUS im_xm1k_transmit_file (IM_CHAR far *filename, IM_COM_PORT port_id)
filename port_id
OUT Parameters Return Value
Far pointer to IM_CHAR and is the filename in the terminal. The terminal filename has the format drive:filename. 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_SCAN_PORT_ RS-232 port input: 242X - Serial SELECT interface module, 2455 - Adapter cable, 248X - Physical port labeled COM4 on enhanced I/O board
None This function returns one of these values: IM_SUCCESS IM_NET_PORT_HANDLE
Notes
Success Port handle is unknown
The host must be set up to receive a file (using XMODEM-1K protocol) from the terminal for this function to execute successfully.
See Also im_xm1k_receive_file
Example See example for im_xm1k_receive_file 211.
Trakker Antares PSK Reference Manual
213
Page 234
Chapter 5, PSK Function Descriptions im_ym_receive_file Purpose Syntax
IN Parameters
This function sets the terminal to receive a file from the host using YMODEM protocol. #include "imt24lib.h" IM_STATUS im_ym_receive_file (IM_CHAR far *filename, IM_COM_PORT port_id)
filename port_id
OUT Parameters Return Value
Far pointer to IM_CHAR and is the filename in the terminal. The terminal filename has the format drive:filename. 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_SCAN_PORT_ RS-232 port input: 242X - Serial SELECT interface module, 2455 - Adapter cable, 248X - Physical port labeled COM4 on enhanced I/O board
None This function returns one of these codes: IM_SUCCESS IM_NET_PORT_HANDLE
Notes
Success Port handle is unknown
The host must be set up to send a file (using YMODEM protocol) to the terminal for this function to execute successfully.
See Also im_ym_transmit_file
Example /************************* im_ym_receive_file *********************/ #include <time.h> #include <string.h> #include <stdio.h> #include <stdlib.h> #include <conio.h> #include "imt24lib.h" void main()
214
Trakker Antares PSK Reference Manual