
adccommunitymod (AutomationDirect) asked a question.
Created Date: February 29,2016
Created By: JLG
**** This post has been imported from our legacy forum. Information in this post may be outdated and links contained in the post may no longer work.****
I have a setup counting pulses from an encoder in a DL05. I want to take the counted pulses and convert them to feet and inches to display feedback to the operator, however, the MATHBCD box isn't correctly calculating it. To the best of my knowledge, to do this I'm going to have to be able to manipulate real numbers and use rounding functions and such. There is a MATHR instruction, but selecting it gives me the message "Instruction is not valid for the current PLC ". Is there any available methods to do this?
Created Date: February 29,2016
Created by: Mike Nash
It is possible, but painful. I have done something similar and it involves playing with quotients and remainders and divide doubles and multiply doubles and add doubles. Sprinkle in a handful of POPs and you get a quasi-longhand divide. My routine was a little different than you are looking for.
Best advice, replace the 05 with an 06.
Created Date: March 01,2016
Created by: JLG
Thanks for the advice. It was good to know it is possible, and I managed to get it using a series of LDD's OUTD's, MULD's and DIVD's and multiplying my pulses by 1000 prior to anything and divided it out at the end(to avoid using decimals).
Created Date: February 29,2016
Created by: JLG
I have a setup counting pulses from an encoder in a DL05.
I want to take the counted pulses and convert them to feet and inches to display feedback to the operator, however, the MATHBCD box isn't correctly calculating it. To the best of my knowledge, to do this I'm going to have to be able to manipulate real numbers and use rounding functions and such.
There is a MATHR instruction, but selecting it gives me the message "Instruction is not valid for the current PLC ".
Is there any available methods to do this?