Intermec Janus 2010 Reference Manual page 175

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

Advertisement

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;
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);
-- Good return
3
im_transmit_byte
3-135

Advertisement

Table of Contents
loading

This manual is also suitable for:

Janus 2050Janus 2020Janus psk for ada

Table of Contents