Grey Code is used because only one bit of data will change at a time. The following chart shows the conversion of Grey Code to Binary.
|Number||Binary Code||Grey Code||Number||Binary Code||Grey Code|
It is important for absolute encoders because if the power is interrupted the encoder will know where it is within the one bit.
Power is interrupted when the encoder is between 7 and 8. If we are looking at Binary Code all of the bits would be effected and we would not be sure as to what number we are looking at for the encoder. Therefore we have lost position. In Grey Code only one bit changes so we will still be able to tell if we were on 7 or 8 if the power was interrupted.
The following sample PLC program will convert 4 bit grey code into binary code.
This code was written in an Automation Direct PLC software called Do-more Designer.
Contact me for the above program. I will be happy to email it to you.
If you’re like most of my readers, you’re committed to learning about technology. Numbering systems used in PLC’s are not difficult to learn and understand. We will walk through the numbering systems used in PLCs. This includes Bits, Decimal, Hexadecimal, ASCII and Floating Point.
To get this free article, subscribe to my free email newsletter.
Use the information to inform other people how numbering systems work. Sign up now.
The ‘Robust Data Logging for Free’ eBook is also available as a free download. The link is included when you subscribe to ACC Automation.