BCD output absolute encoder to S7

MALRDG

Member
Join Date
Sep 2008
Location
Melb
Posts
14
Hi all, looking for some suggestions or experience with following issue:

First you should know that the equipment I have here is about 30 years old however having said that, it is quite robust and does a fine job for the application for the time being.

I have an absolute encoder that gives a 4 X 4 bit BCD output.
Presently it inputs to a purpose built positioning card which looks after setpoint/actual values and basic digital control signals which in turn are used by a controller for positioning.

I am upgrading the control system to Siemens S7-300 and at a later date the encoder system will be replaced by drives/encoders. However at this time I want to use the existing encoder signal and do the control in the PLC.

So I need to bring the BCD 4 bit value (that’s 4X4 – 16 points) into the PLC.

My questions are (yes finally I have one!)

  • Is my only option to connect directly to digital Inputs?
  • Does Siemens have some sort of FM module to handle BCD IN?
  • If using inputs, when I read the input word (L IW3) what will I get? A decimal Integer or BCD or what?
  • Does anyone know of a BCD to Profibus (or other protocol) signal converter, perhaps Phoenix Contact? Thinking of a Din rail mount thing.
  • If using PLC inputs, will they be fast enough? (I know you can’t really answer that one without knowing the application and specs but I though I would throw that in just in case someone has tried something similar with or without success!)

Well sorry for the long story, any comments appreciated

 
It's been a while and no answers so I'll contribute what little I can. Maybe this will bump the thread up and someone with more knowledge will see it and can help.

I have supported systems that used a gray-bit absolute encoder wired to 16 digital inputs. They were originally done in GE Series Six and later migrated to the 90-30 platform. I am sure I could dig up some code that would help. Post back if you need it.

Until then, check this out:
http://en.wikipedia.org/wiki/Gray_code
 
I'm not sure if this is what your looking for, but here's a gray code converter library

Retrieve this into your Step7 library folder

Enjoy
 
He didn't mention anything about a Gray encoded output. Mentioning BCD and 4 digits contained in 16 bits makes me think it isn't one.

So he'll have added speed restraints with having to check for a skewed reading. In other words, read the encoder until you have two readings the same (assuming the PLC is fast enough or the system the encoder is measuring is slow enough.) If the encoder is turning so fast that it's unlikely to have two scans on the same reading then you'll have trouble with an ordinary input card.
 
Guys, Gray code is NOT BCD.

BCD stands for Binary Coded Decmial. The number is not converted to the numeric value in binary, every column in a decmial number is converted to a set of 4 binary bits (since 4 is more than enough to encode the 10 values, 0-9 that each decmial column contains). Bascally, instead of converting the whole number into binary, the number is broken down into columns, and each decmial digit, or column is converted to its own binary equivalent.

BCD is something like this:

10 would normally be represented in binary as 1010
In BCD it becomes 0001 0000
That is, 4 bits representing the 10 column, and 4 representing the 1 column.

32 would be 0010 0000 in binary.
32 is 0011 0010 in binary.

Gray Code is the preferred way to ouput from most encoders, since it insures that every encoded position involves only 1 bit difference fro the previous, but BCD is another way of outputting from an absolute encoder.
 
Last edited:
Does anyone know of a BCD to Profibus (or other protocol) signal converter, perhaps Phoenix Contact? Thinking of a Din rail mount thing.
Just to keep apples and oranges separate: BCD is a means of representing data while Profibus is a means of transferring data.
 
The BTI instruction converts BCD to Integer.


For S7-300 there are positional modules like the FM351 for instanmce which take encoder inputs. Unsure of the format as never used them.
 
Last edited:
BCD input to S7

Thanks for the comments gentlemen.
Bernie was correct; the encoder has a 4bit BCD output NOT Gray scale which is totally different (and much more common). In fact like Paul says I have also worked with a Gray scale input to digital inputs on an SLC500 system however I would rather not having to bother with conversion and/or input module response time which is why I did hope that someone knew of a “magic module” to do the job for me!
Conversion within the PLC program is not a problem but hardware real estate is.

Anyhow the application is reasonably slow so I will give the digital inputs-direct a go.

Thanks again to all for your comments.

MALRDG
 
Just as a test can you have the encoder turned continuously at an expected rate?

Then write a program to monitor for a new value more than 1 away from an old value (except for the highest/lowest transition) (time resolution). If you don't see all contiguous values you may have to plan for that.

Look especially for glitches (large number changes) on the multi-bit transitions (the reason for Gray encoders obviously). If you have this you may need to use 'two scans the same' logic.

If you have both problems then this setup may not be optimum.
 

Similar Topics

Hello, I'm using Mitutoyo linear gage counter and I need to communicate it with the PLC to read the measured values. The gage counter has an BCD...
Replies
2
Views
1,344
I am looking for a keypad with display or a counter display with an up and down button that outputs bcd, I am trying to replace two rotary thumb...
Replies
1
Views
1,439
Hello I'm using Mitsubishi. I want to convert BCD from a thumbwheel to the plc to have binary output for my e/p regulator. I've seen the...
Replies
2
Views
1,535
Hi All Ive added my required output sequence list . I want to use a Mitsubishi FX0-30MR-ES with 3 BCD thumbwheel switches and an enter and clear...
Replies
42
Views
7,279
Did a search, but no help anywhere. So, this is a long shot here... I have a BCD switch from Slo-Syn (Previously Superior Electric, previously...
Replies
0
Views
4,989
Back
Top Bottom