Sign in to follow this  
Followers 0
damper

SLC 5/03 to Print tickets

8 posts in this topic

I'm looking for a way to have a SLC 5/03 processor print a ticket for a finished goods line. Does anyone know what I need to get this job done?

Share this post


Link to post
Share on other sites
Do you have a printer in mind? How about a paper type? A particular network or protocol?

Share this post


Link to post
Share on other sites
Tim's covered the hardware pretty well so I'll cover the programming. How is your understanding of the ASCII Character Table. Are you comfortable with string manipulation. You'll be needing to convert an serialized number {Integer} into ASCII and add this to the string which drives your printer. You'll also need to understand how to program the ASCII Read and Write Instructions, or use a Prosoft, Basic or serial module. Can't really give you any more help until you pick some hardware.

Share this post


Link to post
Share on other sites
SLC 5/03 has a port that can be configured for ASCII writes to a RS-232 serial device. What are your label ("ticket") requirements? Paper? Self adhesive label? Label pulled and installed by operator? Label installed automatically by printer? Check out Zebra printers. They can be oredered with RS-232 interface (old-school) but compatible with SLC 5/03. They can spit out a label, the have "print-and-peel" funcitons where the operator grabs a label and applies to the product. How many labels per minute do you need? The ladder code is relatively easy. You can use RTC integer data, and convert it into STRINGS, and then concantenate (add to) static strings, and generate labels. You will need to have static ASCII control codes as part of your RS-232 ASCII write to tell the printer what to do, (font = arial / font = barcode), and also control codes to actually print the label and "form-feed". If you detail your requirements more on the forum, somebody here (inculding me) can send you a sample .RSS file to get some ideas from.

Share this post


Link to post
Share on other sites
I've also had good luck with direct ink jet printing using either Pannier or Matthews. The nice thing here is there's no label...you just load up the pattern you want to print and trigger the printer as needed. The Matthews product comes with a BASIC interpreter on board that you can use to write all the "fancy stuff". Usually the best way to use this feature is to create a very simple string in the PLC with just the bare minimum information. The BASIC program reads the coded string from the PLC and does all the "hard stuff" of configuring the image for the printer. Then either a PLC input or a hardware sensor fires the "print" input while a roller gives accurate encoder feedback to the printer so that as it fires the heads, it adjusts the dot spacing as required to give a very repeatable image. Pannier is similar, and both of them have multiple ways of arranging the communication to get things done. Expect to pay close to $10K once you buy all the pieces for this kind of solution but it can be lightning quick. I found that I can print almost anything at line speeds with the appropriate arrangement of equipment. The limiting factor actually usually ends up being the coordination between setting up the image in the printer and firing it onto the object. If you do go this way, be forewarned. Especially with pigmented inks, it is vitally important to remember that these systems are low maintenance but NOT zero maintenance. They have to be routinely cleaned and cared for or you will end up with very crappy printing. Pay close attention to the ease of cleaning out the system when you go to buy these products because it makes all the difference in the world. There are also laser versions of the same kind of thing that burn an image into the target. That's how you get the lettering on the side of 4x8 sheets of steel stock. Expect the price to be 2-4 times higher for this technology. Mecco has a variety of different systems that can mark on a lot of different stuff. Some are more expensive than others. On the low end the most rugged printer that requires nothing more than paper is a thermal printer. Zebra and Star Micronics are two names. Most of the "gas pump" printers are this type. You can get self-adhesive labels, too. The printer is incredibly rugged but as you probably know, thermal paper tends to fade over time to either brown or white depending on conditions. It works OK for short term use but that's about it. The next jump up for printers that is fairly plant-floor ready is a laser printer. Overall I've never been too happy with these or their ink jet cousins for ruggedness but hey, it's a factory floor and these are more or less precision machines that do OK in an office but not elsewhere, so what can you do. Again, same two vendors (Zebra and Micronics) make these, too. Finally with regards to printers, the best technique is not to print on the line at all! Get preprinted labels and slap them on. Scan the bar code and store everything electronically via the bar code. This vastly simplifies the problem because you can just put unique serial numbers (or bar codes) on everything and track everything via a database. The big downside of course is that there's nothing to read...you have to use a scanner to get the data. As to talking to the printer, here's where things are going to be quite a challenge. The vast majority of the time, you can talk to almost any printer with serial (ASCII). If you have already tied up the serial port on your SLC or you don't want to tie it up (you will have to go through some gyrations to program it), and you aren't using DH-485 in some way to talk to it, you have a challenge ahead of you. Any sort of "port multiplexing" isn't going to do it either because you need to be able to use raw ASCII with the printer. If you can live with tying up the serial port, then go ahead and do it that way. There are some printers which have external hardware inputs that can take simple commands (if input A is on, print message A, etc.). You can get fairly creative with this but it's also fairly limited. After all if the preprinted label approach didn't work, it's hardly likely that you will have enough flexibility with 4 digital inputs to really accomplish much of anything. When considering serial communications, watch out for noise, but more importantly, line lengths. RS-232 was originally design and intended to communicate at 9,600 bps at a distance of 10 feet. It uses a common ground so be aware of and watch out for ground loops. If you have plenty of shielding and reduce the bit rate, you might be able to push it as far as 100 feet (I've successfully done this at the high speed of 150 bps). If your RS-232 device is very close to your PLC, then this isn't really a problem. However, if you want to go long distances, you are going to have to consider RS-485 or RS-422. Both of these physical protocols use differential signalling and lower voltage levels which allows them to travel for thousands of feet. In fact, DH-485 and Modbus are both based on RS-485. The single difference between RS-485 and RS-422 is that RS-422 is intended for exactly one transmitter and one receiver...it's a hybrid of RS-232 and RS-485. In fact even if you don't have RS-485 systems, you can still use RS-422 by simply buying two RS-232/RS-485 converters and connecting them to each other. The PLC and the printer won't know the difference. Alternatively there are also plenty of wireless radios out there (I like Aerocomm which you can buy from mouser.com inexpensively) as well as serial/Ethernet converters (buy from B&B Electronics) if you don't want to bother with RS-422/485. These also have the side benefit of providing a fairly simple way to do troubleshooting since usually you can create a third connection to your laptop to monitor the traffic with a third device of the same type. In the last plant I worked at, I had the IP addresses of all the serial/Ethernet converters in a list on my laptop so that if I got a maintenance call, I could very quickly narrow down some of the communication problems right from my desk. On top of all this, the ASCII commands on a PLC leave a LOT to be desired (no matter whose PLC you use). Using Windows printer drivers can often be quite frustrating but doing it on a PLC is entirely more difficult. Ladder logic is simply not well suited to doing string manipulation. Structured text is better but there are still problems either way within the IEC 61131 world. Just keep in mind that most of the time, your goal is to generate a series of strings of data in the right order with the right information in them. That being said, this is sometimes difficult by itself with a PLC. It is even more difficult if you have a lot of interface logic to deal with where you can't simply "talk directly" to the PLC. If you don't want to tie up your single serial port, you've got to find a way to add another communication port to the PLC. One way would be to upgrade to a SLC 5/05 which gives you an Ethernet port. Then you can hang your programming cables, HMI's, SCADA, etc., off the Ethernet port. You could also use this approach and then hang a Micrologix 1100 off the Ethernet port. The Micrologix PLC has both a serial and Ethernet port and is very affordable ($500) which makes it a good one to use as a sort of "smart remote I/O" interface. Alternatively you could upgrade to a CompactLogix L2x or L3x processor. Both of these have a choice of either 2 serial or one serial and one Ethernet port. Long term, AB has stopped doing new development on both the PLC-5 and SLC processors so upgrading to a Logix 5000 processor makes the most long term sense but it can break the bank on relatively small projects especially if this will be your first Logix 5000 processor. Aside from this approach, you can also do it via distributed I/O with AB hardware. There is a Point I/O card (1734-232ASC or 1734-485ASC) that supports ASCII if you don't mind shelling out for a 1747-SDN module. Fair warning ahead of time: the 1747-SDN module is not the easiest to wrestle with, especially when you are using it for serial communication. Scratch that. Using DeviceNet on a SLC 5/05 is a very painful exercise. There, I said it. For the Point I/O part of things, there's a review on this web site that should give you some pointers (look in the articles, not the forums). As a last option, you can get an ASCII card that fits into a SLC chassis from Prosoft (or Flex I/O or just about anything else). The programming pain is a tad less than the DeviceNet approach. However, get the Prosoft manuals ahead of time and study them closely so that you know what you are in for if you decide to take this approach. When troubleshooting serial, if you don't have any tools right now, get some. These are the serial port tools that I always carry around: 1. Lots of DB-25/DB-9/AB round/RJ-45 converters of different shapes and types also including gender changers. These tend to be "expendable" tools...as in I solve a problem on an installation and leave my "tools" behind and have to buy more. Yes, you can certainly make up your own cables when you get done but you don't want to spend half your time making and remaking cables when it comes time to simply get things running. 2. At least one or two null modem adapters. This solves the problem of going from DTE to DTE or DCE to DCE type devices (whether or not to cross the transmit/receive pairs). Sure you can cut the cable and modify it but when troubleshooting, having an adapter saves a lot of time. 3. At least one RS-232 tester and a breakout box. You can buy both of these are B&B Electronics. The RS-232 tester is roughly speaking the first thing you should do when trying to get everything connected. If you connect first to one device and then to the other and get the same pattern of transmit/receive lights, then you should know immediately that you need a null modem (crossover) adapter. This is hands down the fastest way to solve DCE/DTE type issues, and also helps detect broken wiring and such. The breakout box is a horse of a different color. Instead of it's intended purpose, it allows you to attach your laptop serial port to either the transmit or receive connection. You can then use the terminal software on your laptop (such as Hyperterm) as a sniffer to monitor the RS-232 communication.

Share this post


Link to post
Share on other sites
Let me second Paul's suggestion for tools for RS232 work. B & B or Black Box have proven invaluable suppliers for me.

Share this post


Link to post
Share on other sites
Mark me down as a serial tool witness. I lug my serial box on every job even if they say it is all Ethernet. Where do you guys buy the AB round connectors? I use my 2 breakout boxes on every custom cable job. I bought the Stratus T tap. That has made my life so much easier.

Share this post


Link to post
Share on other sites
I also use zebra printers, they can store forms(labels) and add variables, like time and date, sequence number etc, so as barcodes etc, are already stored in the printer, you only have to send, via rs232- fr 001 to print label one etc the complicated labels, are designed on simple windows label program, this makes it much simpler.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0