Jump to content

RS232 Barcode Scanners to Vision 120 PLC - one works and the other does not?

Recommended Posts

Hi All - 

I am working to connect a barcode reader to a Vision 120 PLC via RS232. I have two barcode readers on hand - a Motorola Symbol LS4278 (which reads 1D and 2D codes), and a 1D-only Royal PS700-LSR. Both readers are set up the same way - serial cable with external power input into the scanner, connected to the PLC by a DB9 to RJ45 adapter. 

When connected to a Serial-to-USB converter to the computer, both scanners send the same data to the Serial Terminal (I am using Hercules). But when connected to the PLC, the Royal scanner data is read as expected, but nothing happens when scanning codes with the Symbol scanner. 

On the PLC, the Session Complete bit is never set by the Protocol Scan block so none of the other processing is triggered when the Symbol scanner is connected. With the Royal scanner, each scan flips the Session Complete bit, and data is copied and formatted correctly. 
When the scanners are connected to the computer, I see the exact same hex characters in Hercules from both scanners. 
PLC program attached.

I have tried and confirmed various serial communication settings (baud rate, STX/ETX chars, handshaking, etc.) to match between the scanner and the PLC, and I have worked through the suggestions in this thread: 


Can anyone suggest what the difference between the two readers might be? I need to make the Symbol reader work since the system will read 2D barcodes. 



Doug Davies



Link to comment
Share on other sites

  • MVP 2023

There may be a missing termination character in the barcode stream.  Terminal programs are a lot more forgiving than Unitronics serial ports are.

Does your terminal program have a hex mode where you can see ALL the characters coming in?  If not, use this one:


You'll see it has a little radio button for HEX and ASCII selection.  In hex mode, you will see all the characters including the non-printing ones such as CR and LF.  This will allow you to really tell the difference between the outputs of the barcode readers.

Joe T.

  • Upvote 1
Link to comment
Share on other sites

Joe - 

Thanks for your quick response! 

It looks to me like the termination characters are not the problem - I can see the hex characters in the terminal programs (I like that Terminal you suggested), and I can program the barcode scanners to send or not send termination characters. 
Including all Hex characters, both scanners are reading the same. At the moment I have both scanners set to send no termination characters (they both send ONLY the characters in the barcode), and I still see the same behavior - one scanner works fine, the other doesn't register. 

My program is only looking for an ASCII stream, with Silence as the termination condition in the Protocol scan block - are there any other places in the setup that might affect which streams register on the PLC?


- Doug

Link to comment
Share on other sites

  • MVP 2023

I have more time so I  looked carefully at the program and with the silence termination the termination characters don't matter.  I turned the silence up to 20 ms.

I made your stream variable bigger to allow a little more room in case the scan is larger than you think.

I also reset the Session Complete bit MB 1 in Net 4.  You have to do that to cock the block for the next scan.  This is probably the main problem.

Let us know if it works.

Joe T. 

120-barcode-scanner2 JT.vlp

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...