Jump to content
Sign in to follow this  
Simon

PCL Printer Support

Recommended Posts

The ability to print from a Unitronics PLC has been around for a while, using the Protocol FB tools. However it has generally depended on using a serial line printer.

At times customers ask for full A4 (similar size to US letter), page-style printouts. Examples include shift reports and batch reports.

It recently occurred to me that there must be a way to send simple print information to a office style laser printer - and there is, called PCL.

The easiest way would seem to be fitting an ethernet card to the PLC and use a network printer. Possibly it may also work if there is such a beast as a laser printer with RS232 input (I did see some on a google search but they were 2-3 times the price of a basic ethernet printer).

PCL itself is a binary ASCII protocol, so it looks quite simple to send using the Protocol TCP/IP function blocks, for printing plain text. I plan to work on this should the need arise.

It would be a nice "wow" factor to have this built in to the PLC as dedicated PCL function blocks, maybe even to the extent of printing out a trend graph or even small images (company logos, etc).

Has anyone else come across this request or requirement for full-page printouts?

Share this post


Link to post
Share on other sites

Hi Friends,

The theme is seems to me very interesting!

About "normal" office printers - they usally have USB interface and ... Windows driver. In such case it's practically impossible to output print from current controllers.

More and more popular are network printers. They have their own drivers, but also their own protocols (ASCII based) to drive them. I'll post soon working example to output print from Vision OPLC via Ethernet to such printer.

Share this post


Link to post
Share on other sites

Hi Jonathan,

Firstly, I haven't gone much further with this, as the immediate customer need went away.

The communication between the PLC and the printer does need to be ASCII, as that is what the PLC can handle.

What do you mean by ASCII mode? Do you mean that the printer prints the literal ASCII as it receives it? This is usually the case for strip or tape printers (like in a cash register) but gets awkward for whole-sheet printers, like office printers.

The PCL protocol above still uses ASCII characters, but they include formatting commands, so the printer buffers all the information and only prints the page when told to. Most office laser printers support PCL, but it requires investigation to confirm all the details.

EDIT: just took a look at Emil's example. This example looks like it would require literal ASCII mode, it is not a PCL sequence.

Share this post


Link to post
Share on other sites

I had a customer ask about network printing from the PLC and did some digging. The PCL5 language dates back to the LaserJet III and further information can be found here:

http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?lang=en&cc=us&objectID=bpl04568&jumpid=reg_r1002_usen_c-001_title_r0001

This page includes links to the actual PCL Technical Reference Manual needed for creating PCL commands. I will be trying some of this out and I'll keep everyone updated.

Joe T.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...