dbTalk Databases Forums  

Answer from printer?

comp.databases.pick comp.databases.pick


Discuss Answer from printer? in the comp.databases.pick forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
[Viajero] Milan Banjanin
 
Posts: n/a

Default Answer from printer? - 02-27-2006 , 10:47 AM






Hi. D3/NT problem:I have to send a secuency of commands to a serial
printer, and i have to receive an answer from this printer, indicating
some error code. How I can do this thing?. If i define a serial
printer, itīs only for send commands, not for receive, i supose.
Regards


Reply With Quote
  #2  
Old   
Tony Gravagno
 
Posts: n/a

Default Re: Answer from printer? - 02-27-2006 , 10:08 PM






"[Viajero] Milan Banjanin" wrote:

Quote:
Hi. D3/NT problem:I have to send a secuency of commands to a serial
printer, and i have to receive an answer from this printer, indicating
some error code. How I can do this thing?. If i define a serial
printer, itīs only for send commands, not for receive, i supose.
Regards
(Hope I'm understanding this and not over-complicating it.)

Seems to me the only way to do this is to have the exchange with the
printer as any serial device, then when you're ready to print, start
the printer for printed output. Detach the printer when done for the
next round. If this is the approach you want to take then write or
find a program to have the exchange with the serial port, and then
call that from D3. If the printer is on a client PC then you can
probably use AccuTerm. The approach is different depending on the
environment.

What kind of printer is this (specific brand/model)? I'm guessing you
want to send some ESC codes to get a status report?

If you want this done for you I may be able to write the code on a
consulting basis.

HTH
Tony
TG@ removethisNebula-RnD.com


Reply With Quote
  #3  
Old   
[Viajero] Milan Banjanin
 
Posts: n/a

Default Re: Answer from printer? - 02-28-2006 , 08:46 AM



Thanks Tony. The printer is EPSON TMU220AF, serial conected , with a
special prom-firmware installed, that "converse" with the host, in a
special way. Here in Venezuela, itīs used for TAX porpuse. When the
host send the codes that prints a invoice, the printer "answer" with
one or more bytes indicating if itīs positive or negative (in a TAX
way).
Example or a conversation (in hex):
Host: Sell 1 Apple with a 14% Tax
02 (STX) 21 42 1C
Apple 1C
1000 1C
10000 1C
1400 1C 03 (ETX)
Printer answer: Indicating that itīs correct
02 (STX) 21 42 1C
1000 1C
0000 1C 03 (ETX)

The host have to read the answer from the printer, before continue
printing. If the printer say "negative", then have to stop procesing,
and display an error message.
The PCīs conected use ACCUTERM.
Regards.
Milan Banjanin
mbanjanin (AT) sistemasarrakis (DOT) com


Reply With Quote
  #4  
Old   
Lucian
 
Posts: n/a

Default Re: Answer from printer? - 02-28-2006 , 11:29 AM




Milan,

I am not currently using D3/NT but jBASE/XP-home.
On jBASE I can succesfully run the following direct printing program
test.
I do not remember if I was able to do the same when I was working on
D3/AIX.
If using ...SEQ access does not work, maybe you should look into EXPORT
/ IMPORT verbs.
If you succeed to communicate with the printer, please share your
solution.

Regards,
Lucian


EQU CR TO CHAR(13) ;* Carriage Return
EQU LF TO CHAR(10) ;* Line Feed

FNAME = '\\LXP\ML4600' ;* Shared printer network address

OPENSEQ FNAME TO FILE SETTING ERR ON ERROR
PRINT 'ERROR - code ':ERR
STOP
END ELSE
PRINT 'ERROR - Cannot open ':FNAME
STOP
END

TT = TIME() + 10 ;* Allows 10 seconds conversation time
LOOP
WHILE TIME() < TT DO
LINE = 'TEST':CR:LF ;* Data line


WRITESEQ LINE TO FILE ELSE
PRINT 'ERROR - Cannot write to ':FNAME
EXIT
END
READSEQ ANSW FROM FILE THEN
CRT 'Printer answer is ':
LL = LEN(ANSW)
FOR L = 1 TO LL
CH = ANSW[L,1]
IF CH < ' ' OR CH > '~' THEN
CRT '<':SEQ(CH):'>':
END ELSE
CRT @(-13):CH:@(-14):
END
NEXT L
CRT ''
END
SLEEP 1
REPEAT
STOP


Reply With Quote
  #5  
Old   
slp
 
Posts: n/a

Default Re: Answer from printer? - 02-28-2006 , 12:46 PM



Hola Milan,

Aqui en la Argentina utilizamos el mismo equipo. Puedo facilitarte el
software para Controlador/Impresora Fiscal de marca Epson o Hasar.
Esta desarrollado para AP-Pro y UniVerse. Si es de tu interes, podes
contactarme por mail.
Hasta pronto.

Sergio Perin
Baseware Systems


Reply With Quote
  #6  
Old   
[Viajero] Milan Banjanin
 
Posts: n/a

Default Re: Answer from printer? - 02-28-2006 , 12:48 PM



Glen, thanks for your question. The printer is a network shared
printer, is NOT a slave printer. I answer that the PCīs had Accuterm,
answering a Tonyīs question, only if this information is usefull.
Lucian, i donīt know if i can "open" a printer like a file, in D3/NT,
but i will try now.
Rergards


Reply With Quote
  #7  
Old   
[Viajero] Milan Banjanin
 
Posts: n/a

Default Re: Answer from printer? - 02-28-2006 , 12:50 PM



Sergio, gracias mil por tu respuesta, ya mismo busco tu email para
comunicarme contigo.

Saludos Cordiales
Milan Banjanin
Sistemas Arrakis,c.a.
www.sistemasarrakis.com
contacto (AT) sistemasarrakis (DOT) com
MSN!:sistemasarrakis (AT) hotmail (DOT) com


Reply With Quote
  #8  
Old   
[Viajero] Milan Banjanin
 
Posts: n/a

Default Re: Answer from printer? - 02-28-2006 , 03:47 PM



Glen B wrote: "If it is connected to a serial port and being shared
using Windows printer sharing..."
This is my problem. Other way, this printer maybe attached at one PC
(with some windowsīs flavor) , via ACCUTERM, and use like a slave
printer. Itīs different?
Regards
Milan Banjanin


Reply With Quote
  #9  
Old   
Nikolai Lukin
 
Posts: n/a

Default Re: Answer from printer? - 02-28-2006 , 11:28 PM



Milan,

Here in Russia we deal with equipment similar to what you're talking about.
Our solution is based on D3 NT/Linux, jBASE isn't a problem either. We use a
Basic program, which runs as a driver listening to a serial port attached to
a cashier/fiscal register, etc. Different variations of the driver are used
for various versions of fiscal EPROM in the registers. We also support
scales connected via serial port.

If you're interested in details, please, don't hesitate to contact me off
the group.

Nick

nvlukin AT gran-service DOT ru

"[Viajero] Milan Banjanin" <viajero57 (AT) gmail (DOT) com> wrote

Hi. D3/NT problem:I have to send a secuency of commands to a serial
printer, and i have to receive an answer from this printer, indicating
some error code. How I can do this thing?. If i define a serial
printer, itīs only for send commands, not for receive, i supose.
Regards



Reply With Quote
  #10  
Old   
[Viajero] Milan Banjanin
 
Posts: n/a

Default Re: Answer from printer? - 03-10-2006 , 03:07 PM



Finally, I have the solution, after reading a lot of manuals (D3,
Accuterm, printerīs manual,etc), searching in the web, ask to Raining
Data, and breaking my head (itīs a common expresion, in spanish).
The solution, itīs simple, and looks like:

in TCL:

:dev-make -t serial -n 50 -a "com1:,9600,n,8,1"
:dev-att 50

in BASIC

....
005 STRING = "TEST"
006 SEND STRING TO 50 ELSE "PORT NOT OPEN";STOP
007 GET RESPONSE,100 FROM 50 UNTIL CHAR(3) WAITING 80 ELSE NULL
008 CALL INTERPRET.THE.RESPONSE(RESPONSE)
....

THATīS ALL, MY FRIENDS

LONG LIFE TO BASIC and FLASH BASIC and PICK (er...D3)

More detail?, ask me by email

Regards
[Viajero] Milan Banjanin
"Live long and prosper" \\//_


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.