encoder + 24v dc motor + mega = posable proect

well i just got done trying the pin outs for the encoder at 3.3v first then 5v using analog read to check each pin for a Fluctuating value no response had readings from 377 to 1009 and 754 steady and using digital read i got no further got some that stated high and others that stayed low ? hmm must be doing some thing wrong

ill try to duplicate the sticker pin outs

pin 1 +V pin3 = A pin5 = B pin7 =Z and 1 blak and white wire it calse drain shiled gos to case as it says
pin 2 com pin4 = A pin6 = B pin8 =Z
does this make sense ?