Citect HMI alarm printer configuration

S

Thread Starter

shirisha

Hi!

I connected my Citect HMI printer (Windows XP) to kiosk Printer via USB port. Now whenever there is an alarm tag shown on the Alarm page on the HMI printer, the alarm taglines are automatically printed on printing paper.

But the problem here is the first alarm tag line is printed in the first page and then again next alarm line prints on the next page (the remaining space in the first page is empty) and then page cuts ...it continues. It means in one page only one line prints and cuts and then next page only one alarm tagline ...and so on.

So now what I want is ...I would like to set up the printer in such a way that when FIRST ALARM comes the printer prints the line. That's ok. Then SECOND ALARM should be printed on the second line of the same page instead of printing on second page.

Could anyone please suggest how to configure the printer in that way?
 
M

Michael Griffin

Have you tried a dot matrix printer with tractor feed paper? I'm not sure what a "kiosk Printer" is, but standard ink jet and laser printers are inherently batch/sheet oriented and want to start a new page for each print job. Tractor feed dot matrix printers also don't have to go through a warm-up cycle for each alarm, so they would probably be more mechanically reliable in that sort of application.
 
Hi Michael!

Thank you for your reply. I am using Swecoin TTP7030 printer (112mm) here for my application. It is available on the website http://www.swecoin.se

Also I found that it's not one alarm at a time in one page. But if I have 2 or 3 alarms at a time I could get all 3 alarms get printed and then page ends and then cut and then same thing... continues???

Someone suggested that I need to set up the printer such tht it can make line print and then go to next line instead of next page by using ESc commands. Do you think is it really necessary?

It is little confusing...

Please suggest.

Thanks in advance.
 
M

Michael Griffin

I followed your link and had a look at the printer you mentioned (they have a horrible web site that was designed by someone who apparently never heard of browser tabs). Swecoin states that "In Windows, printing is done based on "forms", or predefined page sizes. When you are in Page Mode (in the Swecoin driver), Windows splits the print job into individual pages of a given size. "

It seems their printer is oriented towards printing fixed "ticket" sizes. You will get 2 or 3 alarms on a ticket sometimes because they fit on one ticket. The driver then sends a cut-off command to the printer automatically after each print job.

Swecoin also states: "Sending raw data through driver to printer: In some cases, you may wish to send Swecoin printer commands to a printer, even while using the Windows driver. To do this, you must manually construct a print job that contains the control codes you wish to use."

I'm not sure how to do this with Citect, but people used to do this all the time with dot-matrix printers. I believe the printer uses the same (or similar) ESC/P codes as an Epson dot matrix. I think the problem is though that you are trying to make the printer do something that it wasn't intended for. If you don't use their driver at all, then you have to set up the print speeds, burn temperature, etc. some other way. If you do use their driver then you have to use it their way. They have a way to bypass the driver to send direct commands, but I don't know if you can access it from Citect.

What I find confusing is what is this printer supposed to do for people in your application? Pretty often what people want for alarms is just a continuous print-out on an endless roll of paper. Why do you want something with an automatic cut instead of a manual tear-off?
 
Hi Micheal!

I don't know how to thank you for your kind consideration and patience for looking at the website and for your reply.

Generally we prefer a dot matrix printer for this kind of application. But for this project we were
looking for a small size printer where we can fix it to the panel, and so unfortunately I chose this. Now I need to make this to work out according to the required application, so I need to make best of it.

Comming to the point, I can comprise with automatic cutting of pages. But what I want is that at least the printer should print all the alarms on a page until the page gets filled up instead of just printing 2 alarms and leaving the rest of the page empty and then cut and go to page 2 then print 2 or 3 alarms, etc...

And yes the printer uses ESC codes. And I am using their driver to send commands. So you think I can work this out through some programming?
Please suggest!

Thanks in advance.
shirisha
 
M

Michael Griffin

I had a quick look at the manual, and it appears that the printer itself can probably do what you want. I can't tell you if Citect or MS Windows will limit you though.

If you look at the manual, you will see that they have a complete listing of the control codes. The MS Windows driver no doubt works by just using these same control codes. The control codes look to be very similar to what you would use if you had a dot matrix printer. If you print the control codes (escape sequences) to the printer, the printer will interpret them as commands rather than actually printing them. People used dot matrix printers this way for many years, so it isn't actually that difficult.

If you send a line of ordinary text to the printer, it just prints it. Cut and eject are specific commands, so it likely won't cut off the ticket unless you specifically command it to. This means that print outs can probably be as long as you want. If so, you could have really long pages, or even just have a button on the MMI screen which the operator clicks when he wants the paper to cut and eject.

What you need to do is to go through the manual and figure out which control codes you need to use. You will only use a few (half a dozen at the most) such as line feed, eject, etc. Get basic printing working before doing anything fancy (such as different fonts, etc.).

I can't help you as to how you would do this through Citect. You need to be able to be able to embed these control codes in strings that you can print on demand. For example, if you were doing this in a language like Python, the following would cause the printer to advance the paper, cut, and eject "print('\x1BJ\xA0\x1E')". In Python "\x" means the following two characters are hex constants, so "\x1B" is the single ASCII "escape" character (a lot of ASCII characters don't appear as keys on your keyboard). The command string is from an example in the manual.

I don't know if you have worked with thermal printers before, but print speed and darkness (burn temperature) often need to be adjusted whenever you change a roll of paper in order to get a good print out. This is done by just sending commands to the printer (see the manual). You will need to add a screen to your program where the operator can make these adjustments. This would need something like a couple of spin buttons to adjust the values and a "test print" button to try them out. This is actually probably easier for the operator than adjusting it through the MS Windows driver would be. The tricky part with Citect might be to make sure these control codes get sent before any alarms get printed (as the printer may return to default settings whenever you turn it off).

If you use this method, then you don't want to install the MS Windows driver that they provide. You want to set the printer up in MS Windows as a generic ASCII printer. Having looked briefly at the manual, I can say that if I were using this printer in a custom software application I probably wouldn't use the MS Windows driver that they provide anyway even if it would work for that application. It adds a lot of complication and places for things to go wrong while offering no real benefit that I can see.
 
Hats off to you Michael for your enormous patience and consideration and valuable suggestions. Now I am working on it and back to you for any help.

Hoping for your help in future too.

With best regards,
shirisha
 
Take a look at Citect Knowledge base article Q1113:

Summary
Problem: Citect is printing each of the alarms on a new page, what is wrong with my configuration?

Solution
The Windows print manager has been designed for page-based printers, for example, laser printers and shared network printers. The print manager does not print anything on the printer until the entire page is complete. It then prints the page. This is the preferred printing method (when printers are shared on a network) because it prevents conflict of data when different operators use the print facility.

However this is not the preferred method when you are logging alarms. If you send alarm logging to this type of printer, Citect flushes the data to the printer when the current page is full, or when the [DEVICE] FlushTime (parameter) time has expired (the default is 10 seconds). If, for example, you have one alarm occurring each minute, each alarm is printed on a new page.

You can bypass the Windows print manager by writing the output to a file. Set the device type to ASCII_DEV (ASCII File) and specify the file name as LPT1.DOS, LPT2.DOS or LPT3.DOS. When you log to this device, the data is printed immediately on the printer with no extra form feeds.

For correct logging operation, you should reserve one printer to be your logging printer. Use a local printer, not the network printer. You can then send any other non logging printouts (for example reports) to a shared network or local printer.
 
Top