Chavak Posted February 7, 2018 Report Posted February 7, 2018 Hi, I am reading from a 10 bit gray encoder using normal input card and convert it in a CJ2M PLC using GRAY_BIN Now I need to scale the value which reads 0 to 1023 to a range of 0 to 359. I couldn't figure out how should I go about this. Please help Thank You Best Regards _____________
Chavak Posted February 7, 2018 Author Report Posted February 7, 2018 4 hours ago, BobB said: In the encoder? No, I guess no option for that. I'm using an Elcis encoder. I was trying to do it in CX-Programmer. Regards ________
IO_Rack Posted February 7, 2018 Report Posted February 7, 2018 (edited) Annotation number 2 should read, "Scale the REAL Encoder value..." Edited February 7, 2018 by IO_Rack 1
BobB Posted February 7, 2018 Report Posted February 7, 2018 OK - it is just that the last encoders I used were scaleable in the encoder - made it easy.
Chavak Posted February 8, 2018 Author Report Posted February 8, 2018 Thankyou IO_Rack and Bob. Your solution works just fine. Never thought a simple plain division can solve this. Thank You Best Regards _____________
IO_Rack Posted February 8, 2018 Report Posted February 8, 2018 You're welcome. In this case it is fairly easy because the minimum value for Input and Output are both Zero. If you need to do more complex scaling then you may choose to use a custom Function Block. There are a couple of them in the Downloads section of this forum.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now