Jump to content

Using counters / SPD_M funtion maybe for rotational speed ?


Recommended Posts

Posted (edited)
Hello all, I've been trying to program a counter for a while which can count the pulses from a water flow rate meter. The flow meter measures between 2 and 20 litres / minute and gives out a pulse train frequency of between 22.5 hz and 225 hz which correspond subsequently to these flow rates. I haven't programmed a counter before so not sure how best to do it. I've looked at functions for the high speed processing like the speed function (SPD_M) and also the HSCS and HSCR (High speed counter SET and RESET) but not really sure how best to use these. I can wire the meter to input X0 which can use a high speed counter and I think this corresponds to C235. I've been trying to use the SPD counter with "water flow pulses" (X0) on pin s1 and 1000 (ms) on s2 so that it looks at the amount of pulses in 1 second and then output to d (pulses per second). I could then work out the Litres / Min with a linear multiplier. The output of this SPD function takes an ARRAY of word length but not sure what this is. When I monitor it is says "structure" and I cant see any data in the chosen d register for pulses in a second when I look in the registers. Any ideas of the best way to program this ? I think I'm making life hard as this should be very straight forward, Many thanks for any input, Ben Edited by BenJones

Posted
Hi INTELLE, That looks like exactly the kind of thing I'm after ! Is there any way to upload that logic (in the pdf file) into GX IEC Developer and view it as ladder logic in a diagramatic kind of format? I find it hard to read this kind of instruction list program. Thanks, Ben
Posted
Would it not be easier to use the SPD function like KAARE explained in the earlier post ? If I used this, I'd have X0 on s1 (BOOL input), k1000 (ms) (1 sec) on s2, and "output pulses / sec" to d. Is that not correct ? The thing is I dont understand how the program saves to "d". Is this as an ARRAY ? It doesn't seem to simply save the numbers per second as an integer in a d register. It says "structure" when I monitor it and I don't undertand what this means. Thanks again, Ben
Posted
Ben, I'll try to find these programs on my PC, but I can to do it any later, because I'm a little bit busy now. Also I can do the appropriate function block for IEC Developer. Do you want to calculate current flowrate or total consumption, or both of them?
Posted
Of course, you can calculate frequency of pulses with SPD and then to multiply value for calculation of current flowrate. The output of SPD function is an ARRAY with two elements.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...