The text of a manual · part 9 of 40
2D JANUS PSK for C/C++ Reference Manual, pages 81 to 90
Pages 81 to 90 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 81
im_increase_contrast
2 im_increase_contrast Purpose:
This function increases the LCD display contrast by one level. The display contrast is the lightness or darkness of the characters against the reader display. The reader display has 32 levels of contrast, where 0 is very light, and 31 is very dark.
Syntax:
#include <im20lib.h> IM_STATUS im_increase_contrast(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:
The 0 to 31 scale fine-tunes the contrast more precisely than using the keypad to adjust the contrast. The functions im_set_contrast and im_get_contrast use a scale of 0 to 7 that is related to the scale of 0 to 31 used by im_increase_contrast and im_decrease_contrast. The following table compares the two scales. This Value on Scale 0 to 7
Equates to This Value on Scale 0 to 31
Contrast Level
0 1 2 3 4 5 6 7
10 12 14 16 18 20 22 24
Very light
Very dark
This function has no effect on the JANUS 2050. See Also:
im_get_contrast, im_decrease_contrast, im_set_contrast
2-55
Page 82
im_increase_contrast
Example /******************** im_increase_contrast *******************************/ #include <stdio.h> #include "im20lib.h" #include "immsg.h" void main (void) { IM_STATUS status; status = im_increase_contrast(); /* If the most significant bit is set, there is an error */ if (IM_ISERROR(status)) printf("Inc Contrast error = %x\n", status); }
2-56
Page 83
im_input_status
2 im_input_status Purpose:
This function checks to see if any input buffers have data and returns the buffer identification.
Syntax:
#include <im20lib.h> IM_ORIGIN im_input_status (void);
IN Parameters:
None.
OUT Parameters:
None.
Return Value:
IM_ORIGIN is one or more of these constants: IM_NO_SELECT IM_LABEL_SELECT IM_KEYBOARD_SELECT IM_COM1_SELECT IM_COM2_SELECT IM_COM4_SELECT IM_ALL_SELECT
No input buffer selected Label selected Keypad selected COM1 selected COM2, scanner port selected (2010 and 2050) COM4 selected (RF only) All input buffers are selected
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_receive_input
2-57
Page 84
im_input_status
Example /******************** im_input_status /* Also with: im_receive_input */ /* im_get_length */
*******************************/
#include <stdio.h> #include <conio.h> #include <stdlib.h> #include "im20lib.h" #include "immsg.h" void main (void) { IM_UCHAR input[300]; IM_MODE original_mode; IM_ORIGIN source; IM_STATUS status; window(1, 1, 20, 16); clrscr();
/* Set the application text window */ /* Clear the screen */ printf("Demo im_input_status\n"); /* Get the previous input mode for restoring input mode later */ original_mode = im_get_input_mode(); /* Set Reader Wedge mode to program interface */ im_set_input_mode(IM_DESKTOP); /* Loop until some input */ while ( (source = im_input_status()) == IM_NO_SELECT) ; /* See where the input comes from */ if ( source == IM_COM1_SELECT) printf("COM1 input:"); else printf("COM4 input:"); /* Request input from source */ status = im_receive_input(source, IM_INFINITE_TIMEOUT, &source, input); if ( IM_ISGOOD(status) ) printf("\n%s\n", input); else /* input error */ { printf("\n"); im_message(status); }
/* Display input data */
/* Restore original input mode */ im_set_input_mode(original_mode); }
2-58
Page 85
im_irl_a
2 im_irl_a Purpose:
This function returns input from bar code labels or the keypad in the same manner as IRL ASCII input command A. This function returns the input data to the buffer, edits reader commands, and displays input data. For more information on IRL and command A, refer to the IRL Programming Reference Manual.
Syntax:
#include <im20lib.h> IM_STATUS im_irl_a (IM_USHORT timeout, IM_LENGTH_SPEC test_table[], IM_UCHAR mask_string[], IM_UCHAR *instring, IM_USHORT *cmd_count, IM_DECTYPE *symbology);
IN Parameters:
The timeout parameter is the receive timeout period. You can exit the function before data is received or before the timeout occurs by performing an application break sequence (see your JANUS user’s manual). The return status indicates whether the function was successful, a timeout occurred, or the application break was received. The timeout parameter is a number or one of these constants: 1 to 65,534 ms IM_ZERO_TIMEOUT IM_INFINITE_TIMEOUT
Numeric range No wait Wait forever
If IM_INFINITE_TIMEOUT is selected, the function will not return until the end of message character has been received. Data is returned only if its length matches one of the five lengths specified in the test_table. The test_table parameter must be a matrix of the following form: {a, b, c, d}, {a, b, c, d}, {a, b, c, d}, {a, b, c, d}, {a, b, c, d},
2-59
Page 86
im_irl_a
The a position in the matrix is one of the following: IM_NO_LENGTH IM_LENGTH IM_RANGE
Accept data of any length Accept data with a specific length Accept data within a length range
If IM_LENGTH is specified in the a position, the actual length of the data string is placed in the d position (and b and c are not used). If IM_RANGE is specified in the a position, the data length must be within the range of b and c (and d is not used). Set any unused table entries to {IM_NO_LENGTH,0,0,0}. The mask_string parameter sets up a data mask that received data must match. mask_string can accept a string of constants or wildcard characters. For example, use the string ### - #### to accept only phone numbers. You can use one or more of these wildcard characters to define the mask: # @ ? NULL (CHR$(0)) OUT Parameters:
Numeric Alpha Alphanumeric printable No mask
The instring parameter is the input string. You must allocate at least 256 bytes for instring. The cmd_count returned is 0 unless an abort command is passed in the string.
2-60
Page 87
im_irl_a
2
The symbology parameter is one of these constants: IM_UNKNOWN_DECODE IM_CODABAR IM_CODE_11 IM_CODE_16K IM_CODE_39 IM_CODE_49 IM_CODE_93 IM_CODE_128 IM_I_2_OF_5 IM_MSI IM_PDF_417 IM_PLESSEY IM_UPC
Unknown bar code Codabar bar code Code 11 bar code Code 16K bar code Code 39 bar code Code 93 bar code Code 49 bar code Code 128 bar code Interleaved 2 of 5 MSI bar code PDF 417 bar code Plessey bar code Universal Product code
Return Value:
This function returns one of the standard status codes defined in Appendix A, “Status Codes.”
Notes:
You must set the reader to Programmer mode with im_set_input_mode. You must install the Reader Wedge to use this function. For information on loading RWTSR.EXE, see “Runtime Requirements” earlier in this chapter. Data does not display correctly on the screen if the display is in the 80 x 25 mode after the cursor has scrolled off the bottom of the display. Set the display to one of the other modes using im_set_display_mode.
See Also:
im_irl_k, im_irl_n, im_irl_v, im_irl_y, im_set_display_mode, im_set_input_mode
2-61
Page 88
im_irl_a
Example /******************** im_irl_a ***************************************/ /* Also with: im_set_input_mode */ /* im_standby_wait */ #include <stdio.h> #include <conio.h> #include "im20lib.h" IM_LENGTH_SPEC length_table[IM_LENGTH_SPEC_MAX] = { {IM_LENGTH, 0, 0, 2}, {IM_RANGE, 7, 10, 0}, {IM_LENGTH, 0, 0, 4}, {IM_RANGE, 15, 17, 0}, {IM_LENGTH, 0, 0, 6} }; IM_UCHAR ssn_mask[] = "###–##–####"; void main (void) { IM_UCHAR input[256]; IM_USHORT cc; IM_DECTYPE symbol; window(1, 1, 20, 16); clrscr();
/* Set the application text window */ /* Clear the screen */ printf("Demo IRL A Bar Code\n"); printf(" '9' = 1st char to quit\n"); printf(" Example: '933-11-3333' \n"); /* Set Reader Wedge into PROGRAMMER mode im_set_input_mode(IM_PROGRAMMER);
*/
/* Input loop */ do { /* Test wait for 5 seconds */ printf("Start waiting for 5 seconds\n"); im_standby_wait(5000); printf("Done waiting for 5 seconds\n"); /* Display IRL A mask pattern */ printf("IRL A test mask\n"); printf(" = %s\n", ssn_mask); /* Request input from Reader Wedge */ im_irl_a(IM_INFINITE_TIMEOUT, length_table, ssn_mask, input, &cc, &symbol); printf("\n%s\n", input); } while (input[0] != '9');
/* '9' to quit */
/* Switch the Reader Wedge back to virtual wedge mode */ im_set_input_mode(IM_WEDGE); }
2-62
Page 89
im_irl_k
2 im_irl_k Purpose:
This function receives input from the keypad in any format in the same manner as IRL ASCII input command K. This function returns the input data to the buffer, edits reader commands, and displays input data. For more information on IRL and command K, refer to the IRL Programming Reference Manual.
Syntax:
#include <im20lib.h> IM_STATUS im_irl_k (IM_USHORT timeout, IM_LENGTH_SPEC test_table[], IM_UCHAR mask_string[], IM_UCHAR *instring, IM_USHORT *cmd_count);
IN Parameters:
The timeout parameter is the receive timeout period. You can exit the function before data is received or before the timeout occurs by performing an application break sequence (see your JANUS user’s manual). The return status indicates whether the function was successful, a timeout occurred, or the application break was received. The timeout parameter is a number or one of these constants: 1 to 65,534 ms IM_ZERO_TIMEOUT IM_INFINITE_TIMEOUT
Numeric range No wait Wait forever
If IM_INFINITE_TIMEOUT is selected, the function will not return until the end of message character has been received. Data is returned only if its length matches one of the five lengths specified in the test_table. The test_table parameter must be a matrix of the following form: {a, b, c, d}, {a, b, c, d}, {a, b, c, d}, {a, b, c, d}, {a, b, c, d},
2-63
Page 90
im_irl_k
The a position in the matrix is one of the following: IM_NO_LENGTH IM_LENGTH IM_RANGE
Accept data of any length Accept data of a specific length Accept data within a length range
If IM_LENGTH is specified in the a position, the actual length of the data string is placed in the d position (and b and c are not used). If IM_RANGE is specified in the a position, the data length must be within the range of b and c (and d is not used). Set any unused table entries to {IM_NO_LENGTH,0,0,0}. The mask_string parameter sets up a data mask that received data must match. mask_string can accept a string of constants or wildcard characters. For example, use the string ### - #### to accept only phone numbers. You can use one or more of these wildcard characters to define the mask: # @ ? NULL (CHR$(0)) OUT Parameters:
Numeric Alpha Alphanumeric printable No mask
The instring parameter is the input string. You must allocate at least 256 bytes for instring. The cmd_count returned is 0 unless an abort command is passed in the string.
Return Value:
This function returns one of the standard status codes defined in Appendix A, “Status Codes.”
Notes:
You must set the reader to Programmer mode with im_set_input_mode. You must install the Reader Wedge to use this function. For information on loading RWTSR.EXE, see “Runtime Requirements” earlier in this chapter. Data does not display correctly on the screen if the display is in the 80 x 25 mode after the cursor has scrolled off the bottom of the display. Set the display to one of the other modes using im_set_display_mode.
2-64