Unitech MR350MKII manual

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86

Go to page of

A good user manual

The rules should oblige the seller to give the purchaser an operating instrucion of Unitech MR350MKII, along with an item. The lack of an instruction or false information given to customer shall constitute grounds to apply for a complaint because of nonconformity of goods with the contract. In accordance with the law, a customer can receive an instruction in non-paper form; lately graphic and electronic forms of the manuals, as well as instructional videos have been majorly used. A necessary precondition for this is the unmistakable, legible character of an instruction.

What is an instruction?

The term originates from the Latin word „instructio”, which means organizing. Therefore, in an instruction of Unitech MR350MKII one could find a process description. An instruction's purpose is to teach, to ease the start-up and an item's use or performance of certain activities. An instruction is a compilation of information about an item/a service, it is a clue.

Unfortunately, only a few customers devote their time to read an instruction of Unitech MR350MKII. A good user manual introduces us to a number of additional functionalities of the purchased item, and also helps us to avoid the formation of most of the defects.

What should a perfect user manual contain?

First and foremost, an user manual of Unitech MR350MKII should contain:
- informations concerning technical data of Unitech MR350MKII
- name of the manufacturer and a year of construction of the Unitech MR350MKII item
- rules of operation, control and maintenance of the Unitech MR350MKII item
- safety signs and mark certificates which confirm compatibility with appropriate standards

Why don't we read the manuals?

Usually it results from the lack of time and certainty about functionalities of purchased items. Unfortunately, networking and start-up of Unitech MR350MKII alone are not enough. An instruction contains a number of clues concerning respective functionalities, safety rules, maintenance methods (what means should be used), eventual defects of Unitech MR350MKII, and methods of problem resolution. Eventually, when one still can't find the answer to his problems, he will be directed to the Unitech service. Lately animated manuals and instructional videos are quite popular among customers. These kinds of user manuals are effective; they assure that a customer will familiarize himself with the whole material, and won't skip complicated, technical information of Unitech MR350MKII.

Why one should read the manuals?

It is mostly in the manuals where we will find the details concerning construction and possibility of the Unitech MR350MKII item, and its use of respective accessory, as well as information concerning all the functions and facilities.

After a successful purchase of an item one should find a moment and get to know with every part of an instruction. Currently the manuals are carefully prearranged and translated, so they could be fully understood by its users. The manuals will serve as an informational aid.

Table of contents for the manual

  • Page 1

    MR350MKII Data Collection Terminal Programming Reference Manual Unitech Electronics Co., Ltd. September 2001 V1.2[...]

  • Page 2

    1 - 1 Introduction This manual is a hand book for whom intend to develop an application program on MR350MKII and Host computer or M S - DOS based PC. It will introduce the I/O function calls, DOS Manager function calls, File Manager function calls and Host ESC commands. For your easy understanding, source code of the two sample programs are listed [...]

  • Page 3

    1 - 2 Table of Contents Ta ble of Contents ................................................................................................................... 1 - 2 1. System Kernel ............................................................................................................ 1 - 6 1.1. Application Programming Interface ..............[...]

  • Page 4

    1 - 3 03 Enable RS - 232 port .................................................................................................. 3 - 27 04 Disable RS - 232 port ................................................................................................. 3 - 27 00 Set Communication parameters ....................................................[...]

  • Page 5

    1 - 4 2B Set System date ........................................................................................................ 3 - 50 2C Get System clock ..................................................................................................... 3 - 50 2D Set System clock ................................................................[...]

  • Page 6

    1 - 5 4.5. ESC Commands Added for MV1100 Fingerprint Module . ......................................... 4 - 72 4.5.1. Get Template List (ESC $D) ................................................................................ 4 - 72 4.5.2. Erase Template ( ESC $E) .................................................................................... [...]

  • Page 7

    1 - 6 Chapter 1. System Kernel 1. System Kernel This chapter is used to introduce the system kernel of MR350MKII. Where the system kernel is divided into six subsystems to service application programming interface, keyboard input, LCD display, communi cation I/O, Real Time Clock, Relay output/Digital input and Barcode wand/Magnetic stripe/Proximity[...]

  • Page 8

    1 - 7 1.2. Keypad Subsystem The keypad subsystem scans the key matrix, converts the scan code to its associated key value, and stores the value in the input buffer of keyboard for program utilization. Note that the [SHIFT] key i s not stored into the buffer, it is used to distinguish the alphabetic and numeric mode of associated key position and pr[...]

  • Page 9

    1 - 8 1.4. Communication Subsystem The MR350MKII terminal communication subsystem consists of 1) point - to - poi nt connection mode and 2) multi - point connection mode for network processing. 1.4.1. Point to point mode Either RS - 232 or RS - 485 port can be used in point - to - point mode when it is set as serial port . Each port can be configur[...]

  • Page 10

    1 - 9 1.7. Bar code / Magnetic stripe / Proximity / ICC The MR350MKII has two ports for connecting different reader Internal reader and External reader . External reader port is dedicated for bar code reading by a bar code wand, CCD, or laser diode scanners, and the terminal supports reading of Code 39, Co de 128, Codabar, Interleaved 2 of 5, UPC a[...]

  • Page 11

    1 - 10 Displays all of the files which are stored in the MR350MKII ( Program as well as data file) ? MS-Kermit>REMOTE DEL <file name> Deletes a program or data file in the MR350MKII. Step 7. Press [SHIFT] in conjunction with [F5/*] on MR350MKII to exit from Kermit server mode to Ready mode. Step 8. Select option “ 1) RUN ” in user comm[...]

  • Page 12

    1 - 11 6) Then, the screen will display: V2.1 COM2 Address: ESC=1 NAK=3 PARA=9600,1,8,NONE 0.Send 1.Poll A.Stop B.BarT C.ComT D.DIR E.Del F.ExeSize f.Font G.Memory H.Reset I.ExFile J.Exist K.Keypad k.Kermit L.Dnload M.Time N.Buzzer O.Auto P. Passwd Q.UplMode R.TrmID T.TrmT U.Upload V.DEV_T X.Exec 3.brk 5.ChgAdr 9.Loop @.Modem ?.320 ~.UPS off F1.Add[...]

  • Page 13

    1 - 12 N). Set beeper's volume. O). Set a executable object program to be started up automatically after power - up. Q). Inquire Uploading status (Not available on MR350MKII) R). Change terminal's ID. T). Set terminal control table. U). Upload a program or data file from MR350MKII. V ). Set device control table. X). Remote run means that [...]

  • Page 14

    1 - 13 10) Select item 1) to start getting data, PC screen will appear " … . " indicating there is no data collected. If any of those terminals starting input data by scannin g bar code label, PC screen will show as below: A (nn): XXXXXX The first character mean terminal address. Where XXXXXX is the data scanned from all connected barco[...]

  • Page 15

    2 - 14 Chapter 2. Data Structure 2. Data Structure MR350MKII system control data structures are outlined in the following diagram. The system kernel uses the File Al location Table (FAT), File Handle Table (FHT), Communication Control Table, Device Control Table and Key Alias Table. The following sections will describe each one of these control tab[...]

  • Page 16

    2 - 15 'M' = enable badge port for magnet ic card reader 'D' = disable badge port lcd_backlight: 'N' = set LCD backlight ON ' F ' = set LCD backlight OFF (default) buzzer: ' N ' = set buzzer ON (default) 'F' = set buzzer OFF keylock: ' N ' = set keyboard Unlock (default) 'K&[...]

  • Page 17

    2 - 16 'F' = Disabl e barcode decoding of Code 128 2.4. Communication Control Table of Host port The communication control table is applicable to configure the host port of the MR350MKII. The communication control table specifies all communication parameters between the host syst em and the MR350MKII. When a hard reset command is issued v[...]

  • Page 18

    2 - 17 'O' = Odd parity 'E' = Even parity protocol: ' M ' = M ultipoint (default) 'F' = None protocol address: ' A ' = terminal address ID for Multipoint mode (default) Each MR350MKII has to be assigned a unique communication address when it is used in a Multipoint environment. The address is used b[...]

  • Page 19

    2 - 18 BYTE pageterm;/* page terminator */ } TERM_CONFIG; Each MR 350MKII "terminal" is identified by an ASCII string. There can be up to seven characters of a terminal identification. The identification entry in the TERM_CONFIG table has one more character space to allow ASCII_Z (hex 0) termination, as in C language con vention. online: [...]

  • Page 20

    2 - 19 lineterm: designates the termination character o f line block mode (default = null) pageterm: designates the termination character of page block mode (default = null)[...]

  • Page 21

    3 - 20 Chapter 3. I/O Function Calls 3. I/O Function Calls The operating system of the MR350MKII supports BIOS/DOS Function to control L CD display, Keyboard input, Proximity/Barcode/Magnetic stripe input, Buzzer, Security alarm, Photo - coupler input, Relay output, and serial port input/output of RS232 and RS485. The whole C sample program are gat[...]

  • Page 22

    3 - 21 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); } 03 Get cursor position Entry Parameters: AH = 3 Returned Va lues: DH = 0 ~ 1 ;row DL = 0 ~ 15 ;column void TL_getxy(int *x,int *y) { regs.h.ah = 3; int86(0x10,&regs,&regs); *y = regs.h.dh; *x = r[...]

  • Page 23

    3 - 22 int86(0x 21 ,&regs,&regs); } 3.2. Communication Environment Setup Before placing MR350MKII into the communication environment, you have to decide: 1) Whether the RS - 422/485 port or RS - 232 port assigned as host port and another one as serial port. 2) Set communication protocol for host port. Please note, the protocol for serial po[...]

  • Page 24

    3 - 23 void TC_select_host(int status) { regs.h.ah = 0x1C ; regs.h. al = (unsigned char)status; regs.h. bh = 0; int86(0x 21 ,&regs,&regs); } 1C Set host port protocol Entry Parameters: AH = 1C BH = 1 AL = 2 ; Multi - point (default) 3 ; None protocol Returned Valued: None void TC_protocol(int status) { regs.h.ah = 0x1C ; regs.h. al = (unsig[...]

  • Page 25

    3 - 24 } 19 Set COM1 port as RS485 or modem This function call is used to set COM1 port as RS485 serial port or modem when you have the internal modem interface installed. Before you can start to use modem for communication, you must set COM1 port as modem. Entry Parameters: AH = 19 AL = 0 ; set as RS485 1 ; set as modem Returned Value: None void T[...]

  • Page 26

    3 - 25 { regs.h.a h = 0x1C ; regs.h.al= status ; regs.h. bh = 9 ; int86(0 x21,&regs,&regs); } 5F Read host port Entry Parameters: AH = 0x5F Returned Values: DS:DX = buffer pointer AL = 0 ;output succeed 1 ;no data int TC_str_I(unsigned char *str,int wait) { do { regs.h.ah= 0x5F ; segregs.ds = FP_SE G(str); regs.x.dx = FP_OFF(str); int86x(0x[...]

  • Page 27

    3 - 26 Returned Values: AL = 0 ;port is available 1 ;port is busy int TC_ready(int wait) { int i; do { regs.h.ah= 0x61 ; int86(0x21,&regs,&regs); } while (wait && re gs.h.al); return( regs.h.al ); } 3.4. Serial I/O for RS - 232 and RS - 485 The system allow to the RS - 232 and RS - 485 to serve serial input/output (character mode I/[...]

  • Page 28

    3 - 27 02 Output data Entry Parameters: AH = 2 AL = Data character Returned Values: None void TC_232_char_O(unsigned char ch) { regs.h.ah = 2; regs.h.al = ch; int86(0x34,&regs,&regs); } 03 Enable RS-232 port Entry Parameters: AH = 3 Returned Values: None void TC_232_enable() { regs.h.ah = 3; int86(0x34,&regs,&regs); } 04 Disable RS-[...]

  • Page 29

    3 - 28 0001xxxx 150 baud rate 0010xxxx 300 baud rate 0011xxxx 600 baud rate 0100xxxx 1200 baud rate 0101xxxx 2400 baud rate 0110xxxx 4800 baud rate 0111xxxx 9600 baud rate 1000xxxx 19200 baud rate 1001xxxx 38400 baud rate Return Values: None void TC_232_parameter(long baud,int parity,int stop,int data) { unsigned char cc=0; unsigned int i_baud; i_b[...]

  • Page 30

    3 - 29 } regs.h.ah = 0; regs.h.al = cc; int86(0x34,&regs,&regs); } 05 Set RTS signal of RS-232 port Entry Parameters: AH = 5 AL = 2 DH = 0 ;set RTS to LOW 1 ;set RTS to HIGH (default) Returned Values: None void TC_232_RTS(int rts) { regs.h.ah = 5; regs.h.al = 2; regs.h.dh = (unsigned char)rts; int86(0x34,&regs ,&regs); } 06 Read CTS[...]

  • Page 31

    3 - 30 AH = 0 AL = Data character 2) if no character received AH = 1 AL = undefined unsigned char TC_485_char_I() { regs.h.ah = 1; int86(0x33,&regs,&regs); if (regs.h.ah == 0) return(regs.h.al); return(255); } 02 Output data Entry Parameters: AH = 2 AL = Data character Returned Values: None void TC_485_char_O(unsigned char ch) { regs.h.ah =[...]

  • Page 32

    3 - 31 int86(0x33,&regs,&regs); } 00 Set Communication parameters Entry Parameters: AH = 0 BIT # 76543210 AL = bit 0 xxxxxxx0 7 data bits xxxxxxx1 8 data bits bit 1 xxxxxx0x 1 stop bit xxxxxx1x 2 stop bits bit 2 - 3 xxxx00xx NONE parity xxxx01xx ODD parity xxxx11xx EVEN parity bit 4 - 7 0000xxxx 110 baud rate 0001xxxx 150 baud rate 0010xxxx[...]

  • Page 33

    3 - 32 default: cc=0x70; break; } switch (parity) { case 0 : break; case 1 : cc=cc|0x04; break; case 2 : cc=cc|0x0c; break; case 3 : cc=cc|0x08; break; } sw itch (stop) { case 1 : break; case 2 : cc=cc|0x02; break; } switch (data) { case 7 : break; case 8 : cc=cc|0x01; break; } TD_int_dos1(0x1C,cc,1,0); regs.h.ah = 0; regs.h.al = cc; int86(0x33,&am[...]

  • Page 34

    3 - 33 06 Close RS-485 multi-bus (release RS-485 bus) Entry Parameters: AH = 6 Returned Values: None void TC_485_close() { regs.h.ah = 6; int86(0x33,&regs,&regs); } NOTE : 1) While the RS - 485 post is used for serial input/output (character I/O) communication. The application must enable RS - 485 first to set communication characteristic a[...]

  • Page 35

    3 - 34 3.5. Relay Output / Digit Input / Buzzer / LED Indicator Set LED indicator ON/OFF INT 09H Entry Parameters: AH = 2 Bit# 76543210 AL= 0000xxxx, where: x: 1, Set LED on 0, Set LED off Bit0: LED1 Bit1: LED2 Bit2: LED3 Bit3: L ED4 Returned Value: None Ex. AL = 00000011 means to turn on LED1 and LED2. void TD_LED(int led1,int led2,int led3,int le[...]

  • Page 36

    3 - 35 regs.h.ah = (unsigned char)port; regs.h.al = (unsigned char)type; int86(0x08,&regs,&regs); return((int)regs.h.al); } Activate/Deactivate Relay ports INT 09H Entry Parameters: AH = 0 ;select Relay #1 1 ;select Relay #2 AL = 0 ;deactivate selected Relay contact OPEN 1 ;activate selected Relay contact CLOSE Returned Values: None void TD[...]

  • Page 37

    3 - 36 1A Set buzzer volume INT 21H Entry Parameters: AH = 0x1A BH = 3 AL = 0 ;set LOW volume 1 ;set MEDIUM volume 2 ;set HIGH volume Returned Values: None void TD_beeper_vol(int status) { regs.h.ah= 0x1A ; regs.h.al= (unsigned char)status; regs.h.bh= 3; int86(0x21,&regs,&regs); return(regs.h. al); } 1B Get Security state INT 21H Entry Para[...]

  • Page 38

    3 - 37 regs.h.bh = 8; int86(0x21,&regs,&reg s); } 54 Buzzer volume control with user-defined frequency and time INT 21H Entry Parameters: AH = 0x54 CX = 1 - 3000 ;frequency in Hz DX = 1 - 1600 ;sound duration in mini - second Returned Values: None void TD_beep_user(int fz,int tm) { regs.h.ah = 0x54; regs.x.cx = fz; regs.x.dx = tm; int86(0x2[...]

  • Page 39

    3 - 38 3.6. Internal/ External reader Port: INT 21H There are two readers can be connected to MR350 MKII --- Internal Reader and External Reader . Internal reader is a build - in reader, it is installed inside of MR350 MKII. External reader can be connected to either scanner port or terminal block. For internal reader, if it cannected with Magnetic[...]

  • Page 40

    3 - 39 50 Read data from external reader(only available for Barcode and Magnetic reader) Entry Parameters: AH = 0x50 Returned Values: DS:DX = buffer pointer AX = 0 ;data input 1 ;no data input Scanning direction CL = 0 ;from right to left 1 ;from left to right int TD_g et_ external (unsigned char *str,int wait ,int *direction ) { int i; do { segreg[...]

  • Page 41

    3 - 40 0x13 : EAN - 13 0x14 : EAN - 8 CH = 1 :Magnetic data CL = 0 ;from right to left 2 ;f rom left to right BL = 0x01 : Track 1 0x02 : Track 2/3 'K' : ARK501 keypad input CH = 2 : Wiegand data CL = 0 : formatted data 1 : unformatted data BL = data length in bit int TD_get_ internal (unsigned char *str,int *direct_format,int *dev _type,i[...]

  • Page 42

    3 - 41 BH = 5 BL = 0 ; for both 26 - and 36 - bit formats 26 ; for 26 - bit only 36 ; for 36 - bit only 0xff ; for un - formatted data AL = 0 ; Disable 1 ; Enable Returned Values: None void TD_set_wiegand_stat us(int status,int type) { regs.h.ah= 0x1f; regs.h.al= (unsigned char)status; regs.h.bh= 5; if (type == - 1) regs.h.bl= 0xff; else regs.h.bl=[...]

  • Page 43

    3 - 42 AL = 0 ;assign barcode input 1 ;assign magnetic stripe input Returned Values: None void TD_set_internal_type(int status) { regs.h.ah= 0x1A; regs.h.al= (unsigned char)status; regs.h.bh= 6; int86(0x21,&regs,&regs); return (regs.h.al); } 1F Enable the decoding of a barcode symbology Entry Parameters: AH = 0x1F BH = 1 AL = 0 ; Disable 1 [...]

  • Page 44

    3 - 43 Returned Values: AL = 1 ; Lithium battery low 0 ; Normal int TS_lithium_battery() { regs.h.ah= 0x1A; regs.h.bh= 9; int86(0x21,&regs,&regs); return(regs.h.al); } 1B Get Address ID of the terminal Entry Parameters: AH = 0x1B BH = 6 Returned Values: AL = Address ID char TC_get_address() { regs.h.ah = 0x1b; regs.h.bh = 6; int86(0x21,&[...]

  • Page 45

    3 - 44 void TS_get_interrupt_vector(int vect,unsigned int *es,unsigned int *bx) { regs.h.ah= 0x35; regs.h.al= (unsigned char)vect; int86 x(0x21,&regs,&regs,&segregs); *es = segregs.es; *bx = regs.x.bx; } 36 Get free disk cluster Entry Parameters: AH = 0x36 Returned Values: AH = 1 (number of sector per cluster) BX = number of available c[...]

  • Page 46

    3 - 45 DS:DX = keyboard map with 128 bytes corresponded to numeric and alphabetic ASCII code table; a NULL for defining unused key. CX = 0x80 (table length for 128 bytes) Returned Values: None void TD_key_map(unsigned char *str) { regs.h.ah=0x1E; regs.h.bh=1; regs.x.cx=0x80; segregs.ds = FP_SEG(str); regs.x.dx = FP_OFF(str); int86x(0x21,&regs,&[...]

  • Page 47

    3 - 46 ASCII code corresponded to scan code in Alphabetic mode Alphabet ic mode keyboard layout ASCII code, ASCII code, ASCII code [Scan code, Scan code, Scan code] F1 ? ? F5 * QZ . ABC DEF 86 [23] 8A [1B] 51,5A,2E [24,25,26] 41,42,43 [27,28,29] 44,45,46 [2A,2B,2C] F2 ? ? F6 ? GHI JKL MNO 87 [22] 8B [1A] 47,48,49 [2D,2E,2F ] 4A,4B,4C [30,31,32] 4D,[...]

  • Page 48

    3 - 47 DL = 8 - bit data Returned Values: None void TS_stdout(unsigned char ch) { regs.h.ah= 2; regs.h.dl= ch; int86(0x21,&regs,&regs); return; } 03 Read stdaux (COM2 RS-232 port) No check on control keys (ESC) Entry Parameters: AH = 03 Returned Values: AL = 8 - bit data unsigned char TS_stdaux_in() { regs.h.ah= 3; int86(0x21,&regs,&[...]

  • Page 49

    3 - 48 if char not ready, Zero = set unsigned char TS_stdin_out(unsigned char ch) { regs.h.ah= 6; regs.h.dl= ch; int86(0x21,&regs,&regs); if (ch == 0xFF) { if ((regs.x.cflag & 0x40) == 0) return(regs.h.al); else return(0); } return(0); } 07 Read stdin (wait if no key) No check on c ontrol keys (ESC) Entry Parameters: AH = 07 Returned Va[...]

  • Page 50

    3 - 49 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); return; } 0A Keyboard buffer input Entry Parameters: AH = 0A DS:DX = po inter to input buffer area Returned Values: Buffer filled with last character by a CR void TS_stdin_string(unsigned[...]

  • Page 51

    3 - 50 CX = year (1980..2099) DH = month (1..12) DL = day (1..31) 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; } 2B Set System date Entry Parameters: AH = 2B CX = year (1980..2099) DH = month (1..12) DL = day (1..31) Returned Values: [...]

  • Page 52

    3 - 51 2D Set System clock Entry Parameters: AH = 2D CH = hour (0..23) CL = min (0..59) DH = sec (0..59) Returned Value s: AL = 0 int TS_set_time(int hour,int minute,int second,int hund_sec) { regs.h.ch = hour; regs.h.cl = minute; regs.h.dh = second; regs.h.dl = hund_sec; regs.h.ah = 0x2d; int86(0x21,&regs,&regs); return(regs.h.al); } 3.9. [...]

  • Page 53

    3 - 52 if ((regs.x. cflag & 0x01) == 1) return( - 1); else return(regs.x.ax); } 3D Open file The file must exist in the file table. This function returns the file handle. Entry Parameters: AH = 3D AL = 0 ; Read only 1 ; Write only 2 ; Both Read and Write DS:DX = segment:offset of ASCIIZ file name Returned Values: if successful : Carry = clear, [...]

  • Page 54

    3 - 53 3F Read file Copy (CX) bytes from current address to DS:DX. Advance the current address (CX) number of bytes. Entry Parameters: AH = 3F BX = file handle CX = number of bytes to read DS:DX = segment:offset of buffer area Returned Values: if successful: Carry = clear, AX = number of bytes read, 0 if EOF if fail: Carry = set, AX = 6 int TS_read[...]

  • Page 55

    3 - 54 if ((regs.x.cflag & 0x01) == 0) return(regs.x.ax); else return( - 1 ); } 41 Delete file Entry Parameters: AH = 41 DS:DX = segment:offset of ASCIIZ file name Returned Values: if successful : Carry = clear, if fail : Carry = set, AX = 2 int TS_delete_file(char *fn) { segregs.ds = FP_SEG(fn); regs.x.dx = FP_O FF(fn); regs.h.ah=0x41; int86x([...]

  • Page 56

    3 - 55 long TS_seek_file(int hdl,int typ e,long loc) { union LONG_III aa; regs.h.ah=0x42; regs.h.al=(unsigned char)type; regs.x.bx=hdl; aa.l.ll = loc; regs.x.cx=aa.i.ii2; regs.x.dx=aa.i.ii1; int86(0x21,&regs,&regs); aa.i.ii2=regs.x.dx; aa.i.ii1=regs.x.ax; if ((re gs.x.cflag & 0x01) == 0) return(aa.l.ll); else return( - 1L); } 43 Get fil[...]

  • Page 57

    3 - 56 segregs.ds = FP_SEG(inf); regs.x.dx = FP_OFF(inf); segregs.es = FP_SEG(outf); regs.x.di = FP_OFF(outf); regs.h.ah=0x56; int86x(0x21,&regs,&regs,&segregs); if ((regs.x.cflag & 0x01) = = 0) return(regs.x.ax); else return( - 1); } Memory Access 48 Allocate specified number of paragraphs memory Entry Parameters: AH = 48 BX = numb[...]

  • Page 58

    3 - 57 This page is blank.[...]

  • Page 59

    4 - 58 Chapter 4. Host ESC Commands 4. Host ESC Commands There are three classes of host communication activities: (1) Host Sends Control/Configuration Commands to the MR350MKII Almost all M R350MKII configurations and operations may be controlled by the host system via control commands. Configuration commands are used to set up system tables such [...]

  • Page 60

    4 - 59 restored from the Flash ROM.The hard reset command will not purge the program files that stored on Flash ROM The hard reset command does not have any parameter or value. The equivalent keypad invoking sequence is entering the supervisor mode and se lecting an initialization command. 2. Abort ( ESC A ) Abort is the "soft reset" comm[...]

  • Page 61

    4 - 60 6. Autoboot ( ESC O program name ) This command defines an autoboot program name in the MR350MKII. The autoboot program will be executed automatically each time the power is turned OFF and ON. 7. Password ( ESC P password ) To create or edit a supervisor password. 8. Get RAM size (ESC G) Get the MR350MKII total RAM size, program execution me[...]

  • Page 62

    4 - 61 15. Buzzer Volume (ESC N) This command can remote changing MR350MKII's buzzer sound. 16. Supervisor password (ESC P) This command can remote changing MR350MKII's buzzer sound. 17. Get terminal ID (ESC R) This commcand can get terminal ID. The default terminal ID is "MR350" 18. Get terminal ID and version no (ESC v) This c[...]

  • Page 63

    4 - 62 The new communication control table takes effect immediately after the ESC C command has been successfully received. The MR350MKII will reinitialize the corresponding communication port with its new parameters. For example, if ESC C instructs the RS - 232 port to change the baud rate from 9600 to 1200 the MR350MKII will switch to 1200 right [...]

  • Page 64

    4 - 63 For example, command ESC M 199009262345 will initialize the MR350MKII clock to September 26, 1990. The time is 11:45 PM. The MR350MKII reconfigures the real time clock chip as soon as the ESC M command has been successfully received. 4.3. File Transfer Commands 1. Download ( ESC L filename ) The download command is used to transfer a binary [...]

  • Page 65

    4 - 64 ADDR Terminal address (A - Y,0 - 6) + 80H CMD Network command to terminal, 2 bytes, A - F,0 - 9 CS1 Checksum, first byte CS2 Checksum, second byte The checksum is calculated by adding each byte of the transmission, ADDR, and l ength of data block (excluding STX and ETX). CS1 is high nibble (4 bits) +40H and CS2 is low nibble +40H. Example: C[...]

  • Page 66

    4 - 65 convert to 00 hex -- 1F hex convert to 80 hex -- 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 other codes unchanged Host Transmissions Transmission Format Poll STX, ADDR Host Data STX, CMD, data, CS1, CS2, ADDR Acknowledgment ACK Negativ[...]

  • Page 67

    4 - 66 => ACK - if data is received correctly, or NAK - if an error has occurred * The host sends a command to and receives a response from the terminal in one poll cycle; it then ackno wledges receipt of the terminal command response: => STX, CMD, parms, ... CS1, CS2, ADDR <= ACK - if data is received correctly and no response is required[...]

  • Page 68

    4 - 67 ESC 5 - Set multipoint address => STX ESC '5' <addr> CS1 CS2 ADDR where <addr> = 'A'~'Y','0'~'6' <= STX ESC '5' <Retcode> CS1 CS2 ETX where <Retcode>= 0x00 if set OK 0x01 error => ACK or NAK ESC 9 - Send diagnostic test data => STX ESC '9&apo[...]

  • Page 69

    4 - 68 ESC D - Read directory of RAM disk to host => STX ESC D CS1 CS2 ADDR <= STX ESC D <directory data> CS1 CS2 ETX (or NAK) => ACK or NAK ESC D/ROM - Read directory of Flash ROM to host => STX ESC D/ROM CS1 CS2 ADDR <= STX ESC D/ROM < directory data> CS1 CS2 ETX (or NAK) => ACK or NAK ESC E - Erase a file from the M[...]

  • Page 70

    4 - 69 ESC G/ROM - Get MR350MKII's Flash ROM size => STX ESC G/ROM CS1 CS2 ADDR <= STX ESC G/ROM <xxx> <zzz> CS1 CS2 ETX where <xxx>= number of Kbytes of total memory <zzz>= number of Kbytes of Free memory => ACK or NAK ESC H - Hard Reset and initiate power on test This command resets the MR350MKII terminal, an[...]

  • Page 71

    4 - 70 ESC K - Set keyboard locking => STX ESC K <state> CS1 CS2 ADDR where state = '0' set keyboard LOCK = '1' set keyboard UNLOCK = '2' set keyboard Partial LOCK <= STX ESC K <R etcode> CS1 CS2 ETX where Retcode = 00 if successful = 01 if not successful => ACK or NAK ESC L - Transfer file to MR35[...]

  • Page 72

    4 - 71 ESC O/ROM - Set auto-execution program on ROM => STX ESC O <program name>/ROM CS1 CS2 ADDR <= STX ESC O <Retcode>/ROM CS1 CS2 ETX where Retcode = 00 if successful = 01 if not successful => ACK or NAK ESC P - Set supervisor password (maxi. 8 characters) => STX ESC P <password> CS1 CS2 ADDR <= ACK or NAK ESC R [...]

  • Page 73

    4 - 72 => ACK or NAK ESC v - Get Terminal ID and version no => STX ESC V <devtable> CS1 CS2 ADDR <= STX ESC V < terminal_id and ver > CS1 CS2 ETX => ACK or NAK ESC X - Start program execution => STX ESC X <f ilename> CS1 CS2 ADDR <= STX ESC X <RetCode> CS1 CS2 ETX where <RetCode>: 00 if successfully s[...]

  • Page 74

    4 - 73 of $Txxxxxxxxxx.yyy, where xxxxxxxxx is the template ID and yyy is the template index. ==> STX ESC $D CS1 CS2 ADDR <== STX ESC $D RESULT CS1 CS2 ETX or <== NAK RESULT = ‘ 0 ’ ;success = ‘ 1 ’ ;fail = ‘ 2 ’ ;busy = ‘ 3 ’ ;timeout NAK means command format error or checksum error. For the host to get the MV1100 template[...]

  • Page 75

    4 - 74 ESC $E Erase Template The command erases the specified template on MV1100. ==> STX ESC $E xxxxxxxxxx.yyy CS1 CS2 ADDR <== STX ESC $E RESULT CS1 CS2 ETX or <== NAK xxxxxxxxxx ;template ID ( ‘ 1 ’ -- ‘ 4294967294 ’ ) yyy ;template index ( ‘ 0 ‘ -- ‘ 255 ’ ) RESULT = ‘ 0 ’ ;success = ‘ 1 ’ ;fail = ‘ 2 ’ ;bus[...]

  • Page 76

    4 - 75 ESC $G Enroll and Store Template on MV1100 () The command enrolls and stores the template with the specified ID on MV1100. ==> STX ESC $G xxxxxxxxxx CS1 CS2 ADDR <== STX ESC $G RESULT < ,QUALITY, CONTENT > CS1 CS2 ETX or <== NAK xxxxxxxxxx ;template ID ( ‘ 1 ’ -- ‘ 4294967294 ’ ) RESULT = ‘ 0 ’ ;success = ‘ 1 ’[...]

  • Page 77

    4 - 76 SCORE is an integer that has a range of ‘ 000 ’ – ‘ 100 ’ NAK means command format error or checksum error. For the host to verify against the template saved on its disk, it should issue ESC L command first to download the template to the MR350 MKII reserved file $FP.DNL and then issue ESC $H command to verify the fingerprint if ES[...]

  • Page 78

    4 - 77 = ‘ 1 ’ ;fail = ‘ 2 ’ ;busy = ‘ 3 ’ ;timeout NAK means command format error or check sum error. For the host to download the template saved on its disk, it should issue ESC L command first to download the template to the MR350 MKII reserved file $FP.DNL and then issue ESC $L command to download it to MV1100 if ESC L command is su[...]

  • Page 79

    4 - 78 THRESH = ‘ 1 ’ ,very high security = ‘ 2 ’ ;high security = ‘ 3 ’ ;medium security = ‘ 4 ’ ;low security = ‘ 5 ’ ;very low security NAK means command format error or checksum error. ESC $U Upload Template () The command uploads the specified template f rom MV1100 flash memory to the MR350 reserved file $FP.UPL . ==> ST[...]

  • Page 80

    4 - 79 If RESULT = ‘ 0 ’ , MR350MKII will response with the version field: Kx.xxxx Ay.yyyy where x.xxxx represents the version of the kernal and y.yyyy represents the version number of the algorithm. NAK means command format error or checksum error.[...]

  • Page 81

    5 - 80 Chapter 5. How to programning ? 5. How to to programming There are two major parts for programming – 1. Programming MR350 MKII and 2. Pr ogramming communication program between MR350 MKII and Host computer. The following topic describe application and utility library that will help users to develop quickly and efficiently for their applica[...]

  • Page 82

    5 - 81 5.1.1. Programming by JobGen PRO The JOB GENerator PROfessional (JobGenPRO) is an MS - DOS based software for developing applications for MR350MKII. With JobGenPRO, applicati on developers may create an application program easily by defining the transactions, attributes of data fields and operation flow without writing program code. An execu[...]

  • Page 83

    5 - 82 with all MR350MKII ? input/output devices. All detailed calling convention and source code are listed behind each BIOS/DOS call in Chapter 3 . For easily using this library, Unitech also provide sample program (350TEST.C) to help user to use it. So, user can directly modify th is sample program. All of those files are stored on sub - directo[...]

  • Page 84

    5 - 83 5.3. Contains of the Demo Disk Below table show whole content of Demo disk C function library for MR350 MKII programm ing 1) 350LIB.C/OBJ/H C library source/object/header files MR350 MKII 2) 350TEST.C/EXE Test program and source code for using C library C library for programming DOS base Communication program 1) 485COM.EXE/C Communication Ut[...]

  • Page 85

    5 - 84 Appendix A. Sta ndard C Libraries Routine for MR350MKII 1. Buffer Manipulation memccpy() memchr() memcmp() memicmp() memmove() memcpy() memset() movedata() 2. Character Classification and Conversion isalnum() isalpha() isascii() iscntrl() isdigit() isgraph() islo wer() isprint() ispunct() isspace() isupper() isxdigit() toascii() tolower() to[...]

  • Page 86

    5 - 85 9. Memory Allocation alloca() calloc() free() hall oc() hfree() mall oc() msize() real loc() sbrk() stackavail() 10. Porcess Control exit() 11.Searching and Sorting bsearch() l2ind() lsearch() qsort() 12.String Manipulation strcat() strchr() strcmp() strcmpi() strcpy() strcspn() strdup() strerror() stricmp() strlen() strlwr() strncat() strnc[...]