background image

 

 

 

 

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,&regs,&regs); 

 } 

 

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,&regs,&regs); 
   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,&regs,&regs); 
   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,&regs,&regs); 
   return(regs.h.al); 

 

Содержание PT630

Страница 1: ...PT630 Programming Reference Guide Page 1 of 59 PT630 Portable Terminal Programming Reference Guide V1 1...

Страница 2: ...T 21H 15 2 4 1 Terminate Program 15 2 4 2 Read Keypad wait if no key and Write to LCD 15 2 4 3 Write LCD 15 2 4 4 Read RS232 wait if no character 15 2 4 5 Write RS232 16 2 4 6 Direct Console I O 16 2...

Страница 3: ...Get System Date 36 2 4 58 Set System Date 36 2 4 59 Get System Time 37 2 4 60 Set System Time 37 2 4 61 Set Alarm Date 37 2 4 62 Set Alarm Time 38 2 4 63 Get DOS and Firmware Version Number 38 2 4 64...

Страница 4: ...PT630 Download 62 2 3 2 Cancel Current Downloading File Command ESC z 63 2 3 3 Host Requests File from the PT630 Upload 63 2 3 4 Cancel Current Uploading File Command ESC y 63 2 4 HOST COMMANDS 64 2...

Страница 5: ...H LCD Control 21 H System Functions 22 H Power Manager 31 H Beeper Control 33 H RS232 Control 1 2 Display Font Functions INT 09H 1 2 1 Select Large Font Entry Parameter AH 0 select 8 16 dot character...

Страница 6: ...mall font int TL_get_font_type regs h ah 3 int86 0x09 regs regs return regs h al 1 2 5 Set User Defined Font for All Characters Entry Parameter AH 4 AL 0 1 large small font DS DX pointer to the buffer...

Страница 7: ...0 1 large small font CL 0 255 character DS DX pointer to the buffer with font data for large font buffer size 16 bytes for small font buffer size 6 bytes Return Value None Example void TL_change_one_A...

Страница 8: ...le void TL_get_one_ASCII_font int type int ascii_code unsigned char str regs h ah 7 regs h al unsigned char type regs h cl unsigned char ascii_code segregs ds FP_SEG str regs x dx FP_OFF str int86x 0x...

Страница 9: ...Scroll Entry Parameter AH 1 AL 0 1 disable enable screen scroll Return Value None Example void TL_scroll int status regs h ah 1 regs h al unsigned char status int86 0x10 regs regs 1 4 3 Set Cursor Po...

Страница 10: ...dh x regs h dl 1 4 5 Display 16x16 Bitmap Entry Parameter AH 4 DH Row DL Column DS BX pointer to bitmap 32 bytes pattern data Return Value None Note This function is available only in large font Examp...

Страница 11: ...4 25 26 27 28 29 30 31 32 Content FF FF FF FE FC F9 F3 E7 CF CF E7 F3 F9 F3 E7 CF include stdio h include stdlib h include dos h include conio h unsigned char logo 32 0xFF 0xFF 0x3E 0x1C 0xC9 0xE3 0xF...

Страница 12: ...regs regs sregs getch 1 4 6 Set Cursor On Off Entry Parameter AH 5 AL 0 1 set cursor OFF ON Return Value None Example void TL_cursor_type int status regs h ah 5 regs h al unsigned char status int86 0x...

Страница 13: ...map 32 bytes pattern data Return Value None Note This function is available only in large font Example void TL_display_16x16 unsigned char str regs h ah 0x4F segregs ds FP_SEG str regs x bx FP_OFF str...

Страница 14: ...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 reg...

Страница 15: ...ASCII character Example unsigned char TS_stdin regs h ah 1 int86 0x21 regs regs 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...

Страница 16: ...haracter in DL to LCD 255 read ASCII character from keypad Return Value 1 When read DL 255 Character in AL if ZERO flag is cleared No input if ZERO flag is set 2 When write DL 255 None Example unsigne...

Страница 17: ...ypad Input Entry parameter AH 0AH DS DX pointer to data buffer Return value DS DX pointer to data buffer Data format in buffer Input buffer with CR at last number of characters actual input number of...

Страница 18: ...char status int86 0x21 regs regs 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 reg...

Страница 19: ...tatus int86 0x21 regs regs 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...

Страница 20: ...de Display ALPHA 1 5B 0 English ALPHA 2 5C ALPHA 3 5D ALPHA 1 8F 1 Sweden Finland ALPHA 2 8E ALPHA 3 99 ALPHA 1 92 2 Danish ALPHA 2 9D ALPHA 3 8F ALPHA 1 AD 3 Spanish ALPHA 2 A5 ALPHA 3 A8 ALPHA 1 F8...

Страница 21: ...t 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 AH 1AH BH 0AH AL 0 Set the Good read LED green light OFF 1 Set the Good...

Страница 22: ...ter 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 regs regs...

Страница 23: ...us Entry Parameter AH 1BH BH 5 Return values AL 0 Scanner port is disabled 1 Scanner port is enabled 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...

Страница 24: ...xxxxxxx1 8 data bits 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 brea...

Страница 25: ...e None Note Only for NONE communication protocol Example void TC_flow_ctrl int status if status 0 Set flow control to none regs h ah 0x1C regs h bh 2 regs h al 1 int86 0x21 regs regs regs h ah 0x1C re...

Страница 26: ...mmunication Protocol Entry Parameter AH 1CH BH 4 AL 2 Set to MULTIPOINT protocol 3 Set to NONE protocol Return Value None Example void TC_protocol int status regs h ah 0x1C regs h bh 4 regs h al unsig...

Страница 27: ...address char status regs h ah 0x1C regs h bh 6 regs h al status int86 0x21 regs regs return char regs h al 1 5 13 8 Set File Uploading Message ON OFF Entry Parameter AH 1CH BH 0AH AL 0 Not display mes...

Страница 28: ...0 int86x 0x21 regs regs segregs return regs h al 1 5 14 2 Set ONLINE LOCAL in Terminal Mode Entry Parameter AH 1DH BH 1 AL 0 1 ONLINE LOCAL Return Value None Example void TT_online_local int status re...

Страница 29: ...Entry Parameter AH 1DH BH 4 AL 0 CHARACTER mode 1 BLOCK mode DX 0 block LINE 1 block PAGE 2 block LINE or PAGE Return Value None Example void TT_mode int status int status1 regs h ah 0x1D regs h bh 4...

Страница 30: ...int86 0x21 regs regs 1 5 14 8 Get Terminal ID Entry Parameter AH 1DH BH 0x10 Returned Value DS DX output buffer pointer 1 5 15 Set User defined Key map Entry Parameter AH 1EH AL 0 DS DX pointer to Key...

Страница 31: ...1 PgDn 93 14 F2 87 46 F2 87 78 F2 87 110 F2 87 142 F6 8B 15 0 47 0 79 0 111 0 143 00 16 9 39 48 Y 59 80 Z 5A 112 5F 144 2A 17 6 36 49 P 50 81 Q 51 113 R 52 145 2F 18 3 33 50 G 47 82 H 48 114 I 49 146...

Страница 32: ...N 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 D...

Страница 33: ...rleaved 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 Val...

Страница 34: ...BL 8 AL bit 0 0 1 disable enable Code 32 decoding AL bit 1 0 1 not send send check digit AL bit 2 0 1 not send send leading character A Return Value None 1 5 17 11 UPC A Settings Entry Parameter AH 1F...

Страница 35: ...Parameter AH 1FH BH 3 BL 14H AL bit 0 0 1 disable enable UPC E decoding 2 0 1 no send send Check Digit Return Value None 1 5 17 15 User Code 1 Setting TRIOPTIC Code Entry Parameter AH 1FH BH 3 BL 21H...

Страница 36: ...egs 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...

Страница 37: ...rn 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...

Страница 38: ...0H 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...

Страница 39: ...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...

Страница 40: ...e 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...

Страница 41: ...regs h ah 0x3f regs x cx cnt regs x bx hdl int86x 0x21 regs regs segregs if regs x cflag 0x01 0 return regs x ax else return 1 1 5 28 5 Write File with Handle Entry Parameter AH 40H BX Handle of file...

Страница 42: ...m current 2 offset from end BX Handle of file CX most significant half of 32 bits offset DX least significant half of 32 bits offset Return Value if success CARRY flag is cleared AX least significant...

Страница 43: ...ition Entry Parameter AH 42H AL 5 search forward to the end of file 6 search backward to the beginning of file BX file handle CH n Total field number in the data record CL m search mth field DS DX poi...

Страница 44: ...o new file name string Return Value if success AH 0 and CARRY flag is cleared if failed AH 1 and CARRY flag is set Example int TS_rename_file char inf char far outf segregs ds FP_SEG inf regs x dx FP_...

Страница 45: ...ned 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 0x01 0 return 1...

Страница 46: ...egs 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 AH 4BH AL 3 DS DX pointer toprogram name Return Value i...

Страница 47: ...er 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...

Страница 48: ...P_SEG str regs x dx FP_OFF str int86x 0x21 regs regs segregs while wait regs h al return regs h al 1 5 37 Send Data to RS232 Port in MULTIPOINT Protocol Buffered Output Entry Parameter AH 5DH DS DX po...

Страница 49: ...Parameter AH 5EH Returned Value AL 0 output buffer is empty 1 output buffer has data Note 1 Only for MULTIPOINT communication protocol 2 The function can be used to check if data has been sent to Host...

Страница 50: ...ample C program with INT22 int get_barcode char str_bar union REGS regs struct SREGS sregs regs x dx int str_bar segread sregs regs h ah 0x50 intdosx regs regs sregs if regs x ax 1 return 0 no data in...

Страница 51: ...try Parameter AX frequency BX time duration AX Frequency Hz BX Time Duration ms 0 200 0 10 1 400 1 50 2 600 2 100 3 800 3 200 4 1K 4 500 5 2K 5 800 6 2 5K 6 1K 7 3K 7 1 5K 7 5K 8 2K Return Value None...

Страница 52: ...ty xxxx11xx evenparity bit 1 xxxxxx0x one stop bit xxxxxx1x two stop bits bit 0 xxxxxxx0 7 data bits xxxxxxx1 8 data bits Return Value None Example int TC_232_parameter long baud int parity int stop i...

Страница 53: ...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 AH 1 Return Value 1 AH 0 has character input AL character 2 AH 1 no character input N...

Страница 54: ...nication 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 AH 3 Return Value None Example void TC_232_enable r...

Страница 55: ...egs regs void TC_232_DTR int dtr regs h ah 5 regs h al 1 regs h dh unsigned char dtr int86 0X33 regs regs 1 8 7 Get CTS DSR Signal Status of RS232 Port Entry Parameter AH 6 AL 1 get CTS AL 2 get DSR R...

Страница 56: ...bits bit 0 xxxxxxx0 7 data bits xxxxxxx1 8 data bits 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 sw...

Страница 57: ...return regs h al return 255 1 9 3 Send Character to COM2 RS232 Port Entry Parameter AH 2 AL character Return Value None Note Only for NONE communication protocol Example void TC_232_char_O unsigned c...

Страница 58: ...egs regs void TC_232_DTR int dtr regs h ah 5 regs h al 1 regs h dh unsigned char dtr int86 0X14 regs regs 1 9 7 Get CTS DSR Signal Status of RS232 Port Entry Parameter AH 6 AL 1 get CTS AL 2 get DSR R...

Страница 59: ...ccording to MULTIPOINT protocol 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 w...

Страница 60: ...ex 9F hex A0 hex FF hex convert to 20 hex 7F hex excluding DC hex 2 One byte data transmitted as original data without converting all codes not in 1 including DC hex 2 1 6 Data Checksum Calculation in...

Страница 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...

Страница 62: ...21H AH 5DH to put data in buffer Once polled by host computer PT630 system will send data out 2 3 File Communication in MULTIPOINT Protocol 2 3 1 Host Send File to PT630 Download Format STX ESC L fil...

Страница 63: ...is STX ESC Y data CS1 CS2 ETX received ACK or NAK STX ESC Z CS1 CS2 ETX end of file transfer ACK or NAK Description For uploading the host must know the filename on PT630 Get Directory Command ESC D...

Страница 64: ...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...

Страница 65: ...mmunication time out comtable The new communication control table takes effect immediately after the command has been successfully received The PT630 will reinitialize the corresponding communication...

Страница 66: ...F nnn CS1 CS2 ADDR nnn 3 digits in ASCII STX ESC F retcode CS1 CS2 ETX retcode 00H successful 01H can t change 02H invalid value ACK or NAK Description If PT630 RAM disk has files its size can t be c...

Страница 67: ...STX ESC I prg name CS1 CS2 ETX if RAM program is running or STX ESC I prg name ROM CS1 CS2 ETX if FLASH program is running or STX ESC I retcode CS1 CS2 ETX if no program is running retcode 01H ACK or...

Страница 68: ...spectively For Example string 19900926234500 will set PT630 clock to September 26 1990 The time is 11 45 PM The PT630 reconfigures the real time clock chip as soon as the command has been successfully...

Страница 69: ...mode terminator character termtable The new terminal control table takes effect immediately after the command has been successfully received 2 4 20 Device Configuration ESC V Format STX ESC V devtabl...

Страница 70: ...character 2 4 22 Run Program in RAM or FLASH memory ESC X Format STX ESC X prg name CS1 CS2 ADDR STX ESC X retcode CS1 CS2 ETX retcode 00H run from RAM 01H no program 02H run from FLASH ACK or NAK 2 4...

Страница 71: ...major firmware version number CH minor firmware version number BX 830H 2 Correct error entry value on 1 2 1 Select Large Font Entry Parameter AH 0 1 select 8 16 dot character font 4 lines 16 columns...

Страница 72: ...130 23 3 CLR 08 35 CLR 08 67 CLR 08 99 CLR 08 131 5c 4 0 36 0 68 0 100 0 132 84 5 F1 86 37 F1 86 69 F1 86 101 F1 86 133 F5 8A 6 ENTER 0D 38 ENTER 0D 70 ENTER 0D 102 ENTER 0D 134 ENTER 0D 7 0 39 0 71...

Страница 73: ...8 Add Multi protocol command Bell on section 2 4 24 9 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...

Отзывы: