AlexCalandria

Transmission problem BARCODESCANNER to CP1L-EM

17 posts in this topic

Hello all, I am trying to connect a barcode scanner to my plc using a 232C in the serial1. The scanner is a motorolla ls3578 fz, with the following parameters: Transmit code ID: yes Data Transmission format: Data/suffix Suffix: CR(1013) Baud rate: 9600 Parity: none Hard/software handshacking: none Stop bit select: 1 Ascii format: 8 bit RTS Line state: high Prefix: none In order to send data form the scanner to the plc, I use the RXD function block with the following parameters: First receive word: D300 Control word: 0100(hex) Number of bytes: &10 All the communication settings of the PLC are the same that the scanner ones. PROBLEMS 1)When I scan something the scanner beeps as if a transmission error occurs, and the data is ignored. 2)The A392.14 never comes ON and. POSIBLE SOLUTIONS Type of barcode: Now I am using a Code39 barcode. Is it OK? How can I implement the suffix? I have a software that allows me create new barcodes, but I don’t know what kind of data do I need. With 1234567891013 the 1st problem occurs. With 123456789 nothing happens. Communication settings: maybe my communication settings are not well defined. I attach you the file and maybe someone find out an error. Thank you up front! rxd.cxp

Share this post


Link to post
Share on other sites
The Omron serial port pin out is NOT a standard pin out. Not sure what cable you are using to the barcode scanner, but that would be my first thought. See attached for Omron serial port pinout.
1 person likes this

Share this post


Link to post
Share on other sites
Gtsuport, Thank you for the response, but the scanner is connected with a USB to 232C, so I don't know how to check what you are saying to me. I attach you some pictures and let’s see if you can help me. Thank you very much Edited by AlexCalandria

Share this post


Link to post
Share on other sites
Hello all, As some recomendations in previous topics, in the RXD funtion, in the NUMBER OF BYTES TO STORE, I put the A394 flag. I restarted all the system and now the scanner sends me back a short beep and a green flash light (it means that the decode was successful and the communication too). However, in the memory there is nothing, and in the 394 and 392.14 also all is 0. What can I do ? Thank you up front

Share this post


Link to post
Share on other sites
You will need to build a cable between the USB-RS232 converter and the Omron serial port. Best guess the cable will be similar to the attached diagram. GTC99CC.pdf

Share this post


Link to post
Share on other sites
In the attached file I can not see the pin number 9 in one side and the 8 in the other side, so what I have to do with them? What kind of hardware do I have to use to join it in your way? Thank you

Share this post


Link to post
Share on other sites
If a pin number is not shown there is no connection. You will need all of the existing hardware that you have, plus the following. You will need a DB9 male connector, DB9 female connector and a piece of multi conductor cable. The cable you build will plug into the plc serial port and the USB-RS232 converter. Hope this will help.
1 person likes this

Share this post


Link to post
Share on other sites
I will try and I will give feedback. Thank you for all the quick responses!

Share this post


Link to post
Share on other sites
I did what you said but I can't recieve any data, any flag is ON... Maybe the problem is with the flags?? The error flags are Off too...

Share this post


Link to post
Share on other sites
It is a bit difficult to tell, but It looks like this may not be wired properly. Pins 4 and 5 on the plc side need to be shorted together. It looks like you have pins 4 and 5 shorted on the USB adapter side of the cable. Omron plc serial port pins 4 and 5 are RTS and CTS. If these pins are not shorted, the port will not receive data. Please review the cabling again and verify proper connections.

Share this post


Link to post
Share on other sites
Can you post your current plc program? There may be a Serial Port 1 setting issue. I just want to make sure I am looking at your most recent plc code.

Share this post


Link to post
Share on other sites
Maybe in the picture it's hard to see, but there is a bridge in 4 and 5. I found another posible good graph: What do you think? Can it work? rxd (1).cxp

Share this post


Link to post
Share on other sites
I just looked at your program. On the barcode reader, do you have it set to append a CR+LF to the data string? The PLC is looking for CR, LF at the end of the string to turn on bit A392.14. The above cable pinout is for a full handshake setup. Not sure the barcode reader supports full handshake.

Share this post


Link to post
Share on other sites
Do you know what kind of barcode do I have to write in order to have the CR,LF at the end? Now I am writing 1013, that is the suffix in the specifications. The type of code is Code 39. If it doesn't work, shall I put, for example, &10 bytes to store (in the RXD FB) and &10 recieved bytes as end code (in the settings)? My reader supports full handshake, shall I continue with the new pinout?

Share this post


Link to post
Share on other sites
Hello, I think I have a new problem and maybe the solution, As you can see in the pictures above, when I push a little bit the connector a red led starts to shine, This means that if the led if OFF is the connector not working? IS the connector injured?

Share this post


Link to post
Share on other sites
there WILL be a set up option in the scanner to set <CR><LF> after each valid read of a barcode, your Comm port IS looking for this before it will give you what has been read. You WILL need the patch cable between the RS232/USB convertor. I also think your code is incorrect as I have spent quite a while trying to get my own scanner to work! This may help you.

Share this post


Link to post
Share on other sites
have you ever got the bar code reader to work with a normal pc running a terminal program, ie hyperterminal ? I would suggest taking it back to the basics first of being able to confirm the comms with a PC first. that way you will see the data and be able to confirm the comms. Secondly, as was pointed out to you, the USB to RS232 convertor will not work when plugged directly into a PLC RS232 port as the pin allocation is different, yet I noticed in your last post you went back to plugging in directly. That will not work. The cable diagram given as might not work for the following reason: The PLC and the USB RS233 convertor are designed to have a straight through connection for pin 2 and pin 3 (ie in the diagrams for PLC pin 2 (TXD) to PC pin 2 (RXD) and PLC pin 3 (RXD) to PC pin 3 (TXD). THEREFORE since the PLC and USB RS232 convertor have the same pin allocation for pin 2 and pin 3 YOU will need a cross over here - ie PLC pin 2 to USB pin 3, and PLC pin 3 to PC pin 2. The next important connection is the SG as per diagram PLC pin 9 to USB pin 5 Bridge PLC side 4-5 Bridge USB side 4-6 and another bridge USB side 7-8 rxd if wired properly, the RS232 port LED will flash on the PLC when data is received on the comms port regardless if have not executed the RXD function. this will prove if you are getting any data at all to the PLC port

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