I used to have a computer that printed via serial port and that computer died. I now have my program on windows 7 and need it to print via usb. Please Help. Thank you for your time.
#cobolnetexpress
#windows7
I used to have a computer that printed via serial port and that computer died. I now have my program on windows 7 and need it to print via usb. Please Help. Thank you for your time.
I used to have a computer that printed via serial port and that computer died. I now have my program on windows 7 and need it to print via usb. Please Help. Thank you for your time.
I suppose you have something like
000036 SELECT IMPRESO ASSIGN TO ID-PRINT, *> or "LPT1"
000037 ORGANIZATION LINE SEQUENTIAL,
000038 FILE STATUS IS ID-STAT.
The simples way is fill ID-PRINT with a name or replace LPT1 by "MY-RINTING".
afterwards use NOTEPAD MY-PRINTING to see and print the file.
A better way is usind the
call "PC_PRINTER_OPEN" using
call "PC_PRINTER_WRITE" using
there are plenty of demos.
Rolf
I used to have a computer that printed via serial port and that computer died. I now have my program on windows 7 and need it to print via usb. Please Help. Thank you for your time.
You can also just do an ASSIGN TO PRINTER and then redirect the output to your default system printer by using the run-time tunable printer_redirection.
Example:
1) Create file MYCONFIG.CFG containing record:
set printer_redirection=TRUE
2) Set environment variable:
COBCONFIG_=MYCONFIG.CFG
When you open the printer output will be redirected to the default printer.
You can change the default printer within your program using the library routine PC_PRINTER_SET_DEFAULT.
Please see documention under Library routines for more details
Thanks.
I used to have a computer that printed via serial port and that computer died. I now have my program on windows 7 and need it to print via usb. Please Help. Thank you for your time.
Hi Chris,
New issue here with regards to USB printing. The EPSON printer includes a driver that emulates LPT1 to that port... so basically I am printing using LPT1 still and its working as well.
Now the problem arises when using "condensed" printing. My codes are as follows;
select Receipt-printer assign to "lpt1"
organization is line sequential
file status is PRT-status.
78 15cpi-feed value x"0F".
78 Semi value ";".
initialize Receipt-rec
string 15cpi-feed delimited by Semi
"My 15cpi text message" delimited by size into Receipt-rec
write Receipt-rec
Using the code above; the printer seems to ignore the condensed printing. It is still printing in normal/regular size. Any problem here? I am using Windows 7 OS, NetExpress v3.1
I used to have a computer that printed via serial port and that computer died. I now have my program on windows 7 and need it to print via usb. Please Help. Thank you for your time.
Hi Chris,
New issue here with regards to USB printing. The EPSON printer includes a driver that emulates LPT1 to that port... so basically I am printing using LPT1 still and its working as well.
Now the problem arises when using "condensed" printing. My codes are as follows;
select Receipt-printer assign to "lpt1"
organization is line sequential
file status is PRT-status.
78 15cpi-feed value x"0F".
78 Semi value ";".
initialize Receipt-rec
string 15cpi-feed delimited by Semi
"My 15cpi text message" delimited by size into Receipt-rec
write Receipt-rec
Using the code above; the printer seems to ignore the condensed printing. It is still printing in normal/regular size. Any problem here? I am using Windows 7 OS, NetExpress v3.1
I used to have a computer that printed via serial port and that computer died. I now have my program on windows 7 and need it to print via usb. Please Help. Thank you for your time.
Hi Chris,
Removed the COBCONFIG_ settings and it turns out the codes are ok.... now it is recognizing the ESCape code for EPSON ESC/POS.
The printer driver already redirect the USP printer to LPT1... so everything within the Cobol code stays the same.
I used to have a computer that printed via serial port and that computer died. I now have my program on windows 7 and need it to print via usb. Please Help. Thank you for your time.
Yes, the printer redirection options are only used when using a non-LPT1 printer that needs to be redirected to the print spooler.
When using the redirection, control characters are stripped out. In Visual COBOL we have added new functionality that allows you to use both redirection with raw data but this is not available in Net Express.
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.