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

JANUS PSK for Ada Reference Manual, pages 171 to 180

Pages 171 to 180 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 171

im_transmit_buffer_no_wait

3 im_transmit_buffer_no_wait Purpose:

This function transmits the contents of the transmit buffer and passes control back to its client.

Syntax:

With Intrmecd_IO, Intrmecp_IO; Use Intrmecd_IO, Intrmecp_IO; function im_transmit_buffer_no_wait ( port : IN IM_COM_PORT; data_struct : IN System.Address ) return System.Word;

IN Parameter:

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

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

The data_struct parameter is the address of the IM_COM_DATA_BUFFER record, which contains transmission information. OUT Parameter:

None.

Return Value:

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

Notes:

This function differs from im_transmit_buffer in that the client must set the buffer structure and monitor the buffer status until transmission is complete. Use this function for multiple buffer transmissions in conjunction with checking the status in data_struct. You must install a protocol handler to use this function. You must build and maintain the IM_COM_DATA_BUFFER record.

See Also:

im_transmit_buffer_noprot, im_cancel_tx_buffer

Example See example for im_receive_buffer_no_wait.

3-131

Page 172

im_transmit_buffer_noprot im_transmit_buffer_noprot Purpose:

This function transmits a buffer without protocol and sends only the specified number of characters.

Syntax:

With Intrmecd_IO, Intrmecp_IO; Use Intrmecd_IO, Intrmecp_IO; function im_transmit_buffer_noprot ( port : IN IM_COM_PORT; user_length : IN System.Word; buffer : IN System.Address; timeout : IN System.Word ) return System.Word;

IN Parameter:

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

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

The user_length parameter is the maximum number of characters to transmit. The buffer parameter is the address of the string to transmit. The timeout parameter is the transmission timeout period. You can exit the function before data is sent 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. OUT Parameter:

3-132

None.

Page 173

im_transmit_buffer_noprot

3

Return Value:

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

Notes:

You must install a protocol handler other than PHPCSTD.EXE to use this function. If an existing transmit client is linked to the host, you must issue a cancel command first.

See Also:

im_transmit_buffer_no_wait, im_cancel_tx_buffer, im_transmit_buffer

Example See example for im_receive_buffer_noprot.

3-133

Page 174

im_transmit_byte im_transmit_byte Purpose:

This function transmits one byte of data out from the designated communications port. This function is identical to MS-DOS INT 14H Service 01H.

Syntax:

With Intrmecd_IO, Intrmecp_IO; Use Intrmecd_IO, Intrmecp_IO; function im_transmit_byte ( port : IN IM_COM_PORT; transmit_byte : IN Character ) return System.Word;

IN Parameter:

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

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

The transmit_byte parameter is the byte of data to transmit. OUT Parameter:

None.

Return Value:

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

Notes:

This function requires the PC standard protocol handler PHPCSTD.EXE. Intermec recommends using im_transmit_buffer (with a user_length of one) instead of using im_transmit_byte. You can use this function for an acknowledgment.

See Also:

3-134 im_receive_byte, im_transmit_buffer

Page 175

im_transmit_byte

3

Example With System, DosCall, Text_IO, Intrmecd_IO, Intrmecp_IO; Use System, DosCall, Text_IO, Intrmecd_IO, Intrmecp_IO; procedure txbyte Is status : System.Word; TX_byte : Character := ' '; eom_char : Character; setup_comm_status : Integer; function setup_com (port : System.Word) return Integer Is -- This function sets up the communications port for RS232, -- 9600 baud, even parity, 7 data bits, and 1 stop bit using -- a DosCall procedure. RS232 : Constant Integer := 16#14#; B9600 : Constant System.Word := 16#E0#; EVEN : Constant System.Word := 16#18#; WORD7 : Constant System.Word := 16#02#; STOP1 : Constant System.Word := 16#00#; Regs : DosCall.Simple_Regs; setup : System.Word; begin setup := 0; if ((port /= 0) and (port /= 1)) then return -1; end if; setup := B9600 + WORD7 + EVEN + STOP1; Regs.AX := setup; Regs.DX := port; DosCall.Simple_Int_Call (RS232, Regs); return 0; -- Good return end setup_com; --************************* main program starts here ***************** begin -- Phimec protocol handler must NOT be installed to run this routine -- get the comm environment ready setup_comm_status := setup_com(0); if setup_comm_status = 0 then eom_char := 'q'; Put_Line("Enter characters at"); Put_Line("Janus keypad"); Put_Line("q to end"); TX_byte := Ascii.NUL; loop Get (TX_byte); if TX_byte = Ascii.CR then New_Line; end if; exit when TX_byte = eom_char; -- Transmit bytes until 'q' is entered status := im_transmit_byte (IM_COM1, TX_byte);

3-135

Page 176

im_transmit_byte if (im_iserror(status)) then Put ("tx byte status = "); im_message (status); New_Line; end if; end loop; New_Line; Put_Line ("Transmit done"); else Put_Line("Com setup failed"); im_message (System.Word(setup_comm_status)); New_Line; end if; end txbyte;

3-136

Page 177

im_unlink_comm

3 im_unlink_comm Purpose:

This function removes the link between the Reader Wedge function and a designated communications port. After this function executes, the Reader Wedge is not notified of receive buffer functions. You only need to use this procedure one time, at the end of your program.

Syntax:

With Intrmecd_IO, Intrmecp_IO; Use Intrmecd_IO, Intrmecp_IO; function im_unlink_comm ( port : IN IM_COM_PORT ) return System.Word;

IN Parameter:

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

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

OUT Parameter:

None.

Return Value:

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

Notes:

You must install a protocol handler to use this 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.”

See Also:

im_link_comm

Example See example for im_irl_y.

3-137

Page 178

im_viewport_end im_viewport_end Purpose:

This procedure sets the viewport to the lower right corner (end) of the virtual display.

Syntax:

With Intrmecd_IO, Intrmecp_IO; Use Intrmecd_IO, Intrmecp_IO; procedure im_viewport_end;

IN Parameters:

None.

OUT Parameters:

None.

Return Value:

None.

Notes:

This function has no effect on the JANUS 2050.

See Also:

im_cursor_to_viewport, im_viewport_home, im_viewport_page_down, im_viewport_page_up, im_viewport_to_cursor, im_viewport_move

Example With System, Intrmecd_IO, Intrmecp_IO; Use System, Intrmecd_IO, Intrmecp_IO; procedure view_end Is begin im_viewport_end; end view_end;

3-138

Page 179

im_viewport_getxy

3 im_viewport_getxy Purpose:

This function retrieves the column and row of the upper left corner of the viewport.

Syntax:

With Intrmecd_IO, Intrmecp_IO; Use Intrmecd_IO, Intrmecp_IO; procedure im_viewport_getxy ( row : OUT System.Word; column : OUT System.Word; status_code : OUT System.Word);

IN Parameter:

None.

OUT Parameter:

The row parameter retrieves the row value (Y-coordinate) of viewport. The column parameter retrieves the column value (X-coordinate) of viewport. The status_code parameter is a standard status code listed in Appendix A, “Status Codes.”

Return Value:

None.

Notes:

This function is valid only when the display is in 80X25 mode. This function has no effect on the JANUS 2050.

See Also:

im_viewport_setxy, im_viewport_move, im_viewport_page_up, im_viewport_page_down, im_viewport_to_cursor, im_viewport_end, im_viewport_home.

3-139

Page 180

im_viewport_getxy

Example With System, Text_IO, Intrmecd_IO, Intrmecp_IO; Use System, Text_IO, Intrmecd_IO, Intrmecp_IO; procedure vpgetxy Is package SYSWORD_IO is new INTEGER_IO (System.Word); row : System.Word; col : System.Word; status : System.Word; wait_status : System.Word; begin im_viewport_getxy (row, col, status); Put_Line ("Getting viewport"); if im_isgood(status) then Put_Line ("Viewport:"); Put (" X :"); SYSWORD_IO.Put (row, Width => 3); New_Line; Put (" Y :"); SYSWORD_IO.Put (col, Width => 3); New_Line; else Put_Line ("Viewport GetXY Error:"); SYSWORD_IO.Put (status, Width => 8); New_Line; end if; Put_Line ("Setting viewport"); Put_Line ("row to 8"); Put_Line ("col to 10"); row := 8; col := 10; im_viewport_setxy (row, col, status); wait_status := im_standby_wait(3000); if im_isgood(status) then Put ("Viewport:"); New_Line; Put (" X :"); SYSWORD_IO.Put (row, Width => 3); New_Line; Put (" Y :"); SYSWORD_IO.Put (col, Width => 3); New_Line; else Put_Line ("Viewport SetXY Error:"); SYSWORD_IO.Put (status, Width => 8); New_Line; end if; end vpgetxy;

3-140