Xcomm.ada - Intermec Janus 2010 Reference Manual

Intermec janus 2010: reference guide
Hide thumbs Also See for Janus 2010:
Table of Contents

Advertisement

XCOMM.ADA

-- File Name:
xcomm.ada
--
-- Purpose
:
This sample program receives data from the communications
--
port 1 and transmits the same data back across the comm1
--
port. It expects a carriage return as the end-of-message
--
character. Program execution continues until the operator
--
sends a 'q' as the first byte in the buffer. This program
--
uses Intermec's Ada procedures im_receive_buffer_noprot,
--
im_transmit_buffer_noprot, im_cancel_rx_buffer, and
--
im_cancel_tx_buffer.
--
-- COPYRIGHT (c) 1994 INTERMEC CORPORATION, ALL RIGHTS RESERVED
With System, Intrmecd_IO, Intrmecp_IO, Text_IO;
Use
System, Intrmecd_IO, Intrmecp_IO, Text_IO;
procedure xcomm Is
package SYSWORD_IO is new INTEGER_IO (System.Word);
status
: System.Word;
comm_length
: System.Word := 0;
timeout
: System.Word := 20000;
eom_char
: System.Byte := 16#0D#;
RX_data_buffer : String (1..300) := (others => Ascii.NUL);
TX_data_buffer : String (1..300) := (others => Ascii.NUL);
RX_buff_length : System.Word := System.Word(RX_data_buffer'Length);
TX_buff_length : System.Word;
RX_data_ptr
: System.Address := RX_data_buffer'Address;
TX_data_ptr
: System.Address := TX_data_buffer'Address;
done
: Boolean := FALSE;
begin
-- Phimec protocol handler must be installed to run this routine
New_Line(2);
Put_Line("
Janus 2010 ");
Put_Line("Rx/Tx Buffer No Prot");
New_Line;
-- get the receive environment ready
status := im_cancel_rx_buffer(IM_COM1);
if (im_iserror(status)) then
Put ("canc rx1 error = ");
im_message (status);
New_Line;
end if;
-- Clear the transmission buffer
status := im_cancel_tx_buffer (IM_COM1);
Put_Line("Ready to receive");
Put_Line("q to quit...");
New_Line;
-- call Intermec function
im_receive_buffer_noprot (IM_COM1, RX_Buff_length, RX_data_ptr,
IM_INFINITE_TIMEOUT, eom_char, comm_length, status);
-- 20 seconds
-- CR for terminating char
B
XCOMM.ADA
B-9

Advertisement

Table of Contents
loading

This manual is also suitable for:

Janus 2050Janus 2020Janus psk for ada

Table of Contents