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 5 of 40

2D JANUS PSK for C/C++ Reference Manual, pages 41 to 50

Pages 41 to 50 of 400

The original document is the PDF (793 KB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.

For the Intermec J2020, Intermec J2010 and Intermec J2050

Page 41

C Language Support

2

Sound im_sound, 2-137

System im_command, 2-24 im_get_postamble, 2-46 im_get_preamble, 2-47 im_message, 2-85 im_power_status, 2-91 im_rs_installed, 2-113 im_standby_wait, 2-142

Viewport im_cursor_to_viewport, 2-26 im_get_config_info, 2-29 im_get_follow_cursor, 2-37 im_get_viewport_lock, 2-51 im_set_follow_cursor, 2-128 im_set_viewport_lock, 2-132 im_viewport_end, 2-154 im_viewport_getxy, 2-155 im_viewport_home, 2-156 im_viewport_move, 2-157 im_viewport_page_down, 2-159 im_viewport_page_up, 2-160 im_viewport_setxy, 2-161 im_viewport_to_cursor, 2-165

Note: The following syntax descriptions refer to many named constant variables, such as IM_COM1. These variables always appear in uppercase and are described in IM20LIB.H.

2-15

Page 42

im_appl_break_status im_appl_break_status Purpose:

This function checks whether the application break sequence has been pressed. All PSK functions are terminated when the application break sequence is keyed in. Place calls to this function at strategic locations in your program to detect when a user wants to break out of a loop. Your program can determine what action to take when the break sequence is detected.

Syntax:

#include <im20lib.h> IM_STATUS im_appl_break_status (IM_APPBREAK_STATUS *brk);

IN Parameters:

None.

OUT Parameters:

The brk parameter returns a nonzero value if the break status bit is set and zero if it is not set.

Return Value:

This function returns one of the standard status codes defined in Appendix A, “Status Codes.”

Notes:

The brk flag is reset each time the routine is called. Because this function is also called during the input routines provided in the library, you should check the return code from input functions for the hex value 8515H. This value indicates that the input function has terminated because the application break sequence was entered. In this case, brk is cleared by the input function’s call to im_appl_break_status. For more information on the application break sequence, refer to your JANUS user’s manual. To enter an application break sequence 1. Press 2. Press 3. Press 4. Press

2-16

L IB

L to turn off the reader. -

- at the same time.

. This sets the reader’s application break bit.

to turn on the reader.

Page 43

im_appl_break_status

2

Example /******************** im_appl_break_status *****************************/ #include <stdio.h> #include <stdlib.h> #include <conio.h> #include "im20lib.h" void main (void) { IM_STATUS status; IM_APPBREAK_STATUS brk; /* Pause for key stroke */ while ( !kbhit() ) ; /* To set the break bit: */ /* Press the following sequence at this pause: */ /* I/O key (Turn OFF the reader) */ /* F3+2+Left Arrow (Press F3, 2, and left arrow at the same time) */ /* 1 (Press the 1 (one) key to set application break bit) */ /* I/O key (Turn the reader ON) */ /* Enter key */ /* Leave the break bit unset: Press any key. */ /* Set brk to known value */ brk = 99; /* Call Intermec function. Everytime the break bit is checked, it is cleared*/ status = im_appl_break_status ( &brk); if (brk) { /* brk should return a -1 if bit is set */ printf ("Break status ON\n"); printf ("return status: %4X\n", status); printf ("break status: %d\n", brk); } else { /* brk should return a 0 if bit is not set */ printf ("Break status OFF\n"); printf ("return status: %4X\n", status); printf ("break status: %d\n", brk); } }

Note: Break is reserved. So, do not name the application Break.cpp.

2-17

Page 44

im_backlight_off im_backlight_off Purpose:

This function turns the display backlight off. Turn off the backlight to prolong the reader’s battery life.

Syntax:

#include <im20lib.h> void im_backlight_off(void);

IN Parameters:

None.

OUT Parameters:

None.

Return Value:

None.

Notes:

You can program the backlight to automatically turn off after a specified time to save battery power. The length of time depends on the backlight timeout configuration parameter. The configuration parameter is set in 1-second increments. The default is 10 seconds. This function has no effect on the JANUS 2050.

See Also:

im_backlight_on, im_backlight_toggle

Example /******************** im_backlight_off *****************************/ #include <stdio.h> #include "im20lib.h" void main (void) { im_backlight_off(); printf("Backlight off\n"); }

2-18

Page 45

im_backlight_on

2 im_backlight_on Purpose:

This function turns the display backlight on to illuminate the reader display in dimly lit environments.

Syntax:

#include <im20lib.h> void im_backlight_on(void);

IN Parameters:

None.

OUT Parameters:

None.

Return Value:

None.

Notes:

You can program the backlight to automatically turn off after a specified time to save battery power. The length of time depends on the backlight timeout configuration parameter. The configuration parameter is set in 1-second increments. The default is 10 seconds. This function has no effect on the JANUS 2050.

See Also:

im_backlight_off, im_backlight_toggle

Example /******************** im_backlight_on *****************************/ #include <stdio.h> #include "im20lib.h" void main (void) { im_backlight_on(); printf("Backlight on\n"); }

2-19

Page 46

im_backlight_toggle im_backlight_toggle Purpose:

This function toggles the display backlight ON and OFF.

Syntax:

#include <im20lib.h> void im_backlight_toggle(void);

IN Parameters:

None.

OUT Parameters:

None.

Return Value:

None.

Notes:

You can program the backlight to automatically turn off after a specified time to save battery power. The length of time depends on the backlight timeout configuration parameter. The configuration parameter is set in 1-second increments. The default is 10 seconds. This function has no effect on the JANUS 2050.

See Also:

im_backlight_on, im_backlight_off

Example /******************** im_backlight_toggle *****************************/ #include <stdio.h> #include "im20lib.h" void main (void) { im_backlight_toggle(); printf("Backlight switched on/off\n"); }

2-20

Page 47

im_cancel_rx_buffer

2 im_cancel_rx_buffer Purpose:

This function clears the receive buffer of the designated communications port.

Syntax:

#include <im20lib.h> IM_STATUS im_cancel_rx_buffer (IM_COM_PORT port_id);

IN Parameters:

The port_id parameter identifies the communications port as follows: IM_COM1 IM_COM2 IM_COM4

COM1 COM2, scanner port (2010 and 2050) COM4 (RF only)

OUT Parameters:

None.

Return Value:

This function returns one of the standard status codes defined in Appendix A, “Status Codes.” If there is no input pending to receive, this function returns 4602H (no client).

Notes:

You must install a protocol handler to use this function.

See Also:

im_receive_buffer_no_wait, im_receive_buffer_noprot

Example See example for im_receive_buffer_no_wait.

2-21

Page 48

im_cancel_tx_buffer im_cancel_tx_buffer Purpose:

This function clears the contents of the transmit buffer for a designated communications port, stops transmission in progress, and resets the communications port. Use this function with Polling Mode D to clear out the buffer. Other protocols clear the buffer automatically. You can also use this function to clear a busy port.

Syntax:

#include <im20lib.h> IM_STATUS im_cancel_tx_buffer (IM_COM_PORT port_id);

IN Parameters:

The port_id parameter identifies the communications port as follows: IM_COM1 IM_COM2 IM_COM4

COM1 COM2, scanner port (2010 and 2050) COM4 (RF only)

OUT Parameters:

None.

Return Value:

This function returns one of the standard status codes defined in Appendix A, “Status Codes.”

Notes:

You must install a protocol handler to use this function.

See Also:

im_transmit_buffer_no_wait, im_transmit_buffer_noprot, im_transmit_buffer

Example See example for im_transmit_buffer_no_wait.

2-22

Page 49

im_clear_abort_callback

2 im_clear_abort_callback Purpose:

This function clears the notification (callback) mode of the Virtual Wedge.

Syntax:

#include <im20lib.h> IM_STATUS im_clear_abort_callback(void);

IN Parameters:

None.

OUT Parameters:

None.

Return Value:

This function returns one of the standard status codes defined in Appendix A, “Status Codes.”

Notes:

You must install the Reader Wedge to use this function. For information on loading RWTSR.EXE, see “Runtime Requirements” earlier in this chapter.

See Also:

im_set_abort_callback

Example See example for im_set_abort_callback.

2-23

Page 50

im_command im_command Purpose:

This function modifies the reader’s configuration. For example, you can use this function to set a specific communications port’s baud rate.

Syntax:

#include <im20lib.h> IM_STATUS im_command (IM_UCHAR *command, IM_USHORT command_length);

IN Parameters:

The command parameter is a reader command string. The command string may include more than one reader command. For example, the command string %.1$+BV9 turns on the backlight and raises the beep volume. Reader commands are listed in your JANUS user’s manual. The command_length parameter is the length of the reader command string.

OUT Parameters:

None.

Return Value:

This function returns one of the standard status codes defined in Appendix A, “Status Codes.”

Notes:

For more information on using im_command, see your JANUS user’s manual. You must install the Reader Wedge to use this function. For information on loading RWTSR.EXE, see “Runtime Requirements” earlier in this chapter.

2-24