Bar code reader and PLC

dayanyan

Member
Join Date
Dec 2010
Location
Metro Manila
Posts
4
Hello everyone! I'm very, VERY new to programming PLCs so I hope you bear my questions.

I'm using a NaiS FP2 PLC and Metrologic IS4225 bar code reader. I connected the two via RS232 and made a program (through FPWIN Pro) whose goal is to store information received by the bar code reader to a memory in the PLC. Simple enough, but I seem to be having trouble and I don't know whether or not it's because of my transmission settings or the program where it stores the information into the memory.

The bar code reader's transmission settings is as follows:
  • space parity
  • 9600 bps
  • 7 data bits
  • 2 stop data bits

While the PLC has the following:
  • odd parity
  • 9600 bps
  • 8 data bits
  • 1 stop data bits

I configured the bar code reader to odd parity since the PLC's settings only has (odd, even, non and 0) parity. The rest, I followed the bar code reader's default settings. Did I understand this correctly? This is actually the first time I encountered a 'space' parity so I didn't know what to make of it.

As for the storing of information itself, my question is does the bar code reader automatically converts the information into ASCII format?

I'm sorry for the long post! Any reply would be greatly appreciated. :)
 
Hi dayanyan,

I think what you did was right, its pretty important that both the hardware be having identical settings. I have few questions:
1. Are you having data on your data storage via plc?
2. Have you tried connecting the barcode to a pc and try reading codes via notepad or hyperlink?

As to your question on if reader converts directly info to ASCII, I have tried a barcode application before using plc & hmi (it was a mitsubishi FX2N plc & GOT1000 hmi) but the data is not being stored as ASCII rather decimal. If its important for you to keep/store it in ASCII, you need to convert it. But I'm not sure about what your using, better asks gurus around this forum.
 
Last edited:
Sir theripley, thank you! It worked on the hyperterminal so I was wondering why it didn't work on the PLC. Turned out my pinout was wrong. :p
 
Space (and Mark) parity simply mean that a parity bit is present but not managed. When Space is specified, the parity bit is always false, when Mark is used the parity bit is always true.

http://en.wikipedia.org/wiki/Parity_bit

You should be able to properly read and interpret the characters from the bar code reader if you set the PLC side to 8 data bits and no parity. The PLC will treat the parity bit as the eighth data bit.
 
Sir theripley, thank you! It worked on the hyperterminal so I was wondering why it didn't work on the PLC. Turned out my pinout was wrong. :p


Are you using usb connection to pc?..better try an rs-232c barcode to pc if it still reads..If it does, then I think there is no problem with your cable but rather on your program..The data is not being transmitted from your reader to the plc..I advise you look for sample programs on the software you are using..In mitsubishi luckily "meron"..

Anyway, are you using hmi to display your reader data?..if not, then the programming will be a lot easier..

Sorry, I am not familiar with the software you're using so I could not give precise answers..
 
Reading your post again, it looks to me you have different hardware setting. Both should have identical setting, if there is no space parity on your plc better change your barcode setting to something else that would be equal to that of plc.

I suggest you also read the barcode manual. In my case, it took me two (2) weeks to finally make it working.
 
The attached image shows the lineup of the two settings. While the bar code reader would be sending a constant stop bit level at the next to last position the PLC would be expecting a parity bit according to the rules for odd parity. Thus about half of the characters transmitted would be rejected for incorrect parity.

Serial Settings.JPG
 

Similar Topics

I am trying to connect the bar-code reader intermec sr61 with the micrologix 1100 but, the channel 0 indication is not blinking where the bar-code...
Replies
0
Views
1,163
We are using Sick CLX series bar code reader with AB 1746-BAS module in a outdated system . The processor is SLC 5/04.We want to revamp the system...
Replies
1
Views
1,459
I have a Keyence SR-710 Bar Code Reader and a Keyence N-UB Communication unit. It will read the bar code and turn on the success output every...
Replies
3
Views
2,665
I have had an interesting request from a customer. I have sold them a graphite based system and he was wondering if we can use a bar code reader...
Replies
3
Views
1,543
Can anyone give me a sample program to use with control logix to use this bar code reader to take readings when requested
Replies
2
Views
5,024
Back
Top Bottom