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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending one pic x to COM:

Status
Not open for further replies.

Goedwill

Programmer
Oct 21, 2002
5
US
Hello, i'm trying to build a program for my study, and i have want to send 1 pic X or more to a serial com port, i'm using a MF compiler.

Thx
 
Yes, i want to output a pic X on com1:, i'm writing a cash-register program and to open my cash-drawer, it request a signal on com1:, i've tried to a text file to com1 in dos-mode and that works fine, so my question is, can i do this in MF cobol.

Thx

PS Sorry for my bad language, i'm duth speaking.
 
I've written software that writes to a receipt printer and has a cash drawer attached. I'm printing to the printer using the 'PC_PRINTER_WRITE' statements. The printer will open the cash drawer if you set it to a certain font (the control font) and then send it a command - see below:

move length of cdfontname to cdfontnamesize.
move 10 to cdfontpointsize.
move 0 to cdfontstyle.
call 'PC_PRINTER_SET_FONT'
using by reference printerhandle
by reference cdfontfamilyname
by value cdfontpointsize
by value cdfontstyle
returning statuscode.

call 'PC_PRINTER_WRITE'
using by reference PrinterHandle
by reference "A" *> code to open the drawer
by value 1 size 4
returning StatusCode.

call 'PC_PRINTER_CONTROL'
using by reference PrinterHandle
by value 3 size 4 *> flush the print buffers
returning StatusCode.

Hope this helps.

Clegg
 
I'm sorry, but my receipt printer is on LPT; and has no connection possible for my cash drawer.

Maybe this is clearder

Can i change my printer output from LPT1 to COM1;

 
Could you issue the DOS command MODE LPT1=COM1 ?

Hope this helps

Marc
 
Yes, that is a solution for the cash drawer, but can I call DOS commands from cobol, else is my cash drawer working, but can i not write to the receipt printer.
 
I'm fairly certain you can call DOS from Cobol, although I've not done it, I'm sure someone here has. I have a feeling that you do something like:

CALL 'COMMAND.COM MODE LTP1=COM1'

but as I said, I've not done this and it's only a guess.
 
I think i have the solution myself,
printing to com1: is the same as printing
to a file, so i declare a file with the name
comport and i set the name of the file like this "com1:"
I think this wil work, but i can't test one the moment.

select com-port assign to "com1:".

But I'm gonna try the call '' function also.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top