Bratt
Lifetime Supporting Member
I have a problem with a resolver connected to a ET200s counter module. I want to convert the value from the resolver to 0-->359 degrees and then start over. The axis can turn both backwards and forwards.
The following formula works the only problem is when the counter card hits the max value of +2147483647 its starts over and begins counting from -2147483648. The problem is that the value then reverses and begin counting backwards. The same goes when it hits min value -2147483648 then it starts over from +2147483647.
Anyone got any ideas?
The following formula works the only problem is when the counter card hits the max value of +2147483647 its starts over and begins counting from -2147483648. The problem is that the value then reverses and begin counting backwards. The same goes when it hits min value -2147483648 then it starts over from +2147483647.
Anyone got any ideas?
Code:
L #Encoder.Feedback.Count_Val // Value from counter card
L L#1040 // One turn on the resolver will give 1040 pulses
/D
L L#360 // Mod to get it to count from 0 to 359 and then start over
MOD
T #oVALUE // Value 0 to 359