SLC5/03 to Bar Code Scanner

Leeroy

Member
Join Date
Oct 2012
Location
Canada
Posts
66
I'm having troubles connecting to a honeywell xenon 1902 bar code scanner to my slc5/03 plc. I'm using an rs232 cable going to the channel 0 port and then channel 1 right now is just used to connect to the PC. I've matched up the baud rate, data bits and handshaking so that both the scanner and plc are identical but I still can't seem to establish a connection.

The purpose of the bar code scanner is once the scanner has read a bardcode, it will send data to the plc.

Now I am fairly new to doing communication/networking so maybe there is something I'm missing. If I do establish a connection where do the data bits get stored to and how can I tell if I do have a connection established?

As you can tell I'm fairly new to this :ROFLMAO:
 
When I have to do custom serial communications with a PLC, I normally start out using a terminal program with a PC to prove my cable(s) and get a look at the data right up front.

Make sure the reader is spitting out chunks you can "see" in hyperterminal or RealTerm, and then examine the cable pin out carefully before adapting that set up to the SLC.

A 5/03 serial port (CH0) can be set for DF1 protocol, or User (ASCII) mode. Unless your barcode reader speaks DF1 (rare) you will need to be sure the port is set up for ASCII mode.

If you can, zip and post the .rss file for the SLC, and as many details about the other hardware you're using (links to manuals are always nice).

And, welcome to the forum!
Paul
 
Looks like you have specifed user (ASCII) mode in the SLC already and the baud rate is set to 1200.

The scanner appears (based on a quick scan of the manual) to default to 9600 baud and one way it can be changed is by scanning special codes.

So, I would set up the SLC to 9600 as well, unless you want something different. The SLC baud rate is limited to 19200 in your 5/03. Unless you are scanning lots of codes very very quickly, the baud rate should be of little significance in this type of application. Sometimes slower means more reliable, but I would go at least 9600.

And, again, I recommend getting the scanner to work with a PC running terminal software first, since it's usually much easier to experiment with these (and other) settings and see the results.

And, you can connect the PC serially to your SLC and test your parsing logic, by sending strings (exactly like those produced by the scanner).

This may not be as easy these days with new PCs ditching the serial port.
 
Last edited:
Now I have been trying to get the scanner working with PC software using the rs232 connection given, but have not been succesful connecting to it. I have been able to connect to it using a USB cable also given. So my question is should I just experiment with the USB connection and then try using the serial connection for the PLC, or should I keep trying with the rs232 connection?
 
Now I have been trying to get the scanner working with PC software using the rs232 connection given, but have not been succesful connecting to it. I have been able to connect to it using a USB cable also given. So my question is should I just experiment with the USB connection and then try using the serial connection for the PLC, or should I keep trying with the rs232 connection?

More detail please. The SLC has no USB port, so if the USB connection you describe is a USB to RS232 converter, then proceed, otherwise go back and figure out why you can't get the PC to talk to it through RS-232.

Post details of exactly how the cable is wired.

Try swapping Rx and Tx on one end. Ensure that any RTS and CTS connections are required or remove them.

Post more details about the exact connection in your system, pin for pin, how is the comm cable wired?
 
The scanner connector is really not Ethernet, the manufacturers use an RJ 45 on the scanner end. After you get it working on a PC, I noticed in your ladder that you defined a control bit but you did not use it in the program. I dont use the ACB, but i use the ACL instruction with the control bit XIC DN and in the next rung the ARL instruction with the XIO EN bit. This always worked for me and i have done it with 5/03 5/05 and some of the Micro logix.

R6:0/DN
---||------------ ACL

R6:0/EN
---|/|----------- ARL
 
The scanner connector is really not Ethernet, the manufacturers use an RJ 45 on the scanner end. After you get it working on a PC, I noticed in your ladder that you defined a control bit but you did not use it in the program. I dont use the ACB, but i use the ACL instruction with the control bit XIC DN and in the next rung the ARL instruction with the XIO EN bit. This always worked for me and i have done it with 5/03 5/05 and some of the Micro logix.

R6:0/DN
---||------------ ACL

R6:0/EN
---|/|----------- ARL

I might have to try that out. It makes sense it's not ethernet since there can be 10 connections to the RJ45 scanner end, got confused on that because they look so similar.

A few questions though, when would the scanner have the enable bit on/off? also when would the done bit come on? as soon as it scans and then shuts off?

My last question is for those who have looked at the code, do I have the channel configuration correct IF for the scanner I have the same baud rate (did change it to 9600), 8 data bits, 1 stop bit and no parity? Or is there more I can change around.
 
the R6 bits are controlled the PLC through the ARL instruction. They control the data flow. I dont fully understand how they work, i just know that i could never get it to work correctly without them. As far as channel setup it just has to match the scanner. The default on the scanners i use is 9600,8,1 N. I never changed them. Would it help if i send you a program i used in a 5/03?
 
A few questions though, when would the scanner have the enable bit on/off? also when would the done bit come on? as soon as it scans and then shuts off?
Use the ARL command to read the ASCII string from your SLC 5/03 Port 0. When the ARL is not in use, the R6 EN bit will be off, so you can use a R6:**/EN XIO bit (where ** is your ARL Control Word number) to Read a new line that has just been received. Then use a R6:**/DN XIC bit to signal that a new line has been read and is available. Those are the only handshake bits you need to read data from a RS-232 bar-code scanner. The new string data at ST52:1 should be copied to another location on every PLC scan, and the the "NEW DATA FROM CHANNEL 0" bit used to extract or maniipulate the new barcode data.

Barcode Read to SLC with RS-232.jpg
 
Last edited:
the R6 bits are controlled the PLC through the ARL instruction. They control the data flow. I dont fully understand how they work, i just know that i could never get it to work correctly without them. As far as channel setup it just has to match the scanner. The default on the scanners i use is 9600,8,1 N. I never changed them. Would it help if i send you a program i used in a 5/03?
Yes sammie that would be great, hopefully I can see from your program something I may be missing. Right now I don't see what I am doing wrong though because I have the scanner at default settings (9600 baud, 8 data, 1 stop, no parity, no handshaking) and have that matched in the PLC configuration.

Use the ARL command to read the ASCII string from your SLC 5/03 Port 0. When the ARL is not in use, the R6 EN bit will be off, so you can use a R6:**/EN XIO bit (where ** is your ARL Control Word number) to Read a new line that has just been received. Then use a R6:**/DN XIC bit to signal that a new line has been read and is available.
Thanks Lancie1, that helps alot. My enable bit stays on all the time so would that mean it's continuously reading the bar code string?
 
My enable bit stays on all the time so would that mean it's continuously reading the bar code string?
It means that ARL is trying to read all the time, but will only read one line before setting EN = TRUE. Use a "closed" or TRUE EN bit to turn the ARL OFF again after only 1 scan (make it self-resetting after reading 1 line). Crazy, I know, but it works! That's all, folks!
ARL [ASCII Read Line]
Rockwell Software
Operation
1 The ARL rung goes from false-to-true, setting the EN (Enable) bit.
2 The instruction is put in the ASCII queue, setting the EU (Queue) bit.
3 The instruction executes and the RN (Run) bit is set.
4 The requested number of characters (including the end-of-line characters) are moved from the buffer to the destination string.
5 The number of characters moved is placed in the position field (control element Word 2).
6 The number in the Characters Read field is continuously updated, and the DN (Done) bit is set once all of the characters have been read. If the processor finds termination characters before reading is done, the number of characters found is stored in the POS word of the control block in addition to setting the DN (Done) bit.
7 When the program scan finds the DN bit set, the processor sets the EM (Synchronous Done) bit.
 
Last edited:
...Or is there more I can change around.
Leeroy, I should have pointed out that your barcode scanner must be configured to add an end-of-line (ASCII CR or carriage return) at the end of each barcode, otherwise your PLC ARL instruction will have no way to know when it has read one complete barcode or "line", so will read forever waiting and waiting.

The requested number of characters (including the end-of-line characters) are moved from the buffer to the destination string.
 
Last edited:

Similar Topics

I have wasted a week trying to figure out how to connect an SLC5/03 with my laptop. I do not have and can not Buy the 1747 UIC and PC3 cables. I...
Replies
14
Views
2,557
I am trying to connect to SLC5/03 using an FTDI usb to rs232 with female to female converter at 1 end... however I can not connect to it ... the...
Replies
8
Views
1,273
Good evening. I am in serious need of help. I am trying to connect a Panelview Plus 7 Standard to a SLC5/03(1741-L531) using a Moxa MGate...
Replies
3
Views
639
Hi. I am having trouble establishing comms between an slc5/04 and panel view plus 7 via a PLX51-net-eni. The set up is: 5/04 Channel 0 DF1...
Replies
8
Views
926
Hi All, I have programmed some MSG instruction in SLC5/05 64k CPU series D FW 13 brand new cpu. 2 of the MSG instructions are direct IP to other...
Replies
3
Views
984
Back
Top Bottom