Slc 5/04 and Model 22 barcode reader

wilheldp

Member
Join Date
Oct 2003
Posts
90
I am a newbie at programming PLCs and I have just been given my first assignment. I have to obtain a barcode from an Accusort Model 22 scanner, and assign a destination based on that code. I think I can handle everything after I get the barcode into memory, but I don't know how to accomplish that. How does the info come into the PLC from the scanner (plugged directly into Channel 0)? Does anybody have some sample code that I could look at?

Thanks in Advance,
Dan
 
I don't know anything about "model 22" but any barcode
scanner with ASCII output is usually very simple to use.
Check "ASCII instuctions" in the RSLogix500 tool pallet.
You will need "ascii read" and "ascii clear buffer"
(i think mnemonics are ARD and ACL but check it out to be sure).
Before you get all excited (and frustrated), I would
strongly (!) suggest to first use Hyperterminal (comes with
every Windows) to verify that scanner and cable are ok.
And more than that - to verify port settings...
It is much simpler to play with port settings on PC than
on PLC (it should take you few minutes to test everything).
Once you have that worked out, It should be no problem
to connect scanner to RS232 port of your PLC.
At least you will know what kind of message to expect.
 
Will the PLC pull in the extraneous bits (i.e. the start bit, trigger ID, quality bits, etc.) or will it just recieve the barcode itself? Does the PLC have any intelligence about what information it is recieving, or does it just pull in the ASCII characters and place them where you tell it to?

Thanks,
Dan
 
This was actually one of my first assignments at my co-op, and I second the idea of using hyperterminal. It is very useful in making sure you have the correct speed/parity/etc settings. I was interfacing with a controlLogix05, but once properly configured, it read the numbers from the bar code directly into memory and knew how to interpret the extraneous signals from the scanner. Good luck.
 
You can also use hyperterminal connected directly to the plc to see that what you are sending is getting into the proper place. There are also protocol converters on the market to change the ASCII to DF1 but they present another area to have to learn about.
 
Ok...now I have the scanner hooked up to HyperTerminal. The barcode info is coming in fine at 9600-8-1, but I'm getting a mysterious " 03" at the end of every read. Also, I get no "No Read Status" bits preceding the barcode, nor do I get a quality code after the barcode. Does HyperTerminal filter those status bits out?
 
You might not be able to see individual bits ("No Read Status", status bits, etc) in hyperterminal. Hyperterminal will display each byte as an ASCII character. But a byte of '0000 0001' has no ASCII equivalent (at least not one that corresponds to a font character, anyway), and so may not display, or only display as a 'space'

As far as that "mysterious 03", that could be the scanner's equivalent of <CR><LF> (another pair of bytes which don't translate into screen fonts).
 
The "03" is the end of text (ETX) control code. "02" might be at the beginning. That is start of text (STX) control code. The "No Read Status" is probably just triggering the light on the scanner unless it has been specifically set up to send a message out the comm port. It can trigger a set of internal relay contacts also. If it is set to send a message out, that message can be whatever is in the message box.I'm going on memory here for some of this, I may not be right, corrections are welcome. You should be able to either change the ETX (end of text) "03", to "13" in the scanner setup to match what the plc is looking for. If not, then in the plc user setup change the termination from "13" to "03". By the way, once the control characters get to the file you are sending the ASCII data to, "03" looks like this " ^C " and the "13" looks like this " ^M ". Hyperterminal doesn't always show the control characters. You'll also need to get an ASCII chart to tell you what the other control characters are. Check this link out for an ASCII chart.

http://www.pcguide.com/res/tablesASCII-c.html



Sid
 
Last edited:
Ok...the 03 being an ETX signal makes sense. There is also some mysterious symbol before the start of the barcode string. Maybe HyperTerminal is turning the status bits into some unknown character. I wonder what the SLC will do to those bits. Oh well, thanks for the info guys.
 
Make sure to setup PLC COM port correctly and also
check the termination settings (it's in "Chan.0-User"
tab of your PLC Channel Configuration). Read help file on
\ff, \d etc.
 
If you would like to see exactly what those unprintable characters are, do this. Connect the hyperterminal to the scanner as you are already doing, then click on Transfer > Capture text. Make a file name that it asks for. Click Start. Read the same barcode several times with the scanner. Click Transfer > Capture text > Stop. Close Hyperterminal. Open the file you just created in a Hex Editor or Debug and then the data will be there in ASCII. Use the chart I posted in an earlier link to translate what the characters mean.

By the way, that mysterious symbol could be the STX (Start Text) character. Hyperterminal has some strange ways to display data.

Once you get the data into the PLC you can manipulate it with the ASCII instructions.You can strip off what is not needed and move it around with the MOV, MVM, or COP instructions.

Sid
 

Similar Topics

Will a Panelview Plus 7 (2711P-T7C22D9P) work with a SLC 5/05 (1747-L552) PLC? I assumed that it did. But, the documentation says that the...
Replies
4
Views
2,756
I'm trying to understand the STI interrupt model for a verification project. When an STI interrupt is triggered, are inputs scanned and outputs...
Replies
1
Views
3,888
I have met 2 machines from Canada .Friction material mixers use plc AB model SLC 150 (quite old). Where can I find the user manual in this PLC...
Replies
6
Views
12,686
I’m attempting to send a temperature from a SLC-5/02 to an EZiMarquee display. The vendor said to use a MSG instruction to send the data to the...
Replies
1
Views
88
Hello all. I have a few SLCs in my plant and of late we've seen a weird issue: The system will be running normally and then randomly the outputs...
Replies
2
Views
103
Back
Top Bottom