Printing with CP340 (Siemens) to dot-matrix printer

Annick

Member
Join Date
Jun 2006
Location
Antwerp
Posts
13
Hello everybody,

I have a siemens PLC (315-2DP) with CP340 to print to a dot-matrix printer using RS232. I am using the standard Siemens P_Print block to do this and this works fine. But... Somehow the messages are not printer immediately but are stored in a buffer. This buffer (4lines) is located in the printer but the problem is situated in the CP340's driver.

Does anyone recognise this problem? I have had contact with Siemens but they couldn't help...

Annick.
 
I've used the CP340 cards for printing extensively. I've never used the Siemens P_Print block though, and prefer to write my own functions.

Can you post a sample of captured text from HyperTerminal in both ASCII and Hex so we can see what the actual output of the card is? That would be a start.
 
Messages appear immediateley in hyperterminal (as they should on the printer). However sending the same information to the printer results in a buffering of 4 lines.

The printers manufacturer has ensured me that the buffering is not done by the printer?
 
Well, if it works properly with hyperterminal, then there is nothing that the CP340 card is doing that would buffer the data.

Can you post the above text output in hex? There are free serial capture programs out there that will display the actual hex values so you can see the escape characters such as CR and LF. That may give us a hint to why the printer doesn't work properly.
 
Hello S7Guy,

I attached the information you asked (at least I think so, serial communication is not really my cup of thea).

I am starting to think that there is a command missing but I have no idea which command and how to program it in S7? Is it possible to make changes to the P_print block (Siemens protected)? Or can I use the P_print block and send an extra command immediatly after the print command?

Tanks for your help, I really appreciate it!

Annick
 
Ok, the dump view is exactly what I was looking for. It appears that the LF and CRs are there (hex 0A and 0D), so that's good.

Can you try this? Connect Hyperterminal to the printer, and send the exact same thing that the CP card sends, and see if you get the same behavior. If it works, maybe it has something to do with the handshaking in the CP card configuration.
 
Hello,

Thanks for the tip! Sending the file directly to the printer was verry useful. It turns out that Siemens puts a '20' after every LF and CR. This is the reason that the message is not printed. If I send the message without the '20' at the end, the message is printed normally.

Rather strange because a '20' in the middle of the message is no problem.

In the meantime I also have opened the protected P_Print block. But the code is verry complicated.

What is the best next step? Change the standard siemens code???

Have a nice weekend!
Annick
 
Well, now you see why I don't use Siemens standard blocks. If seems there is always something that doesn't work as expected, and then I end up doing it over anyway.

You have two choices. One, you can write your own code, which is not going to be easy unless you really know S7. The advantage though is that you can maintain and customize the code as needed forever.

The second option (which might be easier for you) is to construct your own message and use the FB_Send functions instead. Those functions aren't perfect either, but at least they will send exactly what you construct.
 
Both options cost time (money) so I have contacted Siemens again explaining the exact problem. They told me that perhaps they could change the CP340's software but it won't be for free...

Still waiting for an answer from Siemens. I will keep you up to date.
 
While Siemens is working on this, I would give the P_Send function a try. You can use the same parameters that you are using for the P_Print, and it will not add those extra characters. It would be transparent to the printer as far as where the data is coming from.

I am 99% confident that it would work.
 
End of story

Sorry for the long beak (summer vacation for 2 months). At the end the problem turned out not to be a problem since the printer is printing a line every 2 seconds so the buffering is not experienced as a problem.

Communication with Siemens Germany gave no solution...

I did not try your solution (time is money). But I will keep it in mind for a next project!

Thanks anyway.

Annick
 

Similar Topics

Hi all, I am having issues accessing my Cimplicity software - the site code changed after re-install and I am no longer able to attain a new key...
Replies
10
Views
166
My company built a small test machine using a Micro800 PLC and CCW software. We chose the Micro800 because the machine is very simple. We are...
Replies
2
Views
142
I had a student fooling around with settings tonight, and now when I try to print a program ladder, each rung prints on a separate sheet. Too many...
Replies
9
Views
357
Looking to Print over ethernet with a 5069-L320ERMS3 Compact GuardLogix 5380 Safety Controller. Printer model yet to be provided. But a few...
Replies
5
Views
1,591
I have a customer who has 20 of our systems using PanelView Plus 7 Performance Series A terminals. With how hard it is to find printer nowadays...
Replies
4
Views
1,612
Back
Top Bottom