|
| Printing to serial ticketprinter |
| Iniciado por guest, 30,jun. 2017 12:08 - 5 respuestas |
| |
| | | |
|
| |
| Publicado el 30,junio 2017 - 12: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 |
| |
| |
| | | |
|
| | |
| |
| Publicado el 30,junio 2017 - 13:39 |
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 |
| |
| |
| | | |
|
| | |
| |
| Publicado el 30,junio 2017 - 13:53 |
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 |
| |
| |
| | | |
|
| | |
| |
| Publicado el 30,junio 2017 - 13:56 |
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 |
| |
| |
| | | |
|
| | |
| |
| Publicado el 30,junio 2017 - 14:10 |
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 |
| |
| |
| | | |
|
| | |
| |
| Publicado el 30,junio 2017 - 19:20 |
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. |
| |
| |
| | | |
|
| | | | |
| | |
|