PT630 Programming Reference Guide
Page 47 of 59
------------------------------------------------------------------------------------------------------------------
1.5.34 Read Data from Scanner Port
Entry Parameter: AH = 50H
DS:DX
;
pointer
to
data
buffer
Return Value: 1) AX =0
; has data input
DS:DX
; pointer to input data string
BL
=
1 ;
Code
39
2 ;
Interleaved
2
of
5
3 ;
Codabar
5 ;
Code
128
6 ;
EAN
128
7 ;
Code
93
11H ; UPC-A
12H ; UPC-E
13H ; EAN-13
14H ; EAN-8
21H
;
User
Code
1
(TRIOPTIC)
22H
;
User
Code
2
(TOSHIBA)
CL = 0
; scan direction from left to right
1
; scan direction from right to left
2) AX = 1
; no data input
Example:
int TD_get_bar1(unsigned char *str,int wait,int *type,int *dir)
{
int i;
do
{
regs.h.ah=0x50;
segregs.ds = FP_SEG(str);
regs.x.dx = FP_OFF(str);
int86x(0x21,®s,®s,&segregs);
i = regs.x.ax;
*type = regs.h.bl;
*dir = regs.h.cl;
} while (wait && i);
return(i);
}
1.5.35 Set Scanner Port
Entry Parameter: AH = 51H
AL = 0
; disable scanner port
1
; enable scanner
Return
Value:
None
Example:
void TD_set_bar(int status)
{
regs.h.ah= 0x51;
regs.h.al= (unsigned char)status;
int86(0x21,®s,®s);
}