Looking for U2 BASIC coding example for PCL 6 interface. Thanks Lou
------------------------------
lou tur
Senior Sales Engineer
Rocket Internal - All Brands
St Petersburg FL US
------------------------------
Looking for U2 BASIC coding example for PCL 6 interface. Thanks Lou
Looking for U2 BASIC coding example for PCL 6 interface. Thanks Lou
Hi Lou,
One thing I always recommend for PCL programming is to always senc a soft reset ESC:'E' to the printer prior issuing any further changes. This will reset the printer to the configured defaults that you have set via the control panel. Also recommend sending a reset at the end of each job which will cause the printer to flush and print the remnants of its buffer and eject the last page.
The following is a quick and dirty and there are more elegant and complicated ways to do this but I hope it is useful to you. If you want to format each line then prepend the format code to the text.
e.g. print BOLD:'this is bold text':NOBOLD:'this is normal text'
Cheers,
Peter
* Set output to the desired filename in &HOLD& (printfile.txt)
* Change the SETPTR command to suit your own printing environment
cmd = 'SETPTR 0,132,66,0,0,3,NHEAD,BRIEF,NOEJECT,NFMT,BANNER printfile.txt'
execute cmd capturing output
* Define the codes to use. Source more from a google search for 'PCL6 Commands Reference'
ESC = char(27)
SOFTRESET = ESC:'E'
PORTRAIT = ESC:'&l0O'
LANDSCAPE = ESC:'&l1O'
FIXEDWIDTH = ESC:'(s0P'
PROPORTIONAL = ESC:'(s1P'
BOLD = ESC:'(s3B'
NOTBOLD = ESC:'(s0B'
IBMPCCHARSET = ESC:'(10U'
6LPI = ESC:'&l6D' ;* line printer lines per page
10CPI = ESC:'(s10H' ;* 10 characters per inch across the page
EJECTPAGE = ESC:'&l0H'
* Direct output to the print spooler
printer on
print SOFTRESET
* Set for line printer
print LANDSCAPE:IBMPCCHARSET:6LPI:10CPI
pageCount = 1
lineCount = 1
bNoMore = @false
jobHeading = 'some heading as at '
print jobHeading:timedate():' ':pageCount
loop until bNoMore do
* read/obtain stuff to print and format into a line
line = 'stuff to print'
print line
lineCount += 1
* check here if any more to print
* if no more to print then bNoMore = @true
if lineCount > 66 then
print EJECTPAGE
pageCount += 1
print jobHeading:timedate():' ':pageCount
lineCount = 1
end
repeat
print SOFTRESET
printer off ;* turn off spooler output
printer close ;* close the print file
* At this point there will be a file in &HOLD& called printfile.txt that
* can be reassigned via the spooler to send to your PCL6 printer
* Or it can be distribute via your favourite transport mechanism (sendmail, sftp, scp, awscli etc)
------------------------------
Peter Cheney
Developer and Systems Superstar
Firstmac
Brisbane Qld Australia
------------------------------
Looking for U2 BASIC coding example for PCL 6 interface. Thanks Lou
I've got some PCL5 subroutines for D3. Interested?
I've got some PCL5 subroutines for D3. Interested?
Looking for U2 BASIC coding example for PCL 6 interface. Thanks Lou
I attached a .txt file with all the subroutines I could find. Give 'em a look and let me know if you need anything further (like an example program calling the subs?? probably not...).
Hi Lou,
Here's another example of PCL5 code - written 26 years ago! Hopefully there's some useful bits there....
Cheers
Tom
I attached a .txt file with all the subroutines I could find. Give 'em a look and let me know if you need anything further (like an example program calling the subs?? probably not...).
One thing that I do not see mentioned is the major difference between PCL5 and PCL6. PCL5 and prior versions were ASCII-based languages whereas PCL6 is compiled and sends a binary file to the printer. I haven't found a good way to convert PCL5 to PCL6 or found documentation on the PCL6 source language or how to compile it. If anyone knows more about that I would appreciate sharing.
Dick Thiot
Maverick Systems
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.