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 10 of 25

JANUS PSK for Ada Reference Manual, pages 91 to 100

Pages 91 to 100 of 250

The original document is the PDF (415 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_k

3 im_irl_k Purpose:

This procedure receives input from the keypad in any format in the same manner as IRL ASCII input command K. This procedure 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:

With Intrmecd_IO, Intrmecp_IO; Use Intrmecd_IO, Intrmecp_IO; procedure im_irl_k ( timeout : In System.Word; test_table : In IM_LENGTH_SPEC_ARRAY_PTR; mask_string : In String; irl_string : Out String; cmd_count : Out System.Word; status_code : Out System.Word);

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 numeric range for timeout is from 1 to 65,534 ms. You can also use one of the following constants: IM_ZERO_TIMEOUT IM_INFINITE_TIMEOUT

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 in this form: {a, b, c, d}, {a, b, c, d}, {a, b, c, d}, {a, b, c, d}, {a, b, c, d},

3-51

Page 92

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

You must allocate at least 256 bytes to the irl_string parameter. The cmd_count returned is 0 unless an abort command is passed in the string. The status_code parameter is a standard status codes listed in Appendix A, “Status Codes.”

Return Value:

3-52

None.

Page 93

im_irl_k

Notes:

3

You must set the reader to Programmer mode with the im_set_input_mode function. You must install the Reader Wedge to use this function. For information on loading RWTSR.EXE, see “Runtime Requirements” in Chapter 2, “Working With Ada.” Data does not display correctly on the screen if the display is in the 80X25 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_n, im_irl_v, im_irl_y, im_set_display_mode, im_set_input_mode

Example With System, Text_IO, Intrmecd_IO, Intrmecp_IO; Use System, Text_IO, Intrmecd_IO, Intrmecp_IO; procedure ex_irl_k is cmd_count : System.Word; display_status : System.Word; irl_string : String(1..256); length_table : IM_LENGTH_SPEC_ARRAY; mask : String(1..80) := (others => Ascii.NUL); status : System.Word; timeout : System.Word := 30000; -- 30 second timeout begin length_table := IM_LENGTH_SPEC_ARRAY'( (IM_LENGTH, 0, 0, 0), (IM_LENGTH, 0, 0, 0), (IM_LENGTH, 0, 0, 0), (IM_LENGTH, 0, 0, 0), (IM_LENGTH, 0, 0, 0)); -- Set display mode to something other than 80X25 display_status := im_set_display_mode(IM_SIZE_MODE_20X16, IM_STD_VIDEO_MODE_0, IM_LCD_SCROLL_AT_16, IM_STANDARD_CHAR_HEIGHT); Put_Line(" Example im_irl_k"); New_Line; Put_Line("Enter 8 AlphaNums"); Put_Line(" from keyboard"); Put_Line("q to quit"); -- Set Reader Wedge mode to program interface im_set_input_mode(IM_PROGRAMMER); mask(1..8) := "????????"; loop -- Clear input string irl_string := (others => Ascii.NUL);

3-53

Page 94

im_irl_k

-- Read input from keyboard im_irl_k (timeout, length_table, mask, irl_string, cmd_count, status); exit when irl_string(1) = 'q'; if im_isgood(status) then New_Line; Put("Data::"); Put(irl_string(1..8)); Put("::"); New_Line; else im_message(status); New_Line; end if; end loop; -- Set Reader Wedge mode back to Virtual Wedge mode im_set_input_mode(IM_WEDGE); -- Set display mode back to 80X25 display_status := im_set_display_mode(IM_SIZE_MODE_80X25, IM_STD_VIDEO_MODE_3, IM_LCD_SCROLL_AT_16, IM_STANDARD_CHAR_HEIGHT); end ex_irl_k;

3-54

Page 95

im_irl_n

3 im_irl_n Purpose:

This procedure receives numeric input from the keypad or a label in the same manner as IRL numeric input command N. Nonnumeric data is ignored. This procedure 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. This procedure corresponds to IRL command N. Refer to the IRL Programming Reference Manual for more information on IRL commands.

Syntax:

With Intrmecd_IO, Intrmecp_IO; Use Intrmecd_IO, Intrmecp_IO; procedure im_irl_n ( timeout : In System.Word; test_table : In IM_LENGTH_SPEC_ARRAY_PTR; irl_string : Out String; cmd_count : Out System.Word; symbology : Out IM_DECTYPE; status_code : Out System.Word);

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 numeric range for timeout is from 1 to 65,534 ms. You can also use one of the following constants: IM_ZERO_TIMEOUT IM_INFINITE_TIMEOUT

No wait Wait forever

If IM_INFINITE_TIMEOUT is selected, the function will not return until the end of message character has been received.

3-55

Page 96

im_irl_n

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 in this form: {a, b, c, d}, {a, b, c, d}, {a, b, c, d}, {a, b, c, d}, {a, b, c, d}, The a position in the matrix is one of the following: IM_NO_LENGTH Accept data of any length IM_LENGTH Accept data of a specific length IM_RANGE 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:

You must allocate at least 256 bytes to the irl_string parameter. The cmd_count returned is 0 unless an abort command is passed in the string. The symbology parameter is one of the following constants: IM_UNKNOWN_DECODE IM_CODABAR IM_CODE_11 IM_CODE_16K IM_CODE_39 IM_CODE_49 IM_CODE_93 IM_CODE_128

3-56

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

Page 97

im_irl_n

IM_I_2_OF_5 IM_MSI IM_PLESSEY IM_UPC

3

Interleaved 2 of 5 MSI bar code Plessey bar code Universal Product code

The status_code parameter is a standard status codes listed in Appendix A, “Status Codes.” Return Value:

None.

Notes:

You must set the reader to Programmer mode with the im_set_input_mode function. You must install the Reader Wedge to use this function. For information on loading RWTSR.EXE, see “Runtime Requirements” in Chapter 2, “Working With Ada.” Data does not display correctly on the screen if the display is in the 80X25 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, im_set_display_mode

Example With System, Text_IO, Intrmecd_IO, Intrmecp_IO; Use System, Text_IO, Intrmecd_IO, Intrmecp_IO; procedure ex_irl_n is cmd_count : System.Word; display_status : System.Word; irl_string : String(1..256); length_table : IM_LENGTH_SPEC_ARRAY; status : System.Word; symbol : IM_DECTYPE; package SYMBOL_IO is new ENUMERATION_IO(enum=>IM_DECTYPE); begin length_table := IM_LENGTH_SPEC_ARRAY'( (IM_LENGTH, 0, 0, 2), (IM_RANGE, 9, 14, 0), (IM_LENGTH, 0, 0, 4), (IM_RANGE, 16, 17, 2), (IM_LENGTH, 0, 0, 6));

3-57

Page 98

im_irl_n

-- Set display mode to something other than 80X25 display_status := im_set_display_mode(IM_SIZE_MODE_20X16, IM_STD_VIDEO_MODE_0, IM_LCD_SCROLL_AT_16, IM_STANDARD_CHAR_HEIGHT); Put_Line(" Example im_irl_n"); New_Line; Put_Line("Enter Numeric data"); Put_Line(" from keyboard"); Put_Line(" or read label"); Put_Line("99 to quit"); -- Set Reader Wedge mode to program interface im_set_input_mode(IM_PROGRAMMER); loop -- Clear input string irl_string := (others => Ascii.NUL); -- Read numeric input from keyboard or label im_irl_n (IM_INFINITE_TIMEOUT, length_table, irl_string, cmd_count, symbol, status); exit when irl_string(1..2) = "99"; if im_isgood(status) then New_Line; Put_Line("Data read: "); -- Print only printable charaters for i in Integer range 1..256 loop exit when irl_string(i) = Ascii.NUL; if irl_string(i) in '0'..'9' then Put(irl_string(i)); else Put('?'); end if; end loop; New_Line; Put_Line("The symbology read:"); SYMBOL_IO.Put(symbol); New_Line; else im_message(status); New_Line; end if; end loop; -- Set Reader Wedge mode back to Virtual Wedge mode im_set_input_mode(IM_WEDGE); -- Set display mode back to 80X25 display_status := im_set_display_mode(IM_SIZE_MODE_80X25, IM_STD_VIDEO_MODE_3, IM_LCD_SCROLL_AT_16, IM_STANDARD_CHAR_HEIGHT); end ex_irl_n;

3-58

Page 99

im_irl_v

3 im_irl_v Purpose:

This procedure 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. This procedure corresponds to IRL command V. Refer to the IRL Programming Reference Manual for more information on IRL commands.

Syntax:

With Intrmecd_IO, Intrmecp_IO; Use Intrmecd_IO, Intrmecp_IO; procedure im_irl_v ( timeout : In System.Word; edit : In IM_CONTROL; beep : In IM_LABEL_BEEP_CONTROL; display : In IM_CONTROL; source : In Out IM_ORIGIN; irl_string : Out String; cmd_count : Out System.Word; symbology : Out IM_DECTYPE; status_code : Out System.Word);

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 numeric range for timeout is from 1 to 65,534 ms. You can also use one of the following constants: IM_ZERO_TIMEOUT IM_INFINITE_TIMEOUT

No wait Wait forever

If IM_INFINITE_TIMEOUT is selected, the function will not return until the end of message character has been received. If IM_INFINITE_TIMEOUT is selected, the function does not return until data is received.

3-59

Page 100

im_irl_v

The edit parameter determines whether the Reader Wedge parses reader commands. Use one of the following constants: IM_DISABLE IM_ENABLE

Disable reader command parsing Enable reader command parsing

If edit is IM_DISABLED, reader commands are treated as data. 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 the following constants: IM_APPLI_BEEP Application controls the beep IM_WEDGE_BEEP Beeps occur automatically The display parameter determines if the data is displayed as it is entered. The display parameter is one of the following 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 keyboard and label inputs are allowed, the source always returns keyboard 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 keyboard and scanner enabled, and you want to know where the data came from, first check the symbology:

3-60