Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
6
Erster Beitrag:
vor 6 Monaten, 3 Wochen
Letzter Beitrag:
vor 6 Monaten, 3 Wochen
Beteiligte Autoren:
willy hermans, Tor-Bjarne, Fabrice Harari, kingdr

Printing to serial ticketprinter

Startbeitrag von willy hermans am 30.06.2017 10:08

Hello,

I have build a pos system that print tickets to a serial printer. It works fine.

I also have to print a E-Rport. It is a financial report. It is logger then most of the tichets.

The com port is well configured. The Z-report prints fine at my testplace.

At several clients there are wholes in the Z-Rapport. It means that there are for example 15 lines printed. Then there is a Gap of n lines. Then the rest of the report is printed. Several lines are not printed.

I've tried it with different buffersizes.

This is the code

PROCEDURE ZRapport()

nLijnen is int = TableCount(WIN_XRapport.TABLE_XRapport)
nRest is int = 0

OpenPoort()
TableSelectPlus(WIN_XRapport.TABLE_XRapport,TableCount(WIN_XRapport.TABLE_XRapport))
FOR nLus = 1 TO nLijnen
SWrite(Port_E,WIN_XRapport.TABLE_XRapport[nLus].COL_Text+cLineFeet)
END
sWrite(Port_E,cLineFeet4)

sWrite(Port_E, cCutter)
SluitPoort()

Extra question.
Is it always nescesarry to use sParameter().
When the port is correct configured, I think it is not nescesarry to use sParameter()

Thanks

Willy Hermans

Antworten:

Hi Willy

from your description, it looks like you are sending the data too fast for the printer, filling it's buffer, and therefore loosing what cannot fit into the printer buffer...

So, a simple solution would be to add a multitask(10) inside your loop and test till you get the right waiting value/time.

Best regards

von Fabrice Harari - am 30.06.2017 11:39
Hi

Using sParameter to warrant the print settings, I could guess
it might be related to hardware default setting/firmware version/fonts/
margin/print gap for every new line...
(could be different even the same model shipped by different suppliers
that they modified and not telling you behind the scene)
windows o/s (32/64) or wd version...

HTH

King

von kingdr - am 30.06.2017 11:53
Thanks,

In my test config it works always.

The clients have the same configuration. Same PC, same printer.

At most clients it works. At some clients it does not. And even then. When they try it several times it works now and then.

I've changed the code to

FOR nLus = 1 TO nLijnen
sWrite(Port_E,WIN_XRapport.TABLE_XRapport[nLus].COL_Text+cLineFeet)
Multitask(10)
END

I hope there will not be great differences with different clients.

Thanks.
Willy Hermans

von willy hermans - am 30.06.2017 11:56
Hi,

This what the Handshake XOn/XOff is made for.

Set you printer and serial port to support Xon/XOff and the printer will send a XOff when it reaches 90% of the input buffer and you serial port will stop sending, and when the printer is ready to receivie again printer send XOn and your serial port starts sending data again.
This is automaticly.


I suspect a problem with multitask, that is that it can take different length in the "pause" as to what speed the PC supports, so eventually you can run into problems if customer upgrade their hw.

Bye the way did you get you scale to work?

Cheers
Tor-Bjarne

von Tor-Bjarne - am 30.06.2017 12:10
Hello,

No the scale does not work, but it seems to be a very difficult one. We are started today with new one.
And this one works after a few minites with hype!Terminal.
So we are very hopefull.

Thanks.
Willy Hermans.

von willy hermans - am 30.06.2017 17:20
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.