Unitech MR350MKII manual 3F Read file, Write file

Page 54

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_file(int hdl,int cnt,char *str)

{

segregs.ds = FP_SEG(str); regs.x.dx = FP_OFF(str); regs.h.ah=0x3f; regs.x.cx=cnt; regs.x.bx=hdl; int86x(0x21,®s,®s,&segregs);

if ((regs.x.cflag & 0x01) == 0) return(regs.x.ax); else return(-1);

}

40Write file

Copy (CX) bytes from DS:DX to file (BX). Update BX current address and ending address. If CX is assigned with 0 (zero), the system will truncate the file from the current file pointer position. This function can be used by MSC function call chsize().

Entry Parameters:

AH = 40

 

BX = file handle

 

CX = number of bytes to write or 0

 

DS:DX = segment:offset of buffer area

Returned Values:

if successful: Carry = clear,

 

AX = number of bytes read, 0 if full

 

if fail: Carry = set, AX = 6

int TS_write_file(int hdl,int cnt,char *str)

{

segregs.ds = FP_SEG(str); regs.x.dx = FP_OFF(str); regs.h.ah=0x40; regs.x.bx=hdl; regs.x.cx=cnt; int86x(0x21,®s,®s,&segregs);

3-53

Image 54
Contents Programming Reference Manual September 2001Introduction Table of Contents RS-485 port serial I/O using General Control Commands Error! Bookmark not defined System Kernel Application Programming InterfaceKeypad Subsystem Display SubsystemCommunication Subsystem Point to point modeMulti-point mode Real time clock subsystem? MS-KermitSEND file name Download Program in Point-to-point modeBar code / Magnetic stripe / Proximity / ICC ? MS-KermitGET file nameDownload Program in Multi-point mode COM1-4?Then, the screen will display MR350MKIISet beepers volume Page Device Control Table DevconfigData Structure Type DefinitionBarcodeconfig Barcode Control TableType Definition Byte ComconfigCommunication Control Table of Host port WordTerminal Control Table available for host port only Page Page Clear screen O Function CallsLCD Display INT 10H Set cursor type1A Enable/disable LCD Backlight INT 21H Get cursor positionScroll screen Communication Environment Setup 1C Select COM1 or COM2 as the host portXON/XOFF Set host port protocol1C Set serial port flow control CTS/RTSSet COM1 port as RS485 or modem 1C Setup multi-point address1C Set polling timeout duration Host Port for Multi-point Protocol I/O INT21HRead host port Output dataCheck if Busy-port RS-232 port serial I/O using INT 34H Serial I/O for RS-232 and RS-485Input data Disable RS-232 port Set Communication parametersBIT # Page Set RTS signal of RS-232 port Read CTS signal of RS-232 portRS-485 port serial I/O using INT 33H Enable RS-485 port for serial I/O Disable RS-485 port for serial I/OInt860x33,s,s Open RS-485 multi-bus to send out data Close RS-485 multi-bus release RS-485 bus Read Photo Coupler Level state INT 08H Relay Output / Digit Input / Buzzer / LED IndicatorSet LED indicator ON/OFF LOWClose Activate/Deactivate Relay ports INT 09HOpen 1A Buzzer On/Off1A Set buzzer volume Alarm On/OffGet Security state 21H Enable/Disable External reader port Internal/ External reader Port INT 21HRead Internal port CodabarEnable/disable Internal reader 1F Get Decoder status of Wiegand Format Proximity reader EAN/UPC 1F Enable the decoding of a barcode symbology1A Check lithium battery level Miscellaneous INT 21H1B Get Address ID of the terminal Set interrupt vectorGet interrupt vector Get free disk cluster 1E Change the Keyboard mapAscii code corresponded to scan code in Numeric mode Ascii code vs. scan code cross reference table numeric modeAscii code corresponded to scan code in Alphabetic mode DOS ManagerWrite stdout Read stdaux COM2 RS-232 port Write stdaux COM2 RS-232 portRead / Write stdin or return 0 if none is ready Read stdin wait if no key Write character string to stdoutDate/Time 0A Keyboard buffer inputKeyhit check 2A Get System dateSet System date 2C Get System clock2D Set System clock File Manager3C Create or truncate file 3D Open file Close file3F Read file Write fileDelete file Move file pointerGet file attribute Rename a fileFree allocated memory Modify allocated blockThis page is blank Host ESC Commands General Control CommandsExecute Flash ROM program ESC X/ROM filename Abort ESC aExecute ESC X filename Directory ESC DDisable UPS battery ESC F Autoboot ESC O program namePassword ESC P password Get RAM size ESC GConfiguration Commands Device Configuration ESC Barcode symbology Configuration ESC BDate/Time Configuration ESC M Upload ESC U filename File Transfer CommandsDownload ESC L filename Multipoint ProtocolCS2 CMDCS1 STX ESC L a . E X E CS1 CS2 AddrHost Transmissions Terminal TransmissionsProtocol Operation Commands ESC 0 Application dataSTX ESC ESC B Enable/disable the decoding of barcode symbologies ESC 9 Send diagnostic test dataESC a Soft Reset, Restart, or Abort ESC C Write communication configuration table to MR350MKIIESC D/ROM Read directory of Flash ROM to host ESC F Disable UPS battery to supply powerESC D Read directory of RAM disk to host ESC E Erase a file from the MR350MKII directoryESC I Get filename of current executing program ESC H Hard Reset and initiate power on testESC G/ROM Get MR350MKIIs Flash ROM size ESC J Check if file existed or notESC L Transfer file to MR350MKII ESC N Set Buzzer VolumeESC K Set keyboard locking ESC M Write date and time to MR350MKIIESC V Write device configuration table to MR350MKII ESC P Set supervisor password maxi charactersESC T Write terminal configuration table to MR350MKII ESC O/ROM Set auto-execution program on ROMESC X Start program execution ESC Commands Added for MV1100 Fingerprint ModuleESC v Get Terminal ID and version no ESC X Start program execution on ROMSTX ESC $D CS1 CS2 Addr STX ESC $D Result CS1 CS2 ETXNAK Result STX ESC $E Result CS1 CS2 ETX NAK STX ESC $F Result QUALITY, Content CS1 CS2 ETX NAKESC $E Erase Template ESC $F Enroll and Store Template on MR350 MkiiESC $G Enroll and Store Template on MV1100 ESC $H Verify TemplateESC $I Verify ID ESC $L Download TemplateESC $S Set Globe Threshold ESC $S Get Globe ThresholdESC $U Upload Template ESC $V Get VersionPage How to programning ? Programming MR350 MkiiProgramming by JobGen PRO Programming by C/C++Programming communication program Contains of the Demo Disk Data Conversion Buffer ManipulationCharacter Classification and Conversion File HandlingString Manipulation Memory AllocationPorcess Control exit Searching and Sorting MS-DOS Interface