Text preview for : README.TXT part of relisys te988-rv circuit board layout



Back to : README.TXT | Home



Notes( TOOLs version 1.00)

1). PC-ECR network

Our PC-ECR network is star mode, and user can link 16 ECRs in
the network( with two EHTC 8-serialport cards). If user don't
have EHTC 8-serialport card, user can use standard serialport
like COM1 to COM4( provided by PC),but then can only link one
ECR to PC and this ECR is called ECR1 by communication TOOLs.

Users are recommended to get two EHTC cards to make the most of
our network.

2). Cable

Our ECR has a 25-pin female connector, user can link it with
PC's 25-pin male connector directly. If the distance between
PC and ECR is rather long, a cable is needed.

The cable only need 3 lines (RS232-c: RXD,TXD and GND), and it
should be fixed as the following way:

-- -- -- --
-- / | | \ --------- == == --------- / | | \ --
| | | |
-- \ | | / --------- == == --------- \ | | / --
-- -- -- --

25-pin Male a cable 25-pin Female
connector from PC connector from ECR
||
||
||
\/
---- ----
| \ line 1(TXD) / |
| pin2 --------------------------- pin2 |
| line 2(RXD) |
| pin3 --------------------------- pin3 |
| line 3(GND) |
| pin7 --------------------------- pin7 |
| / \ |
---- ----


The length of cable can be 100 meters (with twisted line cable) or
more ( with whole braided shield cable).

3). Example

We provide an example in this TOOLs, the ECRtype ECR12xx is a pre-
set ECRtype as an example, and also some other config settings (e.g.
COM1 with <9600,E,8,1> settings) and ECR settings ( e.g. plu,dep,
systemflag... settings of ECR12xx) are provided.
You can modify these settings, add/delete types as you wanted.

Note: when you add ECR type, you will be asked to input the Plu,
Dep,Clerk,Group numbers. The Department-number is maximum
department-number+coupon+FCEitem( if you ECR has, e.g. if
your ECR has 40 departments and a coupon and a FCE item,
the department-number will be 42.)


4). BGI files

We provide ".bgi" files to support this TOOLs running in Graphic
mode, if your video monitor is EGA/VGA, it is very good to run in
Graphic mode. To copy egavga.bgi file to TOOLs's directory will
make TOOLs run in Graphic mode.
While you have a Hercules monitor, it is better to run this TOOLs
in text mode. Don't copy herc.bgi to the TOOLs's directory will
ensure the TOOLs run in text mode.

5). Mouse

Users are highly recommended to use a mouse in TOOLs. Since diffe-
rent mouse manufacturers provide several kinds of mouse drivers, in
our tests, we found a few mouse drivers are not suitable completely
in our TOOLs.If you find the mouse can't work normally in the TOOLs,
you 'd better to use keyboard in TOOLs.

6). Operation of ECR

During PC-ECR communication, the control lock of ECR must in X report
Position, and press the Receipt On/Off key, then the ECR is ready
for communication, includes reporting and programming. When the
communication is over, you will press any key to exit.


Protocol of PC-ECR communication

1). Hardware:

The communication protocol supports full duplex asynchronous
communication with both RS232-c and RS422 standard. Datarate
supports 38.4k,19.2k,9600,4800,2400,1200 and 300bps( for the
time being, the default datarate is 9600bps.). RS232 uses 3
line cable(input,output and ground line ), RS422 uses double
cable( differential input and output lines). Since ECRs now
we provided only support RS-232,and the parameters set is
< 9600,E,8,1 >, PC should choose the corresponding settings.

The mode of this network is star mode.

2). Software Protocol

The software protocol includes Data Packet Protocol and Data
Procedure Protocol, for the reliabilities of the network, we
make this protocol simple and concise.

1. Data Packet Protocol

1>. Format of Data Packet

----------------------------------------------------------
FE FE FE FE FE FE | Type | Length | Data | FCS
----------------------------------------------------------
6 bytes |1 byte| 2 bytes| length bytes| 2 bytes
----------------------------------------------------------
Packet Head PktType PktLeng PktData Chksum

Note:
a). PktType describes the kind of PktData.
b). PktLeng is the length( in bytes) of PktData.
c). Chksum is PktType+PktLeng+PktData 's sum .

2>. PktType

There are four types of PktDatas, we use PktType to describe
them.

a). ECRTYPE ( 0x64) -- PC --> ECR.

PC tells ECR the current type.
--------------------------------------------------------------
FE FE FE FE FE FE | 0x64 | 06 00 | PktData | Chksum
--------------------------------------------------------------

PktData is 6 bytes long, it is plunumber depnumber clerknumber
2 bytes 2 bytes 2 bytes


b). TYPE ( 0x65) -- PC --> ECR.

PC tells ECR what the next procedure is.( e.g. sysflag setup)
--------------------------------------------------------------
FE FE FE FE FE FE | 0x65 | 01 00 | PktData | Chksum
--------------------------------------------------------------

PktData is 1 byte long, it can be:
LOGO -- 01, means next setup item is Logo.
SYSFLAG -- 02, means next setup item id system flag.
CLERK -- 03, ...
PLU -- 04, ...
DEP -- 05, ...
TAX -- 06, ...
USATAX -- 07, ...
RECV -- 08, means PC want to receive a report.

c). ECHO ( 0x66) -- PC <--> ECR.

Tell the partner whether the last Pkt is received successfully.
--------------------------------------------------------------
FE FE FE FE FE FE | 0x66 | 01 00 | PktData | Chksum
--------------------------------------------------------------

PktData is 1 byte long, it can be:
ECHO_OK -- 104, ACK signal echo to sender.
ECHO_ERROR -- 105, NACK signal echo to sender.

d). TEXT ( 0x67) -- PC <--> ECR.

The setup or report contents.
---------------------------------------------------------------
FE FE FE FE FE FE | 0x67 | PktLeng | PktData | Chksum
---------------------------------------------------------------

The PktLeng is the length of PktData.

2). Data Procedure Protocol

1>. Setup procedure

PC ECR
StartID(0x63)
------------->
ECRTYPE
------------->
ECHO_OK
<=============
TYPE
------------->
ECHO_OK
<=============
TEXT
------------->
ECHO_OK
<=============

2>. Report procedure

PC ECR
StartID(0x63)
------------->
ECRTYPE
------------->
ECHO_OK
<============
TYPE
------------->
ECHO_OK
<=============
TEXT
<=============
ECHO_OK
------------->


Appendix

1). About ECHO_ERROR.

If receiver send ECHO_ERROR to sender, sender will retry 3
times. While it still failed, ECR will reset the Send/Recv
procedure and return to the begin of procedure( Prepare to
receive StartID from PC).

2). Important Data Structure.

If you want to user this protocol to handle EBM ECR serials,
please note that the important data structures must be the
same as we defined in ECR farmware.

1>. Setup Data Structure.

typedef struct TYPEInfo {
char Typefilename[80] ;
char Typename[9] ;
int Plunumber ;
int Depnumber ;
int Clerknumber ;
int Groupnumber ;
int DeleteID ; // DeleteID = 0 means is available
} TypeInfo, *TypeInfoRef ;


typedef struct LOgo {
char headerlogo[6][18] ;
} Logo, *LogoRef ;

typedef struct SYSTEMFlag {
char datemode ;
char taxmode ;
char sysdots ;
char ROffSplet ;
char ROffTax ;
char ROffDisc ;
char HdPrint ;
char TaxCalMode ;
char masterTL ;
char Zprn ;
char RstCon ;
char day ;
char month ;
char year ;
char hour ;
char minute ;
char second ;

char timeMode ;
char machineNo ;
char fdnum ;
char qcflag ;

int con_number ;
int clerkcode[6];
int servicecharge;
int discount ;
} SystemFlag,*SystemFlagRef ;

typedef struct PLUFrame {
char deptlnk ;
char flag ;
long price ;
char pluname[13] ;
} Pluframe, *PluframeRef ;

typedef struct DEPFrame {
char flag1 ;
char flag2 ;
char group ;
long price ;
char depname[13] ;
} Depframe, *DepframeRef ;

typedef struct CLERKFrame {
char clerkname[11] ;
} Clerkframe, *ClerkframeRef ;

typedef struct TAXCTL {
long taxTbl[4] ;
long VATtaxtable[4] ;
} TaxCtl, *TaxCtlRef ;

typedef struct USATAX {
char clear ;
char IrregularCount ;
char RegularCount ;
long taxlimit ;
char Breaks[160] ;
} USATax, *USATaxRef ;

2>. Report Data Structure.

typedef struct ClerkReport {
long salecount ;
long sum ;
long taxablecount ;
long taxsum ;
char clerkname[11] ;
} ClerkRpt , *ClerkRptRef ;

typedef struct DepReport {
long quantity ;
long amount ;
char group ;
char depname[13] ;
} DepRpt, *DepRptRef ;

typedef struct REPORT {
long subTotal; /* subtotal, also net total */
long vdTotal; /* void total */
long vdCnt; /* void count */
long dcTotal; /* discount total */
long dcCnt; /* discount count */
long scCnt; /* service charge count for department report */
long scTotal; /* service charge total for department report */
long rfTotal; /* refund total */
long rfCnt; /* refund count */
long cpTotal; /* coupon total */
long cpCnt; /* coupon count */
long caTotal; /* cash-in total */
long caCnt; /* cash-in count */
long ckTotal; /* check-in total */
long ckCnt; /* check-in count */
long chTotal; /* charge-in total */
long chCnt; /* charge-in count */
long raCash; /* RA in cash */
long raCashCnt; /* RA in cash */
long raCheck; /* RA in check */
long raCheckCnt; /* RA in check */
long poTotal; /* paid-out total */
long poCnt; /* paid-out count */
long ckdTotal; /* check in drawer */
long chdTotal; /* charge in drawer */
long cadTotal; /* cash in drawer */

long Card1Total; /* card1 in total */
long Card1Cnt; /* card1 in count */
long raCard1; /* RA in card1 */
long raCard1Cnt; /* RA in card1 count*/
long Card1dTotal; /* card1 in drawer */

long Card2Total; /* card2 in total */
long Card2Cnt; /* card2 in count */
long raCard2; /* RA in card2 */
long raCard2Cnt; /* RA in card2 count*/
long Card2dTotal; /* card2 in drawer */

long opendrawercnt; /* open drawer count */
long deptTotal; /* sale total with department */
long pluTotal; /* sale total with plu */
long Staxable[4]; /* gross total of tax 1--4 */
long Stax[4]; /* Tax 1 -- 4 total */
long taxCnt[4]; /* receipt count of tax 1--4 */
ClerkRpt clerk[6]; /* clerk report data */
DepRpt deptrpt[41]; /* deparment report data */

}Report, *ReportRef ;

typedef struct HourReport{
long salecount;
long sum;
} HourRpt, *HourRptRef ;

typedef struct PLURep {
char deptlnk ;
char flag ;
long price ;
long quantity ;
long amount ;
char pluname[13] ;
} Plurpt, *PlurptRef ;

3> file format

1/. "system.dat"
int typenumber
PARPORT parallelport
SerInfo Serinfo
TypeInfo Typeinfo[MAX_TYPE]

2/. "ecrxx.dat"
TypeInfo typeinfo
Logo logo
SysFlag sysflag
Clerkframe clerk[]
Pluframe plu[]
Depframe dep[]
TaxCtl tax
USATax USAtax[3]

3/. "ecrxx.rep"
int plunumber
Plurep plurep[]
HourRpt Hourrpt[MAX_HOUR]
Report report_day
Report report_month