Predmet:Re: Fiskalna kasa
Moj problem je sto ne vidim ovaj, serijski port com3, kad citam portove. u control panelu se javlja kao unspecified ali u device manager-u kao com3. Pisao sam kojesta ali opet nema odgovara; a izgleda jednostavno. U prilogu je neko uputstvo za ovu kasu.
2. Protocol Description QPrint
2.1. Low Level Protocol
Interface Protocol Level 2 – Record Transport
The protocol knows 2 types of records – data records and answer records. Every data record is answered by the receiver with an answer record.
Used Control Characters:
STX = 0x02
ETX = 0x03
ACK = 0x06
DLE = 0x10
NAK = 0x15
General Layout of a Data Record:
DLE STX Command Data DLE ETX CRC High CRC Low
Notes:
- DLE STX is the start of the record.
- DLE ETX is the end of the record.
- The CRC is a CRC-16 calculation according to 8005 Poly (x16+x15+x2+1).
Appendix A.
- When the Data Field contains DLE it is sent as DLE DLE.
- Data is a command as described under “High Level Protocol”.
A Positive Answer Record
DLE STX ACK Error State of the Printer DLE ETX CRC High CRC Low
A positive answer record is always sent if the CRC of the received data record is correct. Any error beyond this is indicated by the two status bytes. If the control unit processed the data record correctly, the status is 0x00. For the list of status values see appendix C. If multiple errors occur only the first error is reported.
A Negative Answer Record
DLE STX NAK DLE ETX CRC High CRC Low
2.2. High Level Protocol
General description
The Data section starts always with the letter 'F' (Hex 0x46, decimal 67). Field0 follows immediately without a separator. It indicates the command. Additional fields can follow and are separated by semicolon. Required fields contain at least one character, optional fields can be empty. It is not necessary to transmit trailing empty fields. (Examples see appendix B)
Data Types
Numeric: ASCII characters ‘0’ … ‘9’ (hex 0x30 … 0x39, decimal 48 … 57)
Alpha: Any character larger than or equal SPACE (hex 0x20, decimal 32)
Amount: ASCII characters ‘0’ … ‘9’ (hex 0x30 … 0x39, decimal 48 … 57), maximal 1 decimal point (hex 0x2E, decimal 46), optional 1 minus (hex 0x2d, decimal 45). Amounts have always an accuracy of two decimal places. Negative amounts are preceded by a minus. Optional zero values can be presented by an empty field. Suppress leading zeroes if the amount is larger than 99 Öre. If the amount is less than 1 Crown, it is allowed to have a leading zero before and after the decimal point. But you can suppress any leading zero and the decimal point. (Examples see appendix B)
Percentage: ASCII characters ‘0’ … ‘9’ (hex 0x30 … 0x39, decimal 48 … 57), maximal 1 decimal point (hex 0x2E, decimal 46). Percentages have always an accuracy of two decimal places. Optional zero values can be presented by an empty field. Suppress leading zeroes if the percentage is larger than 0. 99%. If the amount is less than 1%, it is allowed to have a leading zero before and after the decimal point. But you can suppress any leading zero and the decimal point. (Examples see appendix B)
2.3. Available Commands
2.3.0. Status QPrint (CMD_STAT):
Field Example Description byte Data type
1 F0 Answer with Status QPrint 2 Alpha Required
2 1 Clear the last error Up to 4 numeric Optional
2.3.1. Non Fiscal Commands
Note: - The no fiscal document must begin always with the command “CMD_NF_OPEN” and end with the command “CMD_NF_CLOSE”. Between these commands can be any numbers of text lines (command “CMD_PRINT_TEXT”). It is not allowed a fiscal command when is opened a no fiscal document.
2.3.1.1. Open a Non Fiscal Document (CMD_NF_OPEN):
Field Description byte Data type Note
1 F1 Non Fiscal Document 2 Alpha Required
2 1 Open the Non Fiscal Document Up to 4 numeric Required
Bsp. TX -> F1;1 // Print Non Fiscal Header
RX <- [ACK][0]… [0]
2.3.1.2. Close a Non Fiscal Document (CMD_NF_CLOSE):
Field Description byte Data type Note
1 F1 Non Fiscal Document 2 Alpha Required
2 2 close the Non Fiscal Document Up to 4 Numeric Required
Bsp. TX -> F1;2 // Print Non Fiscal Footer
RX <- [ACK][0]… [0]
2.3.1.3. Print Non Fiscal Text in Non Fiscal Document (CMD_PRINT_TEXT):
Field Description byte Data type
1 F1 No Fiscal Document 2 Alpha Required
2 3 print non fiscal data line (line-by-line) Up to 4 Numeric Required
3 “Non Fiscal Text” Text between “ …” 128 Alpha Optional
Bsp. TX -> F1;1 // HEADER
RX <- [ACK][0]… [0]
TX -> F1;3;"===========" // ===========
RX <- [ACK][0]… [0]
TX -> F1;3;"12345678901" // 12345678901
RX <- [ACK][0]… [0]
TX -> F1;3;"===========" // ===========
RX <- [ACK][0]… [0]
TX -> F1;2 // FOOTER
RX <- [ACK][0]… [0]
2.3.2. Fiscal Commands
2.3.2.1. Open a Fiscal Receipt (CMD_FS_OPEN):
Field Example Description byte Data type
1 F2 Fiscal Document 2 Alpha Required
2 1 Open the Fiscal Document Up to 4 numeric Required
3 0 / 3 0 – normal (default) / 3 - refund Up to 4 numeric Optional
4 1
2 1 – Coupon of Invoice (Albania)
2 – Special version Bangladesh Up to 4 numeric Optional
5 “123”
21111 Number of Invoice (Albania)
Number of Receipt (Rfd-Bangl.) Up to 25
Up to 6 Alpha
numeric Optional
6 01062009 Date of Receipt (Rfd.-Bangladesh) Up to 8 numeric Optional
Note: The Header are printed with the first Item