Unitech PT630 Programming Reference Manual

Unitech PT630 Programming Reference Manual

Portable terminal
Hide thumbs Also See for PT630:
Table of Contents

Advertisement

PT630 Programming Reference Guide
Page 1 of 59
------------------------------------------------------------------------------------------------------------------
PT630 Portable Terminal
Programming Reference Guide
V1.1

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the PT630 and is the answer not in the manual?

Questions and answers

Summary of Contents for Unitech PT630

  • Page 1 PT630 Programming Reference Guide Page 1 of 59 ------------------------------------------------------------------------------------------------------------------ PT630 Portable Terminal Programming Reference Guide V1.1...
  • Page 2: Table Of Contents

    ------------------------------------------------------------------------------------------------------------------ CHAPTER 1. BIOS AND SYSTEM FUNCTIONS ...5 NTERRUPT ECTOR ISPLAY UNCTIONS 2.4.1 Select Large Font ...5 2.4.2 Select Small Font ...5 2.4.3 Set Font Type...6 2.4.4 Get Font Type ...6 2.4.5 Set User-Defined Font for All Characters...6 2.4.6 Get Font Data for All Characters ...7 2.4.7 Set User-Defined Font for One Character ...7 2.4.8...
  • Page 3 ------------------------------------------------------------------------------------------------------------------ 2.4.31 Set MULTIPOINT Address ...27 2.4.32 Set File-Uploading Message ON/OFF ...27 2.4.33 Set Terminal ID...28 2.4.34 Set ONLINE/LOCAL in Terminal Mode ...28 2.4.35 Set ECHO ON/OFF in Terminal Mode...28 2.4.36 Set AUTOLF ON/OFF in Terminal Mode...29 2.4.37 Set CHARACTER/BLOCK in Terminal Mode ...29 2.4.38 Define LINE Character in Terminal Mode ...29 2.4.39...
  • Page 4 2.4.4 Data Conversion Rules in Packet...60 2.4.5 Data Checksum Calculation in Packet...60 2.4.6 Example packet of command to send the file named A.EXE to PT630 with address ‘A’...60 OMMUNICATION IN 2.2.1 Host Send Data to PT630 (ESC 0)...62 2.2.2 Host Requests Data from the PT630 ( Polling ) ...62 OMMUNICATION IN 2.3.1...
  • Page 5: Chapter 1. Bios And System Functions

    ------------------------------------------------------------------------------------------------------------------ Chapter 1. BIOS and System Functions The PT630 operating system supports DOS/BIOS function calls that a programmer can access when developing an application for the portable. Interrupt Vector Assignment for I/Os Vector BIOS Function 09 H Display Font 0F H...
  • Page 6: Set Font Type

    ------------------------------------------------------------------------------------------------------------------ 1.2.3 Set Font Type Entry Parameter: AH= 2 AL= 0/1 ; set to large/small font Return Value: None void TL_font(int status) regs.h.ah = (unsigned char)status; regs.h.al = 2; int86(0x09,&regs,&regs); 1.2.4 Get Font Type Entry Parameter: AH= 3 Return Value: AL= 0/1 ;...
  • Page 7: Get Font Data For All Characters

    ------------------------------------------------------------------------------------------------------------------ 1.2.6 Get Font Data for All Characters Entry Parameter: Return Value: Font data in the buffer Example: void TL_get_all_ASCII_font(int type,unsigned char *str) regs.h.ah=5; regs.h.al=(unsigned char)type; segregs.ds = FP_SEG(str); regs.x.dx = FP_OFF(str); int86x(0x9,&regs,&regs,&segregs); 1.2.7 Set User-Defined Font for One Character Entry Parameter: Return Value: None Example:...
  • Page 8: Get Font Data For One Characters

    Kermit Server Function ( INT 0FH ) Entry Parameter: None Return Value: When INT 0FH is called in user application, PT630 will enter Kermit server. Pressing [CMD] key then [Exit] key to leave it and return to user application. Example : void TC_kermit_mode() int86(0x0F,&regs,&regs);...
  • Page 9: Lcd Control Functions ( Int 10H )

    DL = Column Return Value: None Example : void TL_gotoxy(int x,int y) regs.h.ah = 2; regs.h.dh = (unsigned char)y; regs.h.dl = (unsigned char)x; int86(0x10,&regs,&regs); AH = 1 AL = 0/1 ; disable/enable screen scroll AH = 2 PT630 8x16 Column 0~19 0~15...
  • Page 10: Get Cursor Position

    ------------------------------------------------------------------------------------------------------------------ 1.4.4 Get Cursor Position Entry Parameter: AH = Return Value: DH = DL = Example : void TL_getxy(int *x,int *y) regs.h.ah = 3; int86(0x10,&regs,&regs); *y = regs.h.dh; *x = regs.h.dl; 1.4.5 Display 16x16 Bitmap Entry Parameter: AH = DH = DL = DS:BX Return Value:...
  • Page 11 ------------------------------------------------------------------------------------------------------------------ Sample C program to display 16x16 graphic pattern. content FF FF 3E 1C C9 E3 F7 FF FF FF FF FF FF FF FF FF █ █ █ █ █ █ Count █ █ █ █ █ █ █ █...
  • Page 12: Set Cursor On/Off

    ------------------------------------------------------------------------------------------------------------------ regs.h.ah=5; regs.h.al=0; int86(0x10, &regs, &regs); buff=logo; regs.h.ah=4; regs.h.dh=1; regs.h.dl=2; regs.x.bx=FP_OFF(buff); sregs.ds=FP_SEG(buff); int86x(0x10, &regs, &regs, &sregs); getch(); 1.4.6 Set Cursor On/Off Entry Parameter: Return Value: None Example : void TL_cursor_type(int status) regs.h.ah = 5; regs.h.al = (unsigned char)status; int86(0x10,&regs,&regs); 1.4.7 Enable/Disable Power-on Logo Display Entry Parameter: Return Value: None Example...
  • Page 13: Display Character

    ------------------------------------------------------------------------------------------------------------------ 1.4.8 Display Character Entry Parameter: Return Value: None Example regs.h.ah = 0x0A; regs.h.al = cc; int86(0x10,&regs,&regs); 1.4.9 Display 16*16 Bitmap at Current Cursor Position Entry Parameter: Return Value: None Note: This function is available only in large font. Example : void TL_display_16x16(unsigned char *str) regs.h.ah=0x4F;...
  • Page 14: Write Pixel To Screen

    ------------------------------------------------------------------------------------------------------------------ 1.4.11 Write Pixel to screen Entry Parameter: Return 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,&regs,&regs); INT 0x10 AH= 0x41 AL= 0 ; No Pixel ; With Pixel DH=row ;...
  • Page 15: System Functions ( Int 21H )

    ------------------------------------------------------------------------------------------------------------------ System Functions ( INT 21H ) 1.5.1 Terminate Program Entry Parameter: Return Value: None Example: void TS_exit_program() regs.h.ah= 0; int86(0x21,&regs,&regs); 1.5.2 Read Keypad (wait if no key) and Write to LCD Entry Parameter: Return Value: AL = 0 – 255 Example: unsigned char TS_stdin() regs.h.ah= 1;...
  • Page 16: Write Rs232

    ------------------------------------------------------------------------------------------------------------------ 1.5.5 Write RS232 Entry Parameter: 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,&regs,&regs); return; 1.5.6 Direct Console I/O Entry Parameter: Return Value: 1) 2) When write (DL= 255): Example: unsigned char TS_stdin_out(unsigned char ch) regs.h.ah= 6;...
  • Page 17: Read Keypad (Wait If No Key)

    ------------------------------------------------------------------------------------------------------------------ 1.5.8 Read Keypad (wait if no key) Entry Parameter: Return Value: AL = 0 – 255 1.5.9 Write Character String to LCD Entry Parameter: 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,&regs,&regs,&segregs);...
  • Page 18: Lcd Backlight On/Off Control

    ------------------------------------------------------------------------------------------------------------------ 1.5.12 Device control function 1.5.12.1 LCD Backlight ON/OFF Control Entry Parameter: 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,&regs,&regs); 1.5.12.2 Buzzer ON/OFF Control Entry Parameter: Return Value: None Example: void TD_buzzer(int status) regs.h.ah= 0x1A;...
  • Page 19: Enable/Disable Rs232 Port

    ------------------------------------------------------------------------------------------------------------------ 1.5.12.4 Enable/Disable RS232 Port Entry Parameter: Return Value: None Example: void TD_serial(int status) regs.h.ah= 0x1A; regs.h.bh= 4; regs.h.al= (unsigned char)status; int86(0x21,&regs,&regs); 1.5.12.5 Enable/Disable Key or Key Function Entry Parameter: Return Value: None Example: void TD_keylock(int type,int status) regs.h.ah= 0x1A; regs.h.bh= 5;...
  • Page 20: Set Keypad Language

    ------------------------------------------------------------------------------------------------------------------ 1.5.12.6 Set Keypad Language Entry Parameter: Return Value: None Note: The functions defines input characters in ALPHA mode for key [0]: Language 0.English 1.Sweden/Finland ALPHA-2 2.Danish 3.Spanish 4.French 5.German 6.Italian ‘¥’ (9DH) in ASCII is replaced with ‘Ø’ when Danish is selected. Example: void TD_key_language(int status) regs.h.ah= 0x1A;...
  • Page 21: Check Main Battery Status

    ------------------------------------------------------------------------------------------------------------------ 1.5.12.7 Check Main Battery Status Entry Parameter: Return Value: Example: int TS_battery() regs.h.ah= 0x1A; regs.h.bh= 8; int86(0x21,&regs,&regs); return(regs.h.al); 1.5.12.8 Check Backup Battery Status Entry Parameter: Return Value: Example: int TS_lithium_battery() regs.h.ah= 0x1A; regs.h.bh= 9; int86(0x21,&regs,&regs); return(regs.h.al); 1.5.12.9 Set Good-read LED Entry Parameter: Return Value: None Note:...
  • Page 22: Set Laser Scanner Trigger Mode

    ------------------------------------------------------------------------------------------------------------------ 1.5.12.10 Set Laser Scanner Trigger Mode Entry Parameter: 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,&regs,&regs); 1.5.12.11 Enable/Disable Double Verification When Read Bar Code Label Entry Parameter: Return Value: None Example: void TD_double_verify_bar(int type) regs.h.ah = 0x1A;...
  • Page 23: Get Scanner Port Status

    ------------------------------------------------------------------------------------------------------------------ 1.5.12.14 Set Alpha input mode Entry Parameter: 1.5.12.15 Set keypad input statusr Entry Parameter: 1.5.12.16 Get Scanner Port Status Entry Parameter: Return values: Example: int TD_get_bar_type() regs.h.ah = 0x1B; regs.h.bh = 5; int86(0x21,&regs,&regs); return(regs.h.al); 1.5.13 General Communication Setting 1.5.13.1 Get MULTIPOINT Address Entry Parameter: BH = 6...
  • Page 24: Set Communication Parameters

    ------------------------------------------------------------------------------------------------------------------ 1.5.13.2 Set Communication Parameters Entry Parameter: AH = 1CH Return Value: None Example: int TC_232_parameter(long baud,int parity,int stop,int data) unsigned char cc=0; unsigned int i_baud; i_baud = (int)(baud / 10L); switch (i_baud) case 11 : cc=0x00; break; case 15 : cc=0x10; break; case 30 : cc=0x20;...
  • Page 25: Software Control Flow

    ------------------------------------------------------------------------------------------------------------------ 1.5.13.3 Software Control Flow Entry Parameter: BH = 2 AL = 0 Return Value: None Note: Only for NONE communication protocol Example: void TC_flow_ctrl(int status) if (status == 0) regs.h.ah = 0x1C; regs.h.bh = 2; regs.h.al = 1; int86(0x21,&regs,&regs); regs.h.ah = 0x1C;...
  • Page 26: Hardware Control Flow

    ------------------------------------------------------------------------------------------------------------------ 1.5.13.4 Hardware Control Flow Entry parameters: AH = 1CH BH = 3 AL = 0 Return Value: None Note: Only for NONE communication protocol 1.5.13.5 Set Communication Protocol Entry Parameter: BH = 4 AL = 2 Return Value: None Example: void TC_protocol(int status) regs.h.ah = 0x1C;...
  • Page 27: Set Multipoint Address

    ------------------------------------------------------------------------------------------------------------------ 1.5.13.7 Set MULTIPOINT Address Entry Parameter: BH = 6 AL = Address ; ASCII character ‘A’ - ’Y’ or ’0’ - ’6’ Return Value: AL = 0 Example: int TC_set_address(char status) regs.h.ah = 0x1C; regs.h.bh = 6; regs.h.al = status; int86(0x21,&regs,&regs);...
  • Page 28: Set Terminal Id

    ------------------------------------------------------------------------------------------------------------------ 1.5.14 Terminal mode setting function 1.5.14.1 Set Terminal ID Entry Parameter: BH = 0 DS:DX Return Value: None Example: void TT_id(unsigned char *str) segregs.ds = FP_SEG(str); regs.x.dx = FP_OFF(str); regs.h.ah=0x1D; regs.h.bh=0; int86x(0x21,&regs,&regs,&segregs); return(regs.h.al); 1.5.14.2 Set ONLINE/LOCAL in Terminal Mode Entry Parameter: BH = 1 AL = 0/1...
  • Page 29: Set Autolf On/Off In Terminal Mode

    ------------------------------------------------------------------------------------------------------------------ 1.5.14.4 Set AUTOLF ON/OFF in Terminal Mode Entry Parameter: BH = 3 AL = 0/1 Return Value: None Example: void TT_auto_LF(int status) regs.h.ah= 0x1D; regs.h.al= (unsigned char)status; regs.h.bh= 3; int86(0x21,&regs,&regs); 1.5.14.5 Set CHARACTER/BLOCK in Terminal Mode Entry Parameter: BH = 4 AL = 0 ;...
  • Page 30: Define Page Character In Terminal Mode

    ------------------------------------------------------------------------------------------------------------------ 1.5.14.7 Define Page Character in Terminal Mode Entry Parameter: BH = 6 AL = 0 – 255 Return Value: None Example: void TT_page_terminal(unsigned char status) regs.h.ah= 0x1D; regs.h.bh= 6; regs.h.al= status; int86(0x21,&regs,&regs); 1.5.14.8 Get Terminal ID Entry Parameter: Returned Value: 1.5.15 Set User-defined Key-map Entry Parameter: Return Value: None...
  • Page 31: Get System Key-Map

    ------------------------------------------------------------------------------------------------------------------ Non-ALPHA Mode ALPHA-1 Mode byte byte name code Seq. name ENTER ENTER LCD Backlight LCD Contrast Beeper Volume Keyname and Hexcode with ... means DON’T CARE. 1.5.16 Get System Key-map Entry Parameter: Return Value: Key-map in buffer Example: void TD_get_key_map(unsigned char *str) segregs.ds = FP_SEG(str);...
  • Page 32: Enable/Disable Decoding Of A Barcode Symbology

    ------------------------------------------------------------------------------------------------------------------ 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 BL = 0 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;...
  • Page 33: Interleaved 2 Of 5 Settings

    ------------------------------------------------------------------------------------------------------------------ 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: Return Value: None Example: Same with Code 39's example: 1.5.17.5 Codabar Settings Entry Parameter:...
  • Page 34: Ean 128 Setting

    ------------------------------------------------------------------------------------------------------------------ BL = 5 AL bit 0= 0/1 Return Value: None 1.5.17.8 EAN 128 Setting Entry Parameter: Return Value: None 1.5.17.9 Code 93 Setting Entry Parameter: Return Value: None 1.5.17.10 Code 32 Setting Entry Parameter: Return Value: None 1.5.17.11 UPC-A Settings Entry Parameter: Return Value: None 1.5.17.12 UPC-E Settings...
  • Page 35: Ean-8 Settings

    ------------------------------------------------------------------------------------------------------------------ Return Value: None 1.5.17.14 EAN-8 Settings Entry Parameter: Return Value: None 1.5.17.15 User Code 1 Setting (TRIOPTIC Code) Entry Parameter: Return Value: None 1.5.17.16 User Code 2 Setting (TOSHIBA code) Entry Parameter: Return Value: None BL = 13H AL bit 0= 0/1 ;...
  • Page 36: Set Interrupt Vector

    ------------------------------------------------------------------------------------------------------------------ 1.5.18 Set Interrupt Vector Entry Parameter: 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: Return Value: CX = year (1980 - 2079) DH = month (1 - 12) DL = day (1 - 31) AL = weekday (0 - 6)
  • Page 37: Get System Time

    ------------------------------------------------------------------------------------------------------------------ 1.5.21 Get System Time Entry Parameter: 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;...
  • Page 38: Set Alarm Time

    ------------------------------------------------------------------------------------------------------------------ 1.5.24 Set Alarm Time Entry Parameter: CH = hour (0 - 23) CL = minute (0 - 59) DH = second (0 - 59) Return Value: AL = 0/FFH Example: int TS_alarm_time(int hour,int minute,int second) regs.h.ah = 0x2F; regs.h.ch = hour; regs.h.cl = minute;...
  • Page 39: Get Interrupt Vector

    ------------------------------------------------------------------------------------------------------------------ 1.5.26 Get Interrupt Vector Entry Parameter: 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: Return Value: AX = 1 (number of sectors per cluster) BX = number of available clusters...
  • Page 40: Open File With Handle

    ------------------------------------------------------------------------------------------------------------------ 1.5.28.2 Open File with Handle Entry Parameter: AL = 0 DS:DX 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;...
  • Page 41: Read File With Handle

    ------------------------------------------------------------------------------------------------------------------ 1.5.28.4 Read File with Handle Entry Parameter: AH = 3FH BX = Handle of file CX = number of bytes to read DS:DX Return Value: if success, AX = if failed, Example: int TS_read_file(int hdl,int cnt,char *str) segregs.ds = FP_SEG(str); regs.x.dx = FP_OFF(str);...
  • Page 42: Delete File

    ------------------------------------------------------------------------------------------------------------------ 1.5.28.6 Delete File Entry Parameter: DS:DX Return Value: if success, CARRY flag is cleared if failed, AX = 2 and CARRY flag is set Example: int TS_delete_file(char *fn) TD_intdos_O(0x41,0,fn); if ((regs.x.cflag & 0x01) == 0) return(1); else return(-1); 1.5.28.7 Move File Pointer Entry Parameter: AL = 0...
  • Page 43: Search Character Beginning At The Current File Position

    ------------------------------------------------------------------------------------------------------------------ 1.5.28.8 Search Character Beginning at the Current File Position Entry Parameter: AL = 3 BX = file handle CX = n DL = character Return Value: 1) If character is found: Carry flag = clear DX:AX = pointer to current file position (at the position of If character is not found: Carry flag = set CX = total matched times...
  • Page 44: Insert / Delete Data Block To / From File At The Current Position

    ------------------------------------------------------------------------------------------------------------------ 1.5.28.10 Insert / Delete Data Block to / from File at the Current Position Entry Parameter: Return Value: 1) If the function is successful: 2) If the function fails: Carry flag = set DX:AX = pointer to current file position (not changed) Note: For insertion, the content of the inserted data block is undefined.
  • Page 45: Allocate Memory

    ------------------------------------------------------------------------------------------------------------------ 1.5.29 Allocate Memory Entry Parameter: Return Value: if success, if failed , Example: int TS_alloc_mem(unsigned int size,unsigned char far *str,int *free) unsigned long aa; regs.h.ah=0x48; regs.x.bx=size; int86(0x21,&regs,&regs); *free = regs.x.bx; aa = (unsigned long)regs.x.ax * 10000L; str = (unsigned char far *)aa; if ((regs.x.cflag &...
  • Page 46: Modify Allocated Memory Block

    ------------------------------------------------------------------------------------------------------------------ 1.5.31 Modify Allocated Memory Block Entry Parameter: Returned Value: Example: int TS_modify_alloc_mem(unsigned int size,unsigned char far *str,int *free) unsigned long aa; regs.h.ah=0x4a; regs.x.bx=size; segregs.ds = FP_SEG(str); int86(0x21,&regs,&regs); *free = regs.x.bx; if ((regs.x.cflag & 0x01) == 0) return(1); else return(-1); 1.5.32 Run specified program Entry Parameter: Return Value: if success, AX = Handle and CARRY flag is cleared...
  • Page 47: Read Data From Scanner Port

    ------------------------------------------------------------------------------------------------------------------ 1.5.34 Read Data from Scanner Port Entry Parameter: Return Value: 1) AX =0 2) AX = 1 Example: int TD_get_bar1(unsigned char *str,int wait,int *type,int *dir) int i; regs.h.ah=0x50; segregs.ds = FP_SEG(str); regs.x.dx = FP_OFF(str); int86x(0x21,&regs,&regs,&segregs); i = regs.x.ax; *type = regs.h.bl; *dir = regs.h.cl;...
  • Page 48: Receive Data From Rs232 Port In Multipoint Protocol

    1.5.37 Send Data to RS232 Port in MULTIPOINT Protocol (Buffered Output) Entry Parameter: Return Value: Note: 1) Only for MULTIPOINT communication protocol 2) PT630 will send data out when polled by Host computer Example: int TC_str_O(unsigned char *str,int wait) do { segregs.ds = FP_SEG(str);...
  • Page 49: Check Rs232 Output Buffer Status In Multipoint Protocol

    ------------------------------------------------------------------------------------------------------------------ 1.5.38 Check RS232 Output Buffer Status in MULTIPOINT Protocol Entry Parameter: Returned Value: Note: 1) Only for MULTIPOINT communication protocol 2) The function can be used to check if data has been sent to Host computer. Example: int TC_ready(int wait) do { regs.h.ah= 0x5E;...
  • Page 50: Power Management Function ( Int 22H )

    ------------------------------------------------------------------------------------------------------------------ Power Management Function ( INT 22H ) Entry Parameter: Return Value: AX = The system will enter HALT power saving mode from this BIOS call, on return the value in AX register will define the type of device that awakes the system back to ACTIVE mode. Sample C program with INT22 int get_barcode(char * str_bar) union REGS regs;...
  • Page 51: Beeper Control Function ( Int 31H )

    ------------------------------------------------------------------------------------------------------------------ Beeper Control Function ( INT 31H ) Entry Parameter: Return Value: Example: void TD_beep_new(int fz,int tm) regs.x.ax = fz; regs.x.bx = tm; int86(0x31,&regs,&regs); AX= frequency BX=time duration Frequency(Hz) BX Time Duration(ms) 2.5K None 1.5K...
  • Page 52: Rs232 Control Functions ( Int 33H )

    ------------------------------------------------------------------------------------------------------------------ COM1 RS232 Control Functions ( INT 33H ) 1.8.1 Set Communication Parameters Entry Parameter: AH = 0 Return Value: None Example: int TC_232_parameter(long baud,int parity,int stop,int data) unsigned char cc=0; unsigned int i_baud; i_baud = (int)(baud / 10L); switch (i_baud) case 11 : cc=0x00;...
  • Page 53: Get Character From Rs232 Port

    ------------------------------------------------------------------------------------------------------------------ case 2 : cc=cc|0x0c; break; switch (stop) case 1 : break; case 2 : cc=cc|0x02; break; switch (data) case 7 : break; case 8 : cc=cc|0x01; break; regs.h.ah = 0; regs.h.al = cc; int86(0x33,&regs,&regs); 1.8.2 Get Character from RS232 Port Entry Parameter: Return Value: 1) AL = character...
  • Page 54: Send Character To Rs232 Port

    ------------------------------------------------------------------------------------------------------------------ 1.8.3 Send Character to RS232 Port Entry Parameter: Return Value: None Note: Only for NONE communication protocol Example: void TC_232_char_O(unsigned char ch) regs.h.ah = 2; regs.h.al = ch; int86(0X33&regs,&regs); 1.8.4 Enable RS-232 Port Entry Parameter: Return Value: None Example: void TC_232_enable() regs.h.ah = 3;...
  • Page 55: Set Rts/Dtr Signal Of Rs232 Port

    ------------------------------------------------------------------------------------------------------------------ 1.8.6 Set RTS/DTR Signal of RS232 Port Entry parameter: AL = DH = Return Value: None Note: Only for NONE communication protocol Example: void TC_232_RTS(int rts) regs.h.ah = 5; regs.h.al = 2; regs.h.dh = (unsigned char)rts; int86(0X33&regs,&regs); void TC_232_DTR(int dtr) regs.h.ah = 5;...
  • Page 56 ------------------------------------------------------------------------------------------------------------------ COM2 (internal COM port) RS232 Control Functions ( INT 14H ) 1.9.1 Set Communication Parameters Entry Parameter: AH = 0 Return Value: None Example: int TC_232_parameter(long baud,int parity,int stop,int data) unsigned char cc=0; unsigned int i_baud; i_baud = (int)(baud / 10L); switch (i_baud) case 11 : cc=0x00;...
  • Page 57 ------------------------------------------------------------------------------------------------------------------ 1.9.2 Get Character from COM 2 RS232 Port Entry Parameter: Return Value: 1) 2) AH = 1 Note: Only for NONE communication protocol Example: unsigned char TC_232_char_I() regs.h.ah = 1; int86(0x14,&regs,&regs); if (regs.h.ah == 0) return(regs.h.al); return(255); 1.9.3 Send Character to COM2 RS232 Port Entry Parameter: Return Value: None Note:...
  • Page 58 ------------------------------------------------------------------------------------------------------------------ 1.9.6 Set RTS/DTR Signal of RS232 Port Entry parameter: AL = DH = Return Value: None Note: Only for NONE communication protocol Example: void TC_232_RTS(int rts) regs.h.ah = 5; regs.h.al = 2; regs.h.dh = (unsigned char)rts; int86(0X14,&regs,&regs); void TC_232_DTR(int dtr) regs.h.ah = 5;...
  • Page 59: Chapter 2. Multipoint Communication

    MULTIPOINT protocol is an asynchronous serial multi-drop protocol for communication with the host computer. One host computer can be connected up to 32 PT630 terminals, while each PT630 has a unique address. The address is an ASCII character ( ‘A’ – ‘Y’ or ‘0’ – ‘6’) plus 80H.
  • Page 60: Pt630 Transmissions Packet

    2) CS1 = high nibble of CS + 40H 3) CS2 = low nibble of CS + 40H 2.1.7 Example packet of command to send the file named A.EXE to PT630 with address ‘A’ Packet: STX ESC CMD <parameters> CS1 CS2 ADDR = ‘L’...
  • Page 61 PT630 Programming Reference Guide Page 61 of 59 ------------------------------------------------------------------------------------------------------------------ Example Packet in Hex Format: STX ESC CMD <parameters> CS1 CS2 ADDR 02H 1BH 4CH 41H 2EH 45H 58H 45H 48H 40H C1H...
  • Page 62: Data Communication In Multipoint Protocol

    STX ESC ‘0’ <data> CS1 CS2 ADDR ACK or NAK Description: PT630 will put the received data in the buffer. The application on PT630 can: Use system call INT 21H/AH=5CH to get data. Use system call INT 21H/AH=5EH to check the buffer status.
  • Page 63: Cancel Current Downloading File Command (Esc Z)

    Description: For uploading, the host must know the filename on PT630. Get Directory Command (ESC ‘D’) can be used to view all filenames on PT630 (see 4.4 Host Commands). 2.3.5 Host Requests File from the PT630 ( Upload ) from specified file positon ⇒...
  • Page 64: Host Commands

    Format: ⇐ ACK or NAK Description: The command causes PT630 stop program execution and return to Ready Mode. Programs and data that have been stored in the PT630 RAM space are preserved. The system parameters remain unchanged. The equivalent keypad invoking sequence is pressing CMD and then the ALPHA key.
  • Page 65: Communication Configuration ( Esc C )

    For Example, if the command instructs the RS-232 port to change the baud rate from 9600 to 1200 the PT630 will switch to 1200 right after the command has been received. The next host communication will use 1200 baud rate.
  • Page 66: Get Program Name In Flash Memory (Esc D/Rom)

    Format: ⇐ STX ESC ‘F’ <retcode> CS1 CS2 ETX ⇒ ACK or NAK Description: If PT630 RAM disk has files, its size can’t be changed (<retcode>=01H). 2.4.9 Get RAM Memory Configuration (ESC G) ⇒ STX ESC ‘G’ CS1 CS2 ADDR Format: ⇐...
  • Page 67: Get The Name Of Current Running Program (Esc I)

    Format: ⇐ ACK or NAK Description: The command clears all PT630 RAM memory content. It performs tests on all major hardware devices. Programs or data that have previously accumulated in the PT630 or previously been downloaded by the host will be purged from the memory.
  • Page 68: Set Date/Time ( Esc M )

    ⇐ STX ESC’ M’ <retcode> CS1 CS2 ETX ;<retcode>= 00H success ⇒ ACK or NAK Description: This command allows the host system to set PT630 real time clock. The parameter <datetime> is an ASCII character string. The first four characters represent the year.
  • Page 69: Terminal Mode Configuration ( Esc T )

    ⇒ STX ESC ‘T’ <termtable> CS1 CS2 ADDR Format: ⇐ STX ESC ‘T’ <retcode> CS1 CS2 ETX ;<retcode>=00H success ⇒ ACK or NAK Description: The command set the configuration for PT630 Terminal Mode. <termtable> is defined as: typedef struct { char id[8];...
  • Page 70: Get Portable Model Number And Bios Version Number (Esc V)

    Get Portable Model Number and BIOS Version Number (ESC v) ⇒ STX ESC ‘v’ CS1 CS2 ADDR Format: ⇐ STX ESC ‘v’ ‘PT630 V5.00’ CS1 CS2 ETX ⇒ ACK or NAK Description: The model and BIOS version numbers are separated by a space character.
  • Page 71 ------------------------------------------------------------------------------------------------------------------ Chapter 3. Update Note Correct error return value on BX on section 1.5.25Get DOS and Firmware Version Number Entry Parameter: AL = 0/1 Return Value: if AL = 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)
  • Page 72 ------------------------------------------------------------------------------------------------------------------ Error entry value on 1.8.8 Flush RS232 RX buffer Entry Parameter: Return Value: None Add COM2 RS232 function call on section Add reverse display under small font mode on Keymap table error on 1.5.15 Set User-defined Key-map Entry Parameter: Return Value: None Example: void TD_key_map(unsigned char *str)
  • Page 73 ------------------------------------------------------------------------------------------------------------------ Add Multi-protocol command “Bell” on section Add Aim mode for long range engine on 1.5.12.13 Set Aim mode for Long Range engine 10. Add alpha lower/upper case mode on 1.5.12.14 Set Alpha input mode 11. Add Code 32 function call on 1.5.17.10 2.4.24...

Table of Contents