Gray code encoder question

Hi I have a question about a gray code absolute 8 bit encoder. The encoder is connected to 8 inputs on an Allen Bradley PLC. if you turn the encoder 1 full turn it will count from 0 up to 255 but then instead of returning to zero it starts counting backwards on the next turn until it gets to zero and then on the next turn starts counting up again. I have 2 machines which both seem to work like this. Will this be a special encoder or is this done in software?
 
This is probably not answering your question but typically, one would get a special encoder PLC module.

Since you said it "works". i"m curious. The PLC logic must be tracking the phase, right?
 
I'm not that familiar with allen bradley but the physical inputs seem to be programmed into a special gray code block (which i cant open) and then in other blocks and on the HMI i can see a decimal position for the encoder. The input card is just a standard input card.
 
You're probably seeing the negative numbers because you're looking at a SINT datatype tag (which is an 8-bit Signed integer) and the actual underlying bits do not represent an integer at all, but rather a Gray Code bit pattern.

The protected instruction is just a decoder for the Gray Code. You should be able to just leave it alone and use the integer position output value.
 
Google 'Gray Code' to better understand what you are seeing. The raw value from the encoder can be confusing. Any images of the code disks from online articles should give you a better feel for the situation.
 
look in the software as the position should be the variable, and when an overflow it should be checked if it is a psoitive one or a negative turn.
and listin to bernie and ken
 

Similar Topics

Hey guys, Although I've poured through this forum for help in the past this is my first post. I am looking at replacing obsolete Baumer IVO...
6
Replies
3,030
Views
First time I have used an absolute encoder and it is definitely:banghead:. I have a Siemens 6FX2001-5FN25...
21
Replies
9,345
Views
I am migrating a PLC-5 to CLX. I do not have the option of changing out the existing encoders (845D-SJHZ25AGCW4). 8-24v DC, 256...
0
Replies
2,146
Views
Any recommendation on using a gray code encoder as input to a compactlogix PLC to trigger a digital input every 15 degree position on a rotary...
3
Replies
3,767
Views
Hi, Currently i have a Nemicon 10 bits Gray code absolute encoder, and the conversion between Gray code to binary code works fine. Now, we buy a...
9
Replies
5,150
Views
Top