Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
OPOS - choosing to use it or not
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Produits tierce partie
Divers
Thread ID:
00969562
Message ID:
00969861
Vues:
13
Hi Carl,

Your question’s timing couldn’t have been better (at least for me) as I’m facing very similar choices to yours, however, I am forced to go the “???” route for the time being because as my client does the transition from their existing system to the POS system I’m developing, the windows driver for the tm-t88 must stay in the machine.

After reading the same threads and newsgroups postings as you probably did, it seems like OPOS and the windows driver for the printer can’t coexist.

At first sight, I figured that the ??? route was simpler because I’m not doing anything too fancy with the receipts other than printing a graphic image (a logo) and a bar code.

One of the most frustrating aspects to developing POS systems is the secrecy that surrounds the technology involved (from the hardware to the protocols used for credit card authorization). Finding ANY information in this "industry" is a ROYAL PAIN IN THE EOF()!

I was able to find documentation on esc/pos, but getting the printer to do what I want, in spite of using all the right commands was an uphill battle that has taken me about 10 hours so far. The credit card portion of it will need to be addressed when I reach that stage.

Here are a few pointers you might need if your receipt is anything like most receipts out there…

One nice way to figure out how to print a logo is to take advantage of the windows driver (this trick was in a newsgroup). Set the driver to print to file, open the image (I’m assuming a black/white bmp) in MSPaint and print it. Then just open the resulting output file with a hex editor and you’ll get the secrets to printing graphics. I think the same principle could be applied to just about anything you need to send to the printer.

OK, on to the actual receipt...

The way I had it set up, I was sending all the output to a local variable and then outputting the contents of this variable with a single ??? command.

This worked wonderfully until I wanted to print a bar code in the same line as other data. This is impossible to do in Standard mode (the tm-t88 has standard and Page modes).

Page mode allows you to define the print area and put whatever you want wherever you want within this area.

Since a receipt’s length is never known in advance (well, you could, but I wasn’t about to go in that direction), the only choice I had was to print the Logo and Address portion of the receipt in Standard mode, then switch to Page mode to print the receipt No., date, and sales-person’s initials in a single line, and then back to standard mode to print the rest of the receipt.

All this sounded very simple, but it wasn’t.

My first attempt resulted in receipts with just the barcode and the bottom part. The logo and address were gone.

I did a bit more of internet scouring and came across what seemed like a manual for another esc/pos-compatible printer and came upon this bit of trivia:

“The E-3202 is not designed to accommodate continuous, unbuffered data streams while in PAPER
mode. Application programs or data streams that prohibit the E-3202 from processing interrupts
correctly may produce unexpected or unreliable results. If it is necessary to send a continuous
stream of data to the E-3202, the application program must provide a pause of 250ms (duration)
after every LINE of characters to allow the processor time to check for any possible error or fault
conditions.”

These printers are odd creatures, so I figured that I might be choking the poor thing by sending it all that data in a single ??? statement and, since I had nothing to loose at this point I changed my approach and it seems to be working fine. Here’s what I did:

Instead of sending the entire receipt in a single ???, I’m using several:

I construct the string for printing the logo and store address and print it (using ???).
Then a 1-second delay and I start constructing the variable that will hold the rest of the invoice (switch to page mode, print barcode line, switch to standard mode, and print the rest of the receipt, including the paper cutting).
Then I send the above to the printer (with another ???).

Finally, the clean-up is another part that needs special treatment.

I started by following some advice that Ed Rauh wrote here on the UT a few years back (Thanks Ed!!!).

Add the following after the printing’s over:
set printer off
set printer to
This will make sure that the print spooler is cleared. Otherwise, you end up with a file still showing up in there even though all the printing’s done and over with.

I hope this information is useful for you and others who will definitely face these challenges.

Have fun!

Alex


>Hi,
>
>I've read through as many threads as I could find on this topic and it appears that I need to decide on using OPOS only or not at all.
>
>I would like to invite opinions on the pros and cons of using OPOS. In particular I'd like to find out why one would decide against using it. This is my first serious look at working with receipt printers and I'd like to head down the right path first time round if possible.
>
>Thanks,
>
>Carl
Low-carb diet not working? Try the Low-food diet instead!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform