can I make a TSR that would communicate with my DOS program?

DOS specific questions.
Post Reply
Gablea
Posts: 1104
Joined: Apr 06, 2010 0:05
Location: Northampton, United Kingdom
Contact:

can I make a TSR that would communicate with my DOS program?

Post by Gablea »

Hi Everyone,

I would like some advice on a problem that I MAY have.

I have 4 printers that I would like to support with my program :
Epson TM-U950 Dot matrix Printer (has both Journal Roll and Receipt Rolls in the machine)
Epson Tm-88 range of printers (Single station thermal Printer)
Wincor Nixdorf ND22 (same as the Epson but using WN Programming code)
IBM 4614 1.5 slip thermal printer


What I was thinking is this either make a TSR Program in FB that handles the communication to and from the printer as well as the formatting etc of the text OR some how bolt on to the exe program the required add on.

THIS is to work in DOS So I can not use TCP/IP communication between the applications (I would like it so If I want to support a new printer down the line I just need to make a new TSR etc for that printer)

At Some point i would like to support Linux with this program so If the solution could also work on there I would be for ever grateful.

Any advice etc would be most grateful as I DO Not really want to hard code into the program the support for the printer.
MichaelW
Posts: 3500
Joined: May 16, 2006 22:34
Location: USA

Re: can I make a TSR that would communicate with my DOS prog

Post by MichaelW »

What sort of port do these printers connect to, do you have DOS drivers for the printers, and do you have detailed technical documentation for the printers? Printer drivers are more or less difficult to code, because many/most tasks involve sending a more or less large number of control codes to the printer.
Gablea
Posts: 1104
Joined: Apr 06, 2010 0:05
Location: Northampton, United Kingdom
Contact:

Re: can I make a TSR that would communicate with my DOS prog

Post by Gablea »

They use rs232 Port and yes I have full programming manuals.

I'm trying to do is so I do not have to change the main program each time I ant to add
Support for a new printer.

I have all the code that is needed to control the printers the only thing I have never managed to
Do is upload a logo by code (from with in the program) but I have a logo loader app that
The manafacters sent me
marcov
Posts: 3462
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: can I make a TSR that would communicate with my DOS prog

Post by marcov »

32-bit TSRs seem to be interesting
caseih
Posts: 2157
Joined: Feb 26, 2007 5:32

Re: can I make a TSR that would communicate with my DOS prog

Post by caseih »

The TSR solution would never work on Windows or Linux anyway, so I wonder if it's best to proceed in a different way. What are the commonalities between all the printers you will want to support? Are they all RS232? Maybe your best bet is to have a text file that describes the commands to do different things, and provides basic parameters of the printer (the port, paper size, cpi, etc). Your program can load them at runtime and interpret them. That's how things used to be done back when every program had to do its own printer drivers.
marcov
Posts: 3462
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: can I make a TSR that would communicate with my DOS prog

Post by marcov »

For Dos, usually the best is to output to .ps and simply have ghostscript handle the rest.

Relative high quality output for not too much effort, and quite some printers supported. (at least it was back then, when I still did dos)
caseih
Posts: 2157
Joined: Feb 26, 2007 5:32

Re: can I make a TSR that would communicate with my DOS prog

Post by caseih »

Yes PS is a good option for many things. Given that his printers are generally connected via serial port, I expect they are specialized like bar code printers, label printers, or line printers. PS is probably not the best option for dealing with them. The OP hasn't described what kinds of print layouts he wants to achieve, though.
Gablea
Posts: 1104
Joined: Apr 06, 2010 0:05
Location: Northampton, United Kingdom
Contact:

Re: can I make a TSR that would communicate with my DOS prog

Post by Gablea »

Most of the printers use the Epson ESC/PoS language to control the formatting etc of the text

I like the idea of loading the language at start up

So I would have a Ini file or something similar with for example

NormalFont=ESC & "!" & Chr(0)

and then use replace to replace the word ESC with the actual ESC command?

or can I use Chr(27) in the file?
caseih
Posts: 2157
Joined: Feb 26, 2007 5:32

Re: can I make a TSR that would communicate with my DOS prog

Post by caseih »

If you open the file in ascii read mode, the only characters to avoid are the CR and LF together, which signifies a DOS end of line character which FB will parse out. But everything else is fair game. You certainly could have a real CHR(27) in the text file. The question is, how will you edit the text file? Most text editors don't make it easy to enter an ESC character. So you may just want to use a placeholder that you identify and replace while loading it.
Post Reply