Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Losing data sent to Star 300 receipt printer.

Status
Not open for further replies.

tilltek

Programmer
Mar 8, 2001
298
PH
(FPD 2.6 on Win 98 SE Athalon 1200)
I've run into a bit of a "lost data" problem when printing to Star SP300 parallel printers.
In my POS program, I can print anything until I send the expanded print characters.
When these are sent, the print buffer is obviously wiped clean.
In testing I found that, if I do this....
******************************************
for x = 1 to 20

??? "1234567890"+chr(13)+chr(10)

next
******************************************
I get 20 perfect lines printed.

But if I do this......
******************************************
for x = 1 to 20

??? "1234567890"+chr(13)+chr(10)

next

*---- Double wide
??? chr(27)+chr(87)+chr(48)

*----- Double high
??? chr(27)+chr(104)+chr(48)

??? "Hello world"+chr(13)+chr(10)
******************************************
I get a lovely big "Hello world" but no "1234567890" (at all).

If I add in a delay....
******************************************
for x = 1 to 20

??? "1234567890"+chr(13)+chr(10)

next

wait window "" timeout 6

*---- Double wide
??? chr(27)+chr(87)+chr(48)

*----- Double high
??? chr(27)+chr(104)+chr(48)

??? "Hello world"+chr(13)+chr(10)
*****************************************
The whole lot prints just fine.

Is this perhaps a problem with the Star printer?
I've looked through the manual but can find no reference to it.

I have "time = 1000000" in config.fp but to no avail.

Just by the way, is there any way to slow down printer output besides "time =" in config.fp?

Thanks in advance.
Ken F


 
Hi

waitwindow "" timeout 6
This will lead you to problem.. if the user presses a key before timeout.
SO I suggest you can do this..

myReportHold = 6
mySec = SYS(2)
DO WHILE SYS(2) < mySec+myReportHold
** I am whiling myReportHold time seconds
ENDDO

If you buildup myReportHold as a public variable at the beginning of the myPrg, you can control and do such modifications on a later date very quickly.
:) ramani :-9
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
You might try shutting off print spooling on the printer driver setup, and set it to print directly to the port. I have had the same issue on similar type of printer where the buffer gets overwritten randomly. Also, make sure the baud rate and parity match on the port and printer.

Dave S.
 
Thanks Ramani, you're correct, I'll use a loop instead of a wait.

DsummZZZ, I don,t use windows spooling as it's very unpredictable time wise. It does not matter if the receipt is printed after 20 seconds or so, but the cash drawer opening after the user has left the counter is trouble.
I don't think baud and parity come into it on a parallel printer.
I think its the two expanded print codes that are wipping the buffer.
Ken F
 
Hi ya

you may find that it is your port settings,
we have the same problems with our POS system on some
older equipment aka 386sx25's and alike, is normally fixed with

(we use Dos 5.0,6.22)

AUTOEXEC.BAT

MODE COM1:9600,n,8,1

can change it down in speed to 300, altho the printer
preforms like a dog... i.e. MODE COM1:300,n,8,1

we use Star SP300, TSP300 and now little OKIPOS Series 80's

Also, our little receipts are foxpro reports, and printed
with set printer to com1/com2

think there are 3 reports to make the receipt
(kinda makes sense when you look at it)...

It works, and has been for a good 9 years now :)

Hope that helps

Zim
 
Zim, thanks for the input but I have a parallel printer here not serial. Most of our printers are serial and we do just as you say. We add a &quot;P&quot; to the mode command for printers that have no buffer.

To get around the problem I've had to put a delay loop (suggested by Ramani) in before switching print size.

I plan to look at the repors method you mentioned.

Ken F
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top