carlkaranja Posted May 28, 2015 Report Share Posted May 28, 2015 hi, am working on a project whereby am using a flow sensor to give me pulses to calculate flow rate. my challege is when the number is too big it goes negative, i think after +32767, what can i do to achive my goal without this number and my program become accurate. please assist anything you need to know let me know. Quote Link to comment Share on other sites More sharing options...
Alexander Posted May 28, 2015 Report Share Posted May 28, 2015 Which controller are you using? If you are using the Jazz or M91 you may be able to use a U90 Special Function to combine two MI's into a ML within the ladder. You can find the instructions in the U90 Help file under Ladder/ Functions/ Special Functions: without Elements/ 'Long' Integer functions. Also possible would be to use a secondary counter to represent large values such as 10,000, 20,000, or 30,000. A comparison statement could be used so that every 10,000 pulses, a secondary counter would increase by 1. Then the count could be reset. This would involve using multiple comparison statements later to compare the numbers, but may work as a solution. Quote Link to comment Share on other sites More sharing options...
MVP 2022 Joe Tauser Posted May 29, 2015 MVP 2022 Report Share Posted May 29, 2015 It would also be helpful if you posted your code. Joe T. Quote Link to comment Share on other sites More sharing options...
carlkaranja Posted July 19, 2015 Author Report Share Posted July 19, 2015 Thanks am working with samba and its doing fine with my projects. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.