in reply to Re: No response from printer using Win32::SerialPort
in thread No response from printer using Win32::SerialPort

I'm using PAXAR's proprietary language, I think they call it PCL or NCL.

The string that includes the ~ character
$Port->write('{I,E,"~123~044~034~124~125~126~094"|}');
is exactly what the PAXAR printer is expecting (copied directly from their user manual)to turn on what they call "Immediate Commands". The Immediate Commands allow for the "^E" (this is the polling character) to post an empty "write" to the port, which then puts the printer status on the port to be read.

I don't think Win32::SerialPort does anything with the ~. As far as I can tell it just treats the entire string (including the ~) as a string.

The following lines of code are more examples of the PCL and are to just simply print the word CARTON on a label.
$record_to_print = $record_to_print.'{F,26,A,R,E,600,400,"FMT26"|'; $record_to_print = $record_to_print.'C,400,50,0,50,16,16,O,L,0,0,"CART +ON",0|}'; $record_to_print = $record_to_print.'{B,26,N,1|}';
Thanks for your reply and your time...

Replies are listed 'Best First'.
Re^3: No response from printer using Win32::SerialPort
by grep (Monsignor) on Oct 10, 2006 at 19:41 UTC
    One thing - I'm pretty sure '^E' shouldn't be the literal string 'caret' and 'cap E'. The caret is usally used in printer code to denote a control code. In this case \x05 or ENQ.

    From the manual it's actually not PCL - it's MPCL. It also does explain that '~' is used by the printer for decimal ascii codes - so that seems ok. I'm guessing the big problem is the Ctrl Codes. You can get more info here.



    grep
    One dead unjugged rabbit fish later
      The ~094 part of the Immediate Command sets the control code used for processing as the ^. I've spoken to PAXAR's support staff and have seen this in other scripts as well. At one point, before a reboot, I was getting intermitten responses from the printer using the same control codes. So, no, it's not the control code. I was not getting responses from the printer 100% of the time, but more like 1/3 of the time. Since the printer reboot, I can talk to it, but it won't reply. I've gone through every setup procedure that they have suggested and still nothing.
      Thanks