Sunteți pe pagina 1din 9

Data exchange protocol of Programming and Reporting line mode

General Description
This mode is designed for programming of names and parameters of articles, header and footer lines, department names and prices, operator names. In this mode the PC initiates the communication and the cash register checks data validation and stores it. If data is correct ECR returns ACK, else - ACK. The protocol allo!s follo!ing options" #. Programming of header and footer lines $. Programming of operator names %. Programming of names and prices of departments &. Programming of names and parameters of articles '. (ploading of graphical logo - )*P file +. Article report ,. -epartment report .. -ail/ 0 report 1. E2 report #3. 4* report The application developed 5/ Tremol ltd, !hich covers the entire functionalit/ granted 5/ this protocol is called ECR 6elper and can 5e found in the do!nload section.

Protocol description
Connection parameters:
Baud rate 9600 bps, 8 bits, no parity

Message format:
<marker><ECR number><command><information><crc><LF>

The e7act data fields, enclosed 5/ 8 and 9 are descri5ed in the follo!ing ta5le" Field Bytes Value marker # :tart of message ; al!a/s 37<< machine + A:CII =>nnnnnn>? ECR manufacture num5er num5er command # >a>..>@> command

information crc C4

A $ #

varia5le character length in range 37$3 .. 37.4 0BR over all 5/tes, including marker, formed in the follo!ing manner" 0BR over all 5/tes - the result is 5/te of t/pe 376C, !hich is converted to 37%6, 37%C. End of message - al!a/s - 373A

Ackno!ledgment format"

<type><mac ine number><crc><LF>

The e7act data fields, enclosed 5/ 8 and 9 are descri5ed in the follo!ing ta5le" Field Bytes Value t/pe # Ackno!ledgement t/pe ; 373+ D ACK =possitve?, 37#' D ACK =negative?, 373E D RETRF =reGuest re-sending of the command? machine + A:CII =>nnnnnn>? ECR manufacture num5er num5er crc $ 0BR over all 5/tes, including marker, formed in the follo!ing manner" 0BR over all 5/tes - the result is 5/te of t/pe 376C, !hich is converted to 37%6, 37%C. C4 # End of message - al!a/s - 373A Communication sequence: PC command H:TARTI ACK command HProgrammingI ACK Command HProgrammingI ACK ........................ ACK Command H:TBPI ACK #hort list of PC commands: command J ! o r / $alue :TART 6eader K footer line programming Bperator name programming Article programming -epartment programming Response !CR"

L f 4 M R 2 * @

-ail/ 0 report in te7t format Article report -epartment report Protocol version Cogo programming E2 report 4* report :TBP

PC Commands description
Command %start%:
<a>

data fields" a # 5/te command - >a> ECR response" ACK or ACK note" This command shall precedes all other commands. &eader ' Footer line programming: >!>
<!><"ine number><#0#><"ine contents>

data fields" ! line num5er >3> line contents # 5/te command - >!> # 5/te line num5er A:CII num5er >#> .. >1> - depends of ECR model >3> D received for further usage #.K%$N A:CII characters - depends of ECR model

ECR response" ACK or ACK (perator name programming" >O>


<o><operator number><name>

data fields" o # 5/te command - >o> operator num5er # 5/te operator num5er - A:CII num5er >#> .. >1> name #$K$3N 5/tes A:CII operator name - depends of ECR model

ECR response" ACK or ACK )rticle programming" >r>


<r><artic"e number><name><barcode><price><decima" point><$uantity> <ta% &roup><department><price 'L(E (')E><number 'L(E (')E>

data fields" r article num5er name 5arcode price decimal point Guantit/ ta7 group department Price SACTE TA0ET num5erSACTE TA0ET # 5/te command - >r> & 5/tes article num5er A:CII format - for e7ample I33#$%I %3 5/tes article name or IIIIIIIIIIII, if it is not programmed #$ 5/tes A:CII num5er or IIIIIIIIIIII, if it is not programmed . 5/tes price =!ithout decimal point? A:CII format or IIII, if it is not programmed # 5/te decimal point position - A:CII num5er >3> or >$> >3> D !ithout decimal point, sum D PPPPPPPP >$> D !ith decimal point, sum D PPPPPP.PP 1 5/tes Guantit/ A:CII format !ithout decimal point =decimal point is !ith fi7ed position ? - e7ample I#$%&'+,.1I D9 the Guantit/ is #$%&'+.,.1?Q or IIIIIIIIIIII, if it is not programmed 5/te ta7 group - >3> .. >&> or I if not programmed >3>,R'R - no ta7 >#> .. >&> - A,),C,# 5/te department num5er, or I if not programmed . 5/tes price =!ithout decimal point? A:CII format or IIII, if it is not programmed # 5/te num5er, or I if not programmed

ECR response" ACK or ACK Department programming: >/>


<y><department number><name><price><decima" point><ta% &roup>

data fields" / department num5er name price # 5/te command - >/> # 5/te department num5er

%3 5/tes department name or IIIIIIII, if not programmed . 5/tes price =!ithout decimal point? A:CII format or IIII, if it is not programmed decimal point # 5/te decimal point position - A:CII num5er >3> or >$> >3> D !ithout decimal point, sum D PPPPPPPP

>$> D !ith decimal point, sum D PPPPPP.PP ta7 group 5/te ta7 group - >3> .. >&> or I if not programmed >3>,R'R - no ta7 >#> .. >&> - A,),C,ECR response" ACK or ACK *ploading of graphical logo: >R>
<R><ima&e data>

data fields" R # 5/te command - >R> image data Image data in .)*P format !ith si@e $%3$ or %13$ 5/tes depending on the cash register model. )*P file !ith dimensions $$&7.3 or %.&7.3 pi7els, $ colors =# 5pp?. notice: !hen using command >R> it is not necessar/ to use #tart and #top ECR response" ACK or ACK Daily + and operator report in text receipt, li-e format: >L>
<*>

data fields" L # 5/te command - >L> note: It is not necessar/ to use Start and Stop commands .efore and after command /G/ ECR response" A:CII te7t data in format as -ail/ Report receipt. )rticle report: >f>
<f>

data fileds" f # 5/te command - >f>

ECR response"

<artic"e number><+><name><+><barcode><+><price !it dp><+> <ta% &roup><+>department><+><payment><+><sa"e sum><+><so"d $ty><+><,(- in stock><+><price 'L(E (')E><+><number 'L(E (')E><+><. b"ock>

note: Every data field is separated with ';' data fields" article num5er name 5arcode price ta7 group department pa/ment sale sum & 5/tes article num5er A:CII format - for e7ample I33#$%I %3 5/tes article name - A:CII format #$ 5/tes A:CII num5er 1 5/tes price !ith decimal point included - format UUUUUU.UU A:CII 5/te ta7 group - >3> .. >&> >3>,R'R - no ta7 >#> .. >&> - A,),C,# 5/te department num5er # 5/te pa/ment t/pe num5er - al!a/s >3> ## 5/tes accumulated through sales sum !ith decimal point - A:CII format. t/pe - UUUUUU.UU ## A:CII digits corresponding to the sold Guantit/ ## A:CII digits corresponding to the sold Guantit/ 1 5/tes price !ith decimal point included - format UUUUUU.UU A:CII

sold Gt/ Vt/ in stock Price SACTE TA0ET num5erSACT # 5/te num5er E TA0ET Department report: >4>
<F>

data fields" 4 # 5/te command - >4>

ECR response"
<number><+><name><+><price !it dp><+><ta% &roup><+> <department><+><payment><+><sa"e sum><+><so"d $ty>

note: Every data field is separated with ';' data field" num5er # 5/te department num5e

name %3 5/tes department name price 1 5/tes price !ith decimal point included - format UUUUUU.UU A:CII pa/ment # 5/te pa/ment t/pe num5er - al!a/s >3> ta7 group 5/te ta7 group - >3> .. >&> or I if not programmed >3>,R'R - no ta7 >#> .. >&> - A,),C,sale sum ## 5/tes accumulated through sales sum !ith decimal point - A:CII format. t/pe - UUUUUU.UU Command #top " >@> " end of communication
</>

data field" @ # 5/te command - >@> ECR response" ACK or ACK

CRC calculation
The CRC is calculated 5/ 0BR over all 5/tes, including marker, formed in the follo!ing manner" 0BR over all 5/tes - the result is 5/te of t/pe 376C, !hich is converted to 37%6, 37%C. CKCWW E7ample"
00 'ddCRC1 'dds CRC 2 E.3 marker to a command 4oid 'ddCRC5unsi&ned c ar6 cmd, unsi&ned int "en7 8 unsi&ned int i+ unsi&ned c ar %or 9 0+ for 5i 9 0+ i < "en+ i::7 %or ;9 cmd<i=+ cmd<i::= cmd<i::= cmd<i::= cmd<i= 9 9 5%or >> >7 ? 0%@0+ 00 Ca"cu"ate AB*A byte of CRC 9 5%or 2 0%0F7 ? 0%@0+ 00 Ca"cu"ate LCD byte of CRC 9 0%0'+ 00 'dd end marker 0+ 00 'dd /ero to make it /ero terminated

)uxiliary commands:
Command /0/ , information a.out the serial num.er
<0%FF><#G#><crc><LF>

The e7act data fields, enclosed 5/ 8 and 9 are descri5ed in the follo!ing ta5le" Field Bytes marker # comand # crc $ C4 # Value start of message - 37<< >A> 0BR over all 5/tes, including marker, formed in the follo!ing manner" 0BR over all 5/tes - the result is 5/te of t/pe 376C, !hich is converted to 37%6, 37%C. End of message - al!a/s - 373A

These five 5/tes are used to find out the presence of Tremol communication protocol, as !ell as finding out the serial num5er of the attached device. otice that the message format is differs from the standard format 5/ missing ECR serial num5er. ECR response" Field t/pe ECR um5er crc C4 Bytes # + $ # Value Response t/pe ; 373E D RETRF A:CII =>nnnnnn>? ECR serial num5er 0BR over all 5/tes, including marker, formed in the follo!ing manner" 0BR over all 5/tes - the result is 5/te of t/pe 376C, !hich is converted to 37%6, 37%C. End of message - al!a/s - 373A

This is the !a/ for the application soft!are to find attached cash register Tremol and its serial num5er.

Command /V/ , gets information for the protocol and soft1are $ersion and country of operation
<H>

fields" M # 5/te command - >M> ECR Response =onl/ information datafields?"


<H><protoco"><country><reser4ed><4ersion>

Field M protocol

Bytes # $

Value # 5/te >M> $ 5/tes protocol num5er in A:CII format digits for e7ample >%> and >$> D

countr/ reserved version

# # %3

%$ # 5/te countr/ =>)> for )ulgaria? # 5/te reserved for further use %3 5/tes te7t presentation of the firm!are version

Protocol $ersion: M'#) ; Tremol *3%, marker 37AA If the data in certain filed must 5e kept the same, the same num5er of I =Guotation marks? must 5e entered.
N

Values for !CR 1ith !2

3otes:

If the data in certain filed must 5e kept the same, the same num5er of I =Guotation marks? must 5e entered. This guarantees that the data !ill remain unaffected. The Guotation marks can>t 5e used for fields that define the command =for e7ample article - command >r>, or department num5er - command >/>?. Department num.er organi4ation 5 let denote department num5er !ith dep um. Then department num5er in the protocol is formed in the follo!ing !a/" if =dep um 8 #3? then dep um D dep um BR 37%3 else dep um D dep um BR 37.3

S-ar putea să vă placă și