mikecbmc Posted December 28, 2015 Report Share Posted December 28, 2015 I have a meter inputting 48,000 pulses per minute into a DI-16 high speed counter terminal and am having trouble converting this data into a long on the V1210. I tried to have a MI count up to 30000 then reset to zero and increment a multiplier to keep total pulse count. I end up missing pulses during the reset function. Also if I set to close to the limit of a MI then it rolls over before the multiplier can register. I am using greater than compares. Is there an easier way to convert a MI to ML over EXRC1? Thanks Link to comment Share on other sites More sharing options...
Guy Sela Posted December 28, 2015 Report Share Posted December 28, 2015 Dear Mike, thank you for contacting Unitronics Support. Can you please send us your email? I would like to send you an example that will be suitable to your request. You can also reach us at support@unitronics.com Guy Sela Link to comment Share on other sites More sharing options...
Guy Sela Posted January 3, 2016 Report Share Posted January 3, 2016 Dear Mike, Please see the attached project. Using EX-RC1 with DI-16 high speed counter using ML. Best Regards. Guy Sela virtual Counter.vlp Link to comment Share on other sites More sharing options...
mikecbmc Posted January 4, 2016 Author Report Share Posted January 4, 2016 Guy, What happens when MI0 turns rolls over to a negative and MI2 is at the upper end of the MI range for a scan? This would cause a large value to be inserted into the second formula and thus inaccurate? What am I missing? Thanks Michael. Link to comment Share on other sites More sharing options...
Guy Sela Posted January 4, 2016 Report Share Posted January 4, 2016 Hi Michael, MI0 holds the real counter, it is using MI2 as a buffer that holds the difference between the real count to the counts that where added in ML0. The count than is added to ML1 that is in absolute value, than MI0 is stored to MI2 for a new count that will hold the deference between the counts. When MI0 will roll over it will not have any effect on ML1 (Virtual counter) sign. the formula for this project is: MI0 - MI2 = ML0 ML0 + |ML1| = ML1 MI0 = MI2 Please see the attached project. Is NET3 you can trigger MB0 to simulate running counter, you will see that MI0(out) will roll over at 32767 (you can use MB1 to increment by one), the result ML1 (Virtual Counter) will not change it`s sign. virtual Counter.vlp Link to comment Share on other sites More sharing options...
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