The text of a manual · part 10 of 42
JANUS PSK for C/C++ Reference Manual, Version 2.1, pages 91 to 100
Pages 91 to 100 of 414
The original document is the PDF (690 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 91
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_PLESSEY IM_UPC
Unknown bar code Codebar 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 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-63
Page 92
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'9' to quit\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 = %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-64
Page 93
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-65
Page 94
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-66
Page 95
im_irl_k
See Also:
2 im_irl_a, im_irl_n, im_irl_v, im_irl_y, im_set_display_mode, im_set_input_mode
Example /******************** im_irl_k ***************************************/ /* Also with: im_set_input_mode and im_standby_wait */ #include <stdio.h> #include <conio.h> #include <stdlib.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 mix_mask[] = "?#@#"; void main (void) { IM_UCHAR input[256]; IM_USHORT cc; window(1, 1, 20, 16); /* Set the reader services text window */ clrscr(); /* Clear the screen */ printf("Demo IRL K Bar Code\n 'Q' to quit\n"); /* Set Reader Wedge into PROGRAMMER mode */ im_set_input_mode(IM_PROGRAMMER); /* Input loop --Display IRL K mask pattern */ do { printf("IRL K test mask = %s\n", mix_mask); /* Request input from Reader Wedge */ im_irl_k(IM_INFINITE_TIMEOUT, length_table, mix_mask, input, &cc); printf("\n%s\n", input); /* Upper case first char of input for testing quit */ input[0] = toupper(input[0]); } while (input[0] != 'Q'); /* 'Q' to quit */ /* Switch the Reader Wedge back to virtual wedge mode */ im_set_input_mode(IM_WEDGE); }
2-67
Page 96
im_irl_n im_irl_n Purpose:
This function receives numeric input from the keypad or a label in the same manner as IRL numeric input command N. Nonnumeric data is ignored. This function clears any data existing in the keypad or label buffers before the function was called, edits reader commands from input, and displays input data. For more information on IRL and command N, refer to the IRL Programming Reference Manual.
Syntax:
#include <im20lib.h> IM_STATUS im_irl_n (IM_USHORT timeout, IM_LENGTH_SPEC test_table[], 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-68
Page 97
im_irl_n
2
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}. OUT Parameters:
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. 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_PLESSEY IM_UPC
Unknown bar code Codebar 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 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.
Notes:
You must install the Reader Wedge to use this function. For information on loading RWTSR.EXE, see “Runtime Requirements” earlier in this chapter.
2-69
Page 98
im_irl_n
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_a, im_irl_k, im_irl_v, im_irl_y, im_set_input_mode
Example /******************** im_irl_n **************************************/ #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} }; void main (void) { IM_UCHAR input[256]; IM_USHORT cc; IM_DECTYPE symbol; window(1, 1, 20, 16); /* Set the reader services text window */ clrscr(); /* Clear the screen */ printf("Demo IRL N Bar Code\n'9' to quit\n"); /* Set Reader Wedge mode to program interface */ im_set_input_mode(IM_PROGRAMMER); /* Input loop */ do { /* Display IRL N test */ printf("IRL N test\n"); /* Request input from Reader Wedge */ im_irl_n(IM_INFINITE_TIMEOUT, length_table, 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-70
*/
Page 99
im_irl_v
2 im_irl_v Purpose:
This function receives input from any specified source in any format, in the same manner as an IRL universal input command V. For more information on IRL and command V, refer to the IRL Programming Reference Manual.
Syntax:
#include <im20lib.h> IM_STATUS im_irl_v (IM_USHORT timeout, IM_CONTROL edit, IM_LABEL_BEEP_CONTROL beep, IM_CONTROL display, IM_ORIGIN *source, 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. The edit parameter determines whether the Reader Wedge parses reader commands. Use one of these constants: IM_DISABLE IM_ENABLE
Disable reader command parsing Enable reader command parsing
If edit is IM_DISABLED, reader commands are treated as data.
2-71
Page 100
im_irl_v
The beep parameter determines whether the IRL V command beeps or not when data is entered. If beep is set to IM_APPLI_BEEP, the Reader Wedge does not control the beep. Instead, you code the application to sound a beep when your program design requires one. If beep is set to IM_WEDGE_BEEP, the reader always beeps when data is entered. The beep parameter is one of these constants: IM_APPLI_BEEP IM_WEDGE_BEEP
Application controls the beep Beeps occur automatically
The display parameter determines if the data is displayed as it is entered. The display parameter is one of these constants: IM_DISABLE IM_ENABLE IN/OUT Parameters:
Disable display of data Enable display of data
The source parameter determines which input sources are allowed. When the IRL V command returns, source indicates where the data came from. When both keypad and label inputs are allowed, the source always returns keypad because it is possible for keyed and scanned data to be intermixed. Although intermixing is possible, it is not likely to occur. If you have both the keypad and scanner enabled, and you want to know where the data came from, first check the symbology: • If the symbology is IM_UNKNOWN_DECODE, then the data came from the keypad. • If the symbology is one of the other values (such as IM_CODE_39), then some or all of the data came from the scanner. • If only the scanner is enabled, then all of the data came from the scanner.
2-72