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 essential 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 look at Binary Code, all of the bits would be affected, and we would not be sure what number we are looking at for the encoder. Therefore we have lost our position. In Grey Code, only one bit changes, so we can still 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 PLCs are not challenging to learn and understand. We will walk through the numbering systems used in PLCs. This includes Bits, Decimals, Hexadecimal, ASCII, and Floating Points.
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.