The text of a manual · part 3 of 9
PT630 Portable Terminal Programming Reference Guide: BIOS and System Functions, pages 14 to 22
Pages 14 to 22 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 14
PT630 Programming Reference Guide Page 14 of 59 -----------------------------------------------------------------------------------------------------------------1.4.11 Write Pixel to screen Entry Parameter: INT 0x10 AH= 0x41 AL= 0 ; No Pixel 1 ; With Pixel Return DH=row ; 0-63 DL=column ; 0-127 Example: void TL_set_pixel(int x,int y,int status) { regs.h.ah= 0x41; regs.h.al= (unsigned char)status; regs.h.dl= (unsigned char)x; regs.h.dh= (unsigned char)y; int86(0x10,®s,®s); }
Page 15
PT630 Programming Reference Guide Page 15 of 59 -----------------------------------------------------------------------------------------------------------------1.5 System Functions ( INT 21H ) 1.5.1 Terminate Program Entry Parameter: AH = 0 Return Value: None Example: void TS_exit_program() { regs.h.ah= 0; int86(0x21,®s,®s); } 1.5.2
Read Keypad (wait if no key) and Write to LCD Entry Parameter: AH = 1 Return Value: AL = 0 – 255 ; ASCII character Example: unsigned char TS_stdin() { regs.h.ah= 1; int86(0x21,®s,®s); return(regs.h.al); }
1.5.3
Write LCD Entry Parameter:
AH = 2 DL = 0 – 255 ; ASCII character Return Value: None Example: void TS_stdout(unsigned char ch) { regs.h.ah= 2; regs.h.dl= ch; int86(0x21,®s,®s); return; }
1.5.4
Read RS232 (wait if no character) Entry Parameter: AH = 3 Return Value: AL = 0 – 255 ; ASCII character Note: Only for NONE communication protocol Example: unsigned char TS_stdaux_in() { regs.h.ah= 3; int86(0x21,®s,®s); return(regs.h.al); }
Page 16
PT630 Programming Reference Guide Page 16 of 59 -----------------------------------------------------------------------------------------------------------------1.5.5
Write RS232 Entry Parameter:
AH = 4 DL = 0 – 255 ; ASCII character Return Value: None Note: Only for NONE communication protocol Example: void TS_stdaux_out(unsigned char ch) { regs.h.ah= 4; regs.h.dl= ch; int86(0x21,®s,®s); return; }
1.5.6
Direct Console I/O Entry Parameter: Return Value: 1) 2)
AH = DL =
6 0 – 254 ; write ASCII character in DL to LCD 255 ; read ASCII character from keypad When read (DL <> 255): Character in AL if ZERO flag is cleared No input if ZERO flag is set When write (DL= 255): None
Example: unsigned char TS_stdin_out(unsigned char ch) { regs.h.ah= 6; regs.h.dl= ch; int86(0x21,®s,®s); if (ch == 0xFF) { if ((regs.x.cflag & 0x40) == 0) return(regs.h.al); else return(0); } return(0); }
1.5.7
Read Keypad (wait if no key) Entry Parameter: AH = 7 Return Value: AL = 0 – 255 Example: unsigned char TS_stdin_noecho() { regs.h.ah= 7; int86(0x21,®s,®s); return(regs.h.al); }
; ASCII character
Page 17
PT630 Programming Reference Guide Page 17 of 59 -----------------------------------------------------------------------------------------------------------------1.5.8
1.5.9
Read Keypad (wait if no key) Entry Parameter: AH = 8 Return Value: AL = 0 – 255
; ASCII character
Write Character String to LCD Entry Parameter: AH = 9 DS:DX ; pointer to string buffer Return Value: None Example: void TS_stdout_string(unsigned char *str) { segregs.ds = FP_SEG(str); regs.x.dx = FP_OFF(str); regs.h.ah= 9; int86x(0x21,®s,®s,&segregs); return; }
1.5.10 Buffered Keypad Input Entry parameter: AH = 0AH DS:DX ; pointer to data buffer Return value: DS:DX ; pointer to data buffer Data format in buffer: n m Input buffer with CR at last number of characters actual input number of characters requested to be input
Example: void TS_stdin_string(unsigned char *str) { segregs.ds = FP_SEG(str); regs.x.dx = FP_OFF(str); regs.h.ah= 0x0a; int86x(0x21,®s,®s,&segregs); return; }
1.5.11 Check Keypad Status Entry Parameter: AH = 0BH Returned Value: AL = 0 0FFH Example: unsigned char TS_kbhit() { regs.h.ah= 0x0b; int86(0x21,®s,®s); return(regs.h.al); }
; no keys were pressed ; key was pressed and input character is Ready
Page 18
PT630 Programming Reference Guide Page 18 of 59 -----------------------------------------------------------------------------------------------------------------1.5.12 Device control function 1.5.12.1 LCD Backlight ON/OFF Control Entry Parameter: AH = 1AH BH = 0 AL = 0/1 ; set LCD backlight OFF/ON Return Value: None Example: void TL_backlight(int status) { regs.h.ah= 0x1A; regs.h.bh= 0; regs.h.al= (unsigned char)status; int86(0x21,®s,®s); } 1.5.12.2
Buzzer ON/OFF Control Entry Parameter: AH = 1AH BH = 1 AL = 0/1 ; set Buzzer OFF/ON Return Value: None Example: void TD_buzzer(int status) { regs.h.ah= 0x1A; regs.h.bh= 1; regs.h.al= (unsigned char)status; int86(0x21,®s,®s); }
1.5.12.3
Beeper Volume Entry parameter:
AH = 1AH BH = 3 AL = 0/1/2 Return Value: None
; set LOW/MEDIUM/HIGH beeper volume
Example: void TD_beeper_vol(int status) { regs.h.ah= 0x1A; regs.h.bh= 3; regs.h.al= (unsigned char)status; int86(0x21,®s,®s); }
Page 19
PT630 Programming Reference Guide Page 19 of 59 -----------------------------------------------------------------------------------------------------------------1.5.12.4
Enable/Disable RS232 Port Entry Parameter: AH = 1AH BH = 4 AL = 0/1 Return Value: None
; disable/enable
Example: void TD_serial(int status) { regs.h.ah= 0x1A; regs.h.bh= 4; regs.h.al= (unsigned char)status; int86(0x21,®s,®s); } 1.5.12.5
Enable/Disable Key or Key Function Entry Parameter: AH = 1AH BH = 5 AL = 0 ; All keys 1 ; Supervisor mode 2 ; Cold start 3 ; Warm start 4 ; User mode (press [CMD] for 2 seconds) 5 ; ALPHA key BL = 0 ; Disable key or key function 1 ; Enable key or key function Return Value: None Example: void TD_keylock(int type,int status) { regs.h.ah= 0x1A; regs.h.bh= 5; regs.h.al= (unsigned char)type; regs.h.bl= (unsigned char)status; int86(0x21,®s,®s); }
Page 20
PT630 Programming Reference Guide Page 20 of 59 -----------------------------------------------------------------------------------------------------------------1.5.12.6
Set Keypad Language Entry Parameter: AH = BH = AL =
1AH 7 0 1 2 3 4 5 6
; English ; Sweden / Finland ; Danish ; Spanish ; French ; German ; Italian
Return Value: None Note: The functions defines input characters in ALPHA mode for key [0]: Language 0.English
1.Sweden/Finland
2.Danish
3.Spanish
4.French
5.German
6.Italian
Mode ALPHA-1 ALPHA-2 ALPHA-3 ALPHA-1 ALPHA-2 ALPHA-3 ALPHA-1 ALPHA-2 ALPHA-3 ALPHA-1 ALPHA-2 ALPHA-3 ALPHA-1 ALPHA-2 ALPHA-3 ALPHA-1 ALPHA-2 ALPHA-3 ALPHA-1 ALPHA-2 ALPHA-3
Hex Code 5B 5C 5D 8F 8E 99 92 9D 8F AD A5 A8 F8 87 26 8E 99 9A F9 5C 82
Display @ ? & Å Ä Ö Æ Ø Å ¡ Ñ ¿ º Ç & Ä Ö Ü • \ É
‘¥’ (9DH) in ASCII is replaced with ‘Ø’ when Danish is selected. Example: void TD_key_language(int status) { regs.h.ah= 0x1A; regs.h.bh= 7; regs.h.al= (unsigned char)status; int86(0x21,®s,®s); }
Page 21
PT630 Programming Reference Guide Page 21 of 59 -----------------------------------------------------------------------------------------------------------------1.5.12.7
Check Main Battery Status Entry Parameter: AH = 1AH BH = 8 Return Value: AL = 0/1 ; Normal / Battery low Example: int TS_battery() { regs.h.ah= 0x1A; regs.h.bh= 8; int86(0x21,®s,®s); return(regs.h.al); }
1.5.12.8
Check Backup Battery Status Entry Parameter: AH = 1AH BH = 9 Return Value: AL = 0/1 ; Normal / Battery Low Example: int TS_lithium_battery() { regs.h.ah= 0x1A; regs.h.bh= 9; int86(0x21,®s,®s); return(regs.h.al); }
1.5.12.9
Set Good-read LED Entry Parameter: AH = 1AH BH = 0AH AL = 0 ; Set the Good-read LED (green light) OFF 1 ; Set the Good-read LED (green light) ON 2 ; Set the Good-read LED controlled by system Return Value: None Note: If the function is called by AL=0 or AL=1, the system will not control Good-read LED ON/OFF when a bar code label is decoded successfully. Example: void TS_bar_good_read(int status) { regs.h.ah= 0x1A; regs.h.bh= 0x0A; regs.h.al= (unsigned char)status; int86(0x21,®s,®s); }
Page 22
PT630 Programming Reference Guide Page 22 of 59 -----------------------------------------------------------------------------------------------------------------1.5.12.10 Set Laser Scanner Trigger Mode Entry Parameter: AH = 1AH BH = 0BH AL = 0/1 ; Normal / Flash mode Return Value: None Example: void TD_flash_trigger(int status) { regs.h.ah= 0x1A; regs.h.bh= 0x0B; regs.h.al= (unsigned char)status; int86(0x21,®s,®s); }
1.5.12.11 Enable/Disable Double Verification When Read Bar Code Label Entry Parameter: AH = 1AH BH = 0CH AL = 0/1 ; Disable/Enable double verification Return Value: None Example: void TD_double_verify_bar(int type) { regs.h.ah = 0x1A; regs.h.bh = 0x0C; regs.h.al = (unsigned char)type; int86(0x21,®s,®s); }
1.5.12.12 Check Laser Scanner Entry Parameter: AH = 1AH BH = 0DH Return Value: AL = 0 1
; Has no built-in or clip on laser scanner ; Has built-in or clip on laser scanner
Example: int TD_check_scanner() { regs.h.ah = 0x1A; regs.h.bh = 0x0D; int86(0x21,®s,®s); return(regs.h.al); }
1.5.12.13 Set Aim mode for Long Range engine Entry Parameter: AH = 1AH BH = 0FH Return Value: AL = 0 ; Disable 1 ; Enable