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 5 of 9

PT630 Portable Terminal Programming Reference Guide: BIOS and System Functions, pages 32 to 40

Pages 32 to 40 of 73, from PT630 Portable Terminal Programming Reference Guide

The original document is the PDF (2.0 MB). 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 Unitech PT630

Page 32

PT630 Programming Reference Guide Page 32 of 59 -----------------------------------------------------------------------------------------------------------------1.5.17 Barcode symbology setting function 1.5.17.1 Enable/Disable Decoding of a Barcode Symbology Entry Parameter: AH = 1FH BH = 1 AL = 1 ; Enable decoding of barcode symbology 0 ; Disable decoding of barcode symbology BL = 0 ; All supported bar code symbologies 1 ; Code 39 2 ; I 2 of 5 3 ; Codabar 4 ; EAN/UPC 5 ; Code 128 6 ; EAN 128 Return Value: None Example: void TD_set_decode_status(int type,int status) { regs.h.ah= 0x1F; regs.h.al= (unsigned char)status; regs.h.bh= 1; regs.h.bl= (unsigned char)type; int86(0x21,&regs,&regs); }

1.5.17.2 Get Decoding Status of a Barcode Symbology Entry parameter: AH = 1FH BH = 2 BL = 1 ; Code 39 2 ; I 2 of 5 3 ; Codabar 4 ; EAN/UPC 5 ; Code 128 6 ; EAN 128 Return Value: AL = 0/1 ; Disable/Enable Example: int TD_get_decode_bar(int type) { regs.h.ah = 0x1F; regs.h.bh = 2; regs.h.bl = (unsigned char)type; int86(0x21,&regs,&regs); return(regs.h.al); }

1.5.17.3

Code 39 Settings Entry parameter: AH = 1FH BH = 3

Page 33

PT630 Programming Reference Guide Page 33 of 59 -----------------------------------------------------------------------------------------------------------------BL = 1 AL bit 0= 0/1 ; disable/enable Code 39 decoding 1= 0/1 ; disable/enable Check Digit verification 2= 0/1 ; no-send/send Check Digit 3= 0/1 ; no-send/send Start/Stop characters 4= 0/1 ; Full ASCII OFF/ON Return Value: None Example: void TD_decoder_setting(int decoder_type,int setting) { regs.h.ah = 0x1F; regs.h.bh = 3; regs.h.bl = (unsigned char)decode_type; regs.h.al = (unsigned char)setting; int86(0x21,&regs,&regs); }

1.5.17.4

Interleaved 2 of 5 Settings Entry Parameter: AH = 1FH BH = 3 BL = 2 AL bit 0= 0/1 ; disable/enable Interleaved 2 of 5 decoding 1= 0/1 ; disable/enable Check Digit verification 2= 0/1 ; no-send/send Check Digit Return Value: None Example: Same with Code 39's example:

1.5.17.5

1.5.17.6

Codabar Settings Entry Parameter: AH = 1FH BH = 3 BL = 3 AL bit 0= 1= 2= 3= Return Value: None UPC/EAN Add-on Entry Parameter: AH = 1FH BH = 3 BL = 4 CL=0 1 2 Return Value: None

1.5.17.7 Code 128 Setting Entry Parameter: AH = 1FH BH = 3

0/1 0/1 0/1 0/1

; disable/enable Codebar decoding ; disable/enable Check Digit verification ; no-send/send Check Digit ; no-send/send Start/Stop characters

; Disable ; Optional ; Required

Page 34

PT630 Programming Reference Guide Page 34 of 59 -----------------------------------------------------------------------------------------------------------------BL = 5 AL bit 0= 0/1 : disable/enable Code 128 decoding Return Value: None 1.5.17.8

1.5.17.9

EAN 128 Setting Entry Parameter: AH = BH = BL = AL bit Return Value: None

1FH 3 6 0= 0/1

Code 93 Setting Entry Parameter: AH = 1FH BH = 3 BL = 7 AL bit 0= 0/1 Return Value: None

1.5.17.10 Code 32 Setting Entry Parameter: AH = 1FH BH = 3 BL = 8 AL bit 0= 0/1 AL bit 1= 0/1 AL bit 2= 0/1 Return Value: None 1.5.17.11 UPC-A Settings Entry Parameter: AH = 1FH BH = 3 BL = 11H AL bit 0= 0/1 2= 0/1 3= 0/1 Return Value: None 1.5.17.12 UPC-E Settings Entry parameter: AH = 1FH BH = 3 BL = 12H AL bit 0= 2= 3= 4= Return Value: None 1.5.17.13 EAN-13 Settings Entry Parameter: AH = 1FH BH = 3

0/1 0/1 0/1 0/1

; disable/enable EAN 128 decoding

; disable/enable Code 93 decoding

; disable/enable Code 32 decoding ; not send/send check digit ; not send/send leading character ‘A’

; disable/enable UPC-A decoding ; no-send/send Check Digit ; no-send/send Leading Digit

; disable/enable UPC-E decoding ; no-send/send Check Digit ; no-send/send Leading Digit ; disable/enable Zero Expansion

Page 35

PT630 Programming Reference Guide Page 35 of 59 -----------------------------------------------------------------------------------------------------------------BL = 13H AL bit 0= 0/1 ; disable/enable EAN-13 decoding 2= 0/1 ; no-send/send Check Digit 3= 0/1 ; no-send/send Leading Digit Return Value: None 1.5.17.14 EAN-8 Settings Entry Parameter: AH = 1FH BH = 3 BL = 14H AL bit 0= 0/1 2= 0/1 Return Value: None

; disable/enable UPC-E decoding ; no-send/send Check Digit

1.5.17.15 User Code 1 Setting (TRIOPTIC Code) Entry Parameter: AH = 1FH BH = 3 BL = 21H AL bit 0= 0/1 : disable/enable User Code 1 decoding Return Value: None 1.5.17.16 User Code 2 Setting (TOSHIBA code) Entry Parameter: AH = 1FH BH = 3 BL = 22H AL bit 0= 0/1 Return Value: None

: disable/enable User Code 2 decoding

Page 36

PT630 Programming Reference Guide Page 36 of 59 -----------------------------------------------------------------------------------------------------------------1.5.18 Set Interrupt Vector Entry Parameter: AH = 25H AL = interrupt number DS:BX = address of interrupt routine Return Value: None Example: void TS_set_interrupt_vector(int vect,unsigned int ds,unsigned int dx) { regs.h.ah= 0x25; regs.h.al= (unsigned char)vect; segregs.ds=ds; regs.x.dx=dx; int86x(0x21,&regs,&regs,&segregs); }

1.5.19 Get System Date Entry Parameter: AH = 2AH Return Value: CX = year (1980 - 2079) DH = month (1 - 12) DL = day (1 - 31) AL = weekday (0 - 6) Example: void TS_get_date(int *year,int *month,int *day,int *week) { TD_int_dos1(0x2a,0,0,0); *year = regs.x.cx; *month = regs.h.dh; *day = regs.h.dl; *week = regs.h.al; }

1.5.20 Set System Date Entry Parameter: AH = 2BH CX = year (1980 - 2079) DH = month (1 - 12) DL = day (1 - 31) Return Value: AL = 0/FFH Example:

; OK/Setting error int TS_set_date(int year,int month,int day) { regs.h.ah = 0x2b; regs.x.cx = year; regs.h.dh = month; regs.h.dl = day; int86(0x21,&regs,&regs); return((int)regs.h.al); }

Page 37

PT630 Programming Reference Guide Page 37 of 59 -----------------------------------------------------------------------------------------------------------------1.5.21 Get System Time Entry Parameter: AH = 2CH Return Value: CH = hour (0 - 23) CL = minute (0 - 59) DH = second (0 - 59) Example: void TS_get_time(int *hour,int *minute,int *second,int *mini_sec) { TD_int_dos1(0x2c,0,0,0); *hour = (int)regs.h.ch; *minute = (int)regs.h.cl; *second = (int)regs.h.dh; *mini_sec = (int)regs.h.dl; }

1.5.22 Set System Time Entry Parameter: AH = 2DH CH = hour (0 - 23) CL = minute (0 - 59) DH = second (0 - 59) Return Value: AL = 0/FFH

; OK/Setting error

Example: int TS_set_time(int hour,int minute,int second) { regs.h.ah = 0x2d; regs.h.ch = hour; regs.h.cl = minute; regs.h.dh = second; int86(0x21,&regs,&regs); return((int)regs.h.al); }

1.5.23 Set Alarm Date Entry Parameter: AH = 2EH AL = 0 ; disable alarm ; enable alarm everyday ; enable alarm by date If AL = 2: CX = year (1980 - 2079) DH = month (1 - 12) DL = day (1 - 31) Return Value: AL = 0/FFH ; OK/Setting error Example: int TS_alarm_date(int status,int year,int month,int day) { regs.h.ah = 0x2E; regs.h.al = (unsigned char)status; regs.x.cx = year; regs.h.dh = (unsigned char)month; regs.h.dl = (unsigned char)day; int86(0x21,&regs,&regs); return((int)regs.h.al); }

Page 38

PT630 Programming Reference Guide Page 38 of 59 -----------------------------------------------------------------------------------------------------------------1.5.24 Set Alarm Time Entry Parameter: AH = 2FH CH = hour (0 - 23) CL = minute (0 - 59) DH = second (0 - 59) Return Value: AL = 0/FFH

; OK/Setting error

Example: int TS_alarm_time(int hour,int minute,int second) { regs.h.ah = 0x2F; regs.h.ch = hour; regs.h.cl = minute; regs.h.dh = second; int86(0x21,&regs,&regs); return((int)regs.h.al); } 1.5.25 Get DOS and Firmware Version Number Entry Parameter: AH = 30H AL = 0/1 ; with/without OEM version code Return Value: if AL = 0 when call: AL= major DOS version number (=2) AH= minor DOS version number (=10) CL= major firmware version number CH= minor firmware version number BX= OEM firmware version code (=0 for standard version) if AL = 1 when call: AL= major DOS version number (=2) AH= minor DOS version number (=10) CL= major firmware version number CH= minor firmware version number BX= 810H Example: int TS_version1(int *ver,int *firm,int *oem) { regs.h.ah= 0x30; regs.h.al= 0; int86(0x21,&regs,&regs); *ver = regs.h.al * 100 + regs.h.ah; *firm= regs.h.cl * 100 + regs.h.ch; *oem = regs.x.bx; return(regs.h.al * 100 + regs.h.ah); }

Page 39

PT630 Programming Reference Guide Page 39 of 59 -----------------------------------------------------------------------------------------------------------------1.5.26 Get Interrupt Vector Entry Parameter: AH = 35H AL = interrupt number Return Value: DS:BX = address of interrupt routine Example: void TS_get_interrupt_vector(int vect,unsigned int *es,unsigned int *bx) { regs.h.ah= 0x35; regs.h.al= (unsigned char)vect; int86x(0x21,&regs,&regs,&segregs); *es = segregs.es; *bx = regs.x.bx; } 1.5.27 Get Free Disk Cluster Entry Parameter: AH = 36H Return Value: AX = 1 (number of sectors per cluster) BX = number of available clusters CX = 1024 (number of bytes per sector) DX = number of total clusters in RAM disk Example: long TS_free_disk(int drive) { regs.h.al = (unsigned char)drive; regs.h.ah = 0x36; int86(0x21,&regs,&regs); return((long)regs.x.bx*(long)regs.x.cx); } 1.5.28 File operation function 1.5.28.1 Create File with Handle Entry Parameter: AH = 3CH DS:DX ; pointer to file name buffer Return Value: if success, AX = Handle and CARRY flag is cleared if failed, AX = 3 and CARRY flag is set Note: If the file already exists, the function will truncate it to zero length. Example: int TS_create_file(char *fn) { regs.h.ah=0x3Ch; segregs.ds = FP_SEG(fn); regs.x.dx = FP_OFF(fn); int86x(0x21,&regs,&regs,&segregs); if ((regs.x.cflag & 0x01) == 1) return(-1); else return(regs.x.ax); }

Page 40

PT630 Programming Reference Guide Page 40 of 59 -----------------------------------------------------------------------------------------------------------------1.5.28.2

Open File with Handle Entry Parameter: AH = 3DH AL = 0 ; read only 1 ; write only 2 ; read and write DS:DX ; pointer to file name buffer Return Value: if success, AX = Handle and CARRY flag is cleared if failed , AX = 2 and CARRY flag is set Example: int TS_open_file(char *fn,int mode) { regs.h.ah=0x3Dh; regs.h.al=(unsigned char)mode; segregs.ds = FP_SEG(fn); regs.x.dx = FP_OFF(fn); int86x(0x21,&regs,&regs,&segregs); if ((regs.x.cflag & 0x01) == 1) return(-1); else return(regs.x.ax); }

1.5.28.3

Close File with Handle Entry Parameter: AH = 3EH BX = Handle of file Return Value: if success, CARRY flag is cleared if failed, CARRY flag is set Example: void TS_close_file(int hdl) { regs.h.ah= 0x3e; regs.x.bx= hdl; int86(0x21,&regs,&regs); if ((regs.x.cflag & 0x01) == 1) return(-1); else return(1); }