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

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

Pages 185 to 194 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 185

Chapter 5, PSK Function Descriptions

Return Value

This function returns one of these codes: IM_SUCCESS IM_TO_FAR

Notes

Success Moving this distance would move the viewport past the cursor

Viewport movement is bounded by the virtual screen. If moving the viewport by the set increment would move the viewport off the virtual screen, a smaller movement value is used. If the boundaries are larger than half of the viewport size, the viewport moves so that the cursor is offset from the right or bottom edge by the size of the boundary. 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.

Example /********************* im_setup_follow_cursor ************************/ #include <string.h> #include <conio.h> #include "imstdio.h" #include "imt24lib.h" void main ( void ) { im_clear_screen(); /* Have to enable viewporting before using any viewport display function */ im_set_viewporting( IM_ENABLE ); im_set_follow_cursor( IM_ENABLE ); im_puts((IM_UCHAR *)"setting follow cursor to center",0); im_setup_follow_cursor( 10,8,1,1 ); getch(); im_puts((IM_UCHAR *)"setting follow cursor to overlap but move 1",0); im_setup_follow_cursor( 18,14,1,1 ); getch(); im_puts((IM_UCHAR *)"Setting follow cursor back to the default value",0); im_setup_follow_cursor( 1,1,10,8 ); getch(); }

Trakker Antares PSK Reference Manual

165

Page 186

Chapter 5, PSK Function Descriptions im_setup_manual_viewporting Purpose

Syntax

IN Parameters

This function overrides the default settings for the viewport movement keys and the move distance when the viewport is in manual browse mode. By default, you use the numeric keypad and the left function key ( ) ) to move the viewport. You use the numeric keypad and the right function key ( ( ) to move the cursor. #include "imt24lib.h" IM_STATUS im_setup_manual_viewporting (IM_MANUAL_S far manual);

manual

Is a structure containing override values for each control characteristic. If the override value is 0, that element in the structure is ignored. For all other values, the element is copied to the viewport management structure.

Structure Elements

OUT Parameters Return Value

Structure Element Viewport Page up

Key Equivalent )9

Default Value 7E00H

Viewport Page down

)3

5100H

Viewport Page left

)4

9B00H

Viewport Page right

)6

9D00H

Viewport Home key

)7

4700H

Viewport End key

)1

4F00H

Vertical page move distance

Viewport width – 1

Horizontal page move distance

Viewport height – 1

None This function returns one of these codes: IM_SUCCESS IM_VP_DISABLED

IM_INVALID_KEYCODE IM_INVALID_ADDRESS

166

Success Viewporting is not enabled, but viewport lock is set for when viewporting is enabled Invalid keycode in structure Address not in valid range for data

Trakker Antares PSK Reference Manual

Page 187

Chapter 5, PSK Function Descriptions

Notes

For a list of valid override values, see your terminal user’s manual. Viewport movement is bounded by the virtual screen. If moving the viewport by the set increment would move the viewport off the virtual screen, it moves a smaller amount. The 2460 and 2461 terminals do not support this function.

Example /********************* im_setup_manual_viewporting *******************/ #include <conio.h> #include <stdlib.h> #include <ctype.h> #include "imstdio.h" #include "imt24lib.h" #define

ESC_CHAR

0x1B void main (void) { IM_UCHAR ch; IM_MANUAL_S gsSetup={0,0,0,0,0,0,0,0,0,0}; im_clear_screen(); /* Have to enable viewporting before using any viewport display function */ im_set_viewporting( IM_ENABLE ); printf("Setting the viewport page vertical and horizontal move distance to 8 and 10\n"); gsSetup.iPageVertDist = 8; gsSetup.iPageHorDist = 10; im_setup_manual_viewporting( &gsSetup ); /* Enter any characters, PgUp, PgDn, PgRt, PgLft to check */ /* viewport follow cursor until 'ESC' key. */ while ( (ch = getche()) != ESC_CHAR ) ; im_puts((IM_UCHAR *)"Setting the viewport page vertical and horizontal", 0); im_puts((IM_UCHAR *)"move distance back to normal\n", 0); gsSetup.iPageVertDist = 1; gsSetup.iPageHorDist = 1; im_setup_manual_viewporting( &gsSetup ); /* Enter any characters to check viewport follow cursor until 'ESC' key. */ while ( (ch = getche()) != ESC_CHAR ) ; }

Trakker Antares PSK Reference Manual

167

Page 188

Chapter 5, PSK Function Descriptions im_sound Purpose

Syntax

IN Parameters

This function generates a beep of specified pitch and duration. For example, use a soft beep for library use, a loud beep for manufacturing use, or a unique beep to distinguish among other terminals. #include "imt24lib.h" IM_STATUS im_sound (IM_USHORT pitch, IM_USHORT duration, IM_USHORT volume);

pitch duration volume

OUT Parameters Return Value

Specifies the frequency of the beep and is one of these values: 20 to 8189 Hz Numeric range IM_HIGH_PITCH 2400 Hz IM_LOW_PITCH 1200 Hz IM_VERY_LOW_PITCH 600 Hz Is the length of the beep and is one of these values: 2 to 7999 ms Numeric range IM_BEEP_DURATION 50 ms IM_CLICK_DURATION 5 ms Is one of these constants: IM_OFF_VOLUME Off IM_QUIET_VOLUME Quiet IM_NORMAL_VOLUME Normal IM_LOUD_VOLUME Loud IM_EXTRA_LOUD_VOLUME Extra loud IM_CURRENT_VOLUME Use volume from configuration menu

None This function returns one of these codes: IM_SUCCESS IM_INVALID_PITCH IM_INVALID_VOLUME

168

Successful beep Pitch is outside allowed range Volume is outside allowed range

Trakker Antares PSK Reference Manual

Page 189

Chapter 5, PSK Function Descriptions

Example /********************* im_sound **************************************/ #include <time.h> #include "imt24lib.h" enum NOTES /* Enumeration of notes and frequencies */ { C0 = 262, D0 = 296, E0 = 330, F0 = 349, G0 = 392, A0 = 440, B0 = 494, C1 = 523, D1 = 587, E1 = 659, F1 = 698, G1 = 784, A1 = 880, B1 = 988, EIGHTH = 125, QUARTER = 250, HALF = 500, WHOLE = 1000, END = 0 } song[] = /* Array initialized to notes of song */ { C1, HALF, G0, HALF, A0, HALF, E0, HALF, F0, HALF, E0, QUARTER, D0, QUARTER, C0, WHOLE, END }; /* Predefined the play volume */ IM_USHORT volume[] = { IM_NORMAL_VOLUME, IM_EXTRA_LOUD_VOLUME, IM_QUIET_VOLUME, IM_NORMAL_VOLUME };

/* Play normal volume */ /* Play extra loud volume */ /* Play quiet volume */ /* Play normal volume */ void main (void) { int note; int index; im_clear_screen(); /* Play 4 times with 5 seconds delay between each play */ for ( index = 0; index < 4; index++) { for ( note = 0; song[note] != 0; note += 2 ) im_sound( song[note], song[note + 1], volume[index]); /* Delay 5 seconds for next throughput*/ im_standby_wait(5000); } }

Trakker Antares PSK Reference Manual

169

Page 190

Chapter 5, PSK Function Descriptions im_standby_wait Purpose Syntax

This function places the application and terminal in standby mode for a specific period of time to save the battery power. #include "imt24lib.h" IM_STATUS im_standby_wait (IM_USHORT timeout);

IN Parameters timeout

OUT Parameters

None

Return Value

Amount of time to wait in standby mode or one of these constants: 1 to 65,535 ms Numeric range (resolution of 10 ms) IM_ZERO_TIMEOUT No wait IM_INFINITE_TIMEOUT Wait forever

This function returns this code: IM_SUCCESS

Success

Example See example for im_sound on page 169.

im_status_line Purpose

Syntax

IN Parameters

This function briefly displays an error message in the status line without wrapping or scrolling the display. The status line is displayed until a key is pressed or a time out occurs. The original contents of the line reappear after the message is erased. #include "imt24lib.h" IM_STATUS im_status_line (char far *stmessage IM_BOOL wait IM_USHORT row);

stmessage wait row

170

Pointer to the error message string to display. Flag indicating if the application should wait for a key to be pressed. 0 (zero) Do not wait for a key. Nonzero Pause until any key is pressed or until a timeout occurs. Row number to display the message in. If this number is larger than the viewport, the last row is used. The first row is 0.

Trakker Antares PSK Reference Manual

Page 191

Chapter 5, PSK Function Descriptions

OUT Parameters Return Value Notes

None Returns 0 (zero) or the key pressed to terminate waiting If the wait parameter is set, the message is erased after 20 seconds or when a key is pressed. Then, the screen is refreshed to look as it did before displaying the message.

Example See example for im_receive_field on page 141.

im_tcp_reconnect_notify Purpose

Syntax

This function determines if im_transmit_buffer returns the code IM_TCP_RECONNECT when the terminal TCP/IP stack reconnects to the host from a broken connection. This function must be called before im_transmit_buffer. void im_tcp_reconnect_notify(IM_BOOL flag)

IN Parameters flag

OUT Parameters

None

Return Value

None

Notes

Configures the TCP/IP stack as follows: IM_TRUE Directs im_transmit_buffer to return the code IM_TCP_RECONNECT when the terminal reconnects to the host. The data from the last im_transmit_buffer command was not sent from the terminal to the host and needs to be transmitted again. Also directs the PSK to not resend the message that was being sent when the network was identified as down. IM_FALSE Directs im_transmit_buffer to withhold the return code IM_TCP_RECONNECT. The terminal sends data from the last im_transmit_buffer command to the host when the connection has been reestablished. This is the default behavior of im_transmit_buffer.

Use this function only if you want the TCP/IP stack to notify you that the host connection has been reestablished. The default behavior of im_transmit_buffer does not notify the caller. This function does not affect im_transmit_buffer if you are using UDP Plus.

See Also im_transmit_buffer

Trakker Antares PSK Reference Manual

171

Page 192

Chapter 5, PSK Function Descriptions im_tcp_reconnect_notify (continued)

Example /**************************** im_tcp_reconnect_notify **********************/ #include <string.h> #include <conio.h> #include "imstdio.h" #include "imt24lib.h" void main(void) { IM_STATUS iStatus; IM_UCHAR pszComBuf[160]; im_clear_screen(); im_tcp_reconnect_notify(IM_TRUE); /* Indicates TCP/IP notify im_transmit_buffer when connection reestablished */ strcpy(pszComBuf, "Test TCP/IP notify text"); /* stuff test string */ iStatus = im_transmit_buffer(IM_NET, strlen(pszComBuf), pszComBuf, 5000L); if ( iStatus == IM_NET_TCP_RECONNECT) /* Reconnection occurs */ { im_timed_status_line("Reconnecting", 500, 16); /* Display message */ /* Resend the data */ iStatus = im_transmit_buffer(IM_NET, strlen(pszComBuf), pszComBuf,

5000L); } getch(); } im_timed_status_line Purpose

Syntax

172

This function displays an error message on the status line without wrapping or scrolling the display. The status line remains on the screen until you press a key or the timeout occurs. The original contents of the screen appear after the message disappears. #include "imt24lib.h" int far im_timed_status_line (char far *pszStatusLine, IM_USHORT iWait, IM_USHORT iLine);

Trakker Antares PSK Reference Manual

Page 193

Chapter 5, PSK Function Descriptions

IN Parameters pszStatusLine iWait iLine

OUT Parameters

None

Return Value

None

Far pointer to the string to be displayed. Time out value in milliseconds to wait before the status message disappears. Positive number for the line, relative to the top of the viewport, where the message appears. If the line number is larger than the viewport, the last line of the viewport is used.

Example See example for im_tcp_reconnect_notify on page 172.

im_tm_callback_cancel Purpose Syntax

This function removes a registered function from the timer callback database. #include "imt24lib.h" IM_STATUS im_tm_callback_cancel (IM_USHORT index);

IN Parameters index

OUT Parameters

None

Return Value

The number that identifies the registered function in the timer callback database. (This number was returned by im_tm_callback_register when the function was added to the timer callback database.)

The function returns one of these codes: IM_SUCCESS IM_INVALID_TMCALLBK_INDEX

Success The value for index is invalid

See Also im_tm_callback_register

Example See example for im_tm_callback_register on page 175.

Trakker Antares PSK Reference Manual

173

Page 194

Chapter 5, PSK Function Descriptions im_tm_callback_register Purpose Syntax

IN Parameters

This function adds a function to the timer callback database and specifies how the function will be called back. #include "imt24lib.h" IM_STATUS im_tm_callback_register (PTIMERCALLBACK function, time_t start_time, IM_USHORT repeat_count IM_ULONG period, IM_BOOL fDisable, IM_USHORT *index);

function start_time repeat_count period

174

Pointer to the function to be called. Specifies when to perform the first callback. Either enter the time as the number of seconds elapsed since midnight on January 1, 1970, or choose this constant: IM_CALLBK_NOW Start the first callback immediately Specifies the number of callbacks. Either enter any number from 2 to 65534 (two-byte range of IM_USHORT), or choose one of these constants: IM_CALLBK_ONCE Callback once IM_CALLBK_ Callback continuously CONTINUOUS Specifies the interval between callbacks. Either enter any number to indicate the length of the interval in 10millisecond units, or choose one of these constants: IM_CALLBK_10MS Callback every 10 ms IM_CALLBK_SECOND Callback every second IM_CALLBK_MINUTE Callback every minute IM_CALLBACK_HOUR Callback every hour IM_CALLBK_DAY Callback every day IM_CALLBK_WEEK Callback every week IM_CALLBK_MONTH Callback every month IM_CALLBK_QUARTER Callback every quarter IM_CALLBK_YEAR Callback every year

Trakker Antares PSK Reference Manual