I have tried using set printer to com2 etc - but no luck.
I am at a loss for what seems to me to be a simple job.
Any help would be greatly apprecieted
Despite FPW2.6 help saying it cannot be done,
I have had some success with the following code :
** assign value 'COM1' or 'COM2' to nComport
cashdrawer = FOPEN(nComport,11) && write, unbuffered
IF cashdrawer = -1
WAIT WIND NOWAIT 'Cannot Open Cash Drawer'
RETURN
ENDIF
writeok = FWRITE(cashdrawer,'@') && any char should do
IF writeok = 0
WAIT WIND NOWAIT 'Cannot Open Cash Drawer'
ENDIF
=FCLOSE(cashdrawer)
Somtimes, though I get an error ' Cannot write to device COM2'
Can anyone help ?
Andrew,
Let's see, the documentation says it can't be done, and it sometimes doesn't work <humm>. I think you'd simply be glad when it does!
Remember that most (all?) BIOS/motherboards piggyback the COM1/COM3, and COM2/COM4 interrupts, so if you've cot something assigned to COM4, it may be causing problems on COM2.
Thanks for that,Rick - I've had a look at the configuration of ports of 4 different machines and tried removing some or all of them (interestingly I can disable a port and yet still open it though not always write to it ) and checking piggy backing of interrupts, drivers, resources etc etc and still get inconsistent results. On 1 machine, no matter what I do, I can write successfully every time, other machines may let me open a port but won't write to it. It seems there IS a consistency with different flavours of FoxPro though - If it won't work in FPW26, it won't work in FPDOS25 OR VFP6. Still a bit of a mystery. I'll keep trying.
Andrew
Ok, here is a bit of code out of our invoicing module
for firing a cash draw... (foxpro for dos)
Fires 2 Different ways.... If cm_getreg("POS" = "O"
is firing though an OKIPos 80 Thermal receipt printer
and the other is firing though a star receipt printer..
(star SP300's & TSP 300's) or via a com kicker... note: com kickers seem to need a charge before going into fox.... i.e. in the autoexec.bat echo ^G> COM1 or something like that to do the first fire...
also you may need to set the com port speed up using the
mode command in dos... (don't know if it is needed for the
cash draw but is needed to print to our receipt printers)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.