Using PCL to force NO reset between files

Discussion in 'Software' started by dgbx, Jun 22, 2011.

  1. dgbx

    dgbx Private E-2

    I have control files built which contain PCL control sequences. These files allow me to print ASCII files from a programming editor in a particular format, e.g., 170 columns wide, landscape, terminal font size 7. I print the control file for the format I want, then I print the desired file, then I print a reset control file. This has worked for years on HP LaserJet IIIsi, LaserJet 2200 and LaserJet 1100. I now have a new LaserJet P2055dn. It seems this printer resets itself between files as now my specially formatted file comes out in usual 80 column, 60 line portrait format instead of the desired special format.
    My question is, "Does anyone know how to prevent the printer from resetting between files?"
    Here is the initial control file. Don't know how it will display with all the escape characters. Assume an ASCII 27 begins each line.

    E
    &l1o66p5e1L
    (10U
    (s0p16.67h8.5v0s0b0T
    &a5L
    &l5.4545C
    &k7.0h2G

    Any help would be greatly appreciated.
     
  2. PC-XT

    PC-XT Master Sergeant

    I don't think it cares about space between files, unless it thinks there is a timeout and resets. You can copy the files together in a DOS copy command to see if it changes anything:
    copy /b header.pcl + file.txt prn:
    (replace header.pcl with the header file, text.txt with the file to print afterwards, and prn: with the device to print to.)
    That should handle the files as if they were one longer file, so you can see if there is a difference.

    If that does the same thing, it's probably a difference in the default setting for the printer, like it is set to another language or it is more strict, requiring something the other printers could do without, like not putting the commands on different lines, putting the end marker E at the end of the job or something. You could try setting the language using PJL:
    Code:
    %-12345X@PJL ENTER LANGUAGE = PCL
    E&l1o66p5e1L(10U(s0p16.67h8.5v0s0b0T&a5L&l5.4545C&k7.0h2G
    Then comes the rest of the PCL job, then
    Code:
    E%-12345X@PJL EOJ
    %-12345X
    
    to show the end of PCL commands (E), then PJL's End Of Job markers. You can also use PJL to set the number of copies to print and other things.
     
    Last edited: Jun 23, 2011
  3. dgbx

    dgbx Private E-2

    PC-XT - Thanks for the reply.
    I have already glued the control file to the top of the text file and that printed just fine - exactly as desired. To me that proves that the printer is resetting between files. I could do that combining of the files automatically using my editor's macro capabilities easily on full files, but we are currently also set up to print only a marked block of the text file and I haven't yet found a way to accomplish that.

    I tried your PJL code, but something must have copied over wrong or it just won't work as the first line of the code printed on the first page, then a blank page, then my text file in the undesired 80 column, 60 line format.

    I'll keep digging into the printer settings as you suggest to see if I can get around this.

    Again, thanks for your help. I appreciate it.
     
  4. PC-XT

    PC-XT Master Sergeant

    I had trouble posting it, so there might be an error. It doesn't matter, though, if it prints properly with the files glued together. The problem must be in how the files are put together when printing. Older printers would stop and wait for the next file like waiting for any other part, but this one might time out and start a new job or something. It could also be possible that the printer driver can somehow detect the end of a file and send extra codes to reset the printer for the next file. It seems there is some misunderstanding between the driver and filesystem. Maybe you should try setting the printer to hex dump, if you can, so you can see what codes it's getting.

    If you can capture the differences between the printings to see what they are, it might help understand the problem better. Getting modern laserjets to hex dump is at least hard, though you can check the manual to see if there is a way. You can also try a print to file option, or another way to capture the spool. There are suggestions here, too: http://www.oasq.com/LaserJet-4250-Hex-Dump-thread-57943-1-1.html There is also PJL code to put the printer in hex dump mode, but I think it's undocumented, and might not work for all printers.

    I found some similar problems posted elsewhere. It often turned out to be a modelscript problem. The following example turned out to be a modelscript problem, and shows how they solved it:
    http://forums13.itrc.hp.com/service...47627+1308877217857+28353475&threadId=1439058
     
  5. dgbx

    dgbx Private E-2

    Thanks again PC-XT for the time you have given this. Because I'm in a work environment with this issue, I have cobbled together an inelegant but so far robust solution whereby I put the two files (control and text) together just prior to printing the text file, then remove the control file after printing. For printing marked blocks, I'm using the old printer. With time I hope to clean up the block printing too.

    I'll look through the sources you've recommended to see if I can learn more about the issue.

    Really appreciate your help. Thanks.
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds