7/4/2020 10:16 PM  
Joined: 6/20/2020 Last visit: 7/24/2020 Posts: 17 Rating: (0) 
Hello, I can not achieve a mathematical counter every second in a float to calculate the water consumption for a period of time. 1st problem: The result of the first mathematic instruction block is wrong, it should be 15/10 = 1.5 and not 2. I can't get the result in a float ?! 2nd problem: How to indicate the output operand towards the input to increment: Total = Total + operand. Thank you 
7/4/2020 10:22 PM  
Joined: 12/18/2014 Last visit: 8/15/2020 Posts: 19221 Rating: (2051)

The LOGO! cannot do float values, only integers. Therefore it is rounded. 
7/5/2020 6:55 AM  
Joined: 12/18/2014 Last visit: 8/15/2020 Posts: 19221 Rating: (2051)

The LOGO! only execute with integer values. The Block I / F converter generates a float value from an integer value, but the LOGO! cannot use the float value for arithmetic operations. It is only made available for transmission to a Modbus compatible device. Since you have not written where the value in the VW500 comes from and what it represents (integer or float), it can no longer be said. Adding up integer values cannot be done by recursion. This leads to an error message. A possible solution is feedback via the MAX / MIN block. If you then divide the value (after the MAX / MIN block) by 10, you get at least one more precise result. If you want a decimal place for the display, you have to multiply the value from VW500 by 10 and set a decimal place for the display. Maybe the suggestion in the attachment will help you. 
7/5/2020 11:00 PM  
Joined: 6/20/2020 Last visit: 7/24/2020 Posts: 17 Rating: (0) 
Thank you, Because there is only interger, for the first problem, i have to complete in ml/sec instead of liter/sec. With the MIN MAX block, it works very good, but the counter quickly reaches its maximum. Is it possible to increment another counter (traditionnal Up/Down counter) when this mathematic counter exceeds (is greater than or equal) the value of 1000. Example : The mathematic counter is 1026 : Increment counter of litters +1 and carry the excess value for the next count : 1000  1026 = 26 With an Analog compare ? Maybe it's impossible with LOGO. Thanks a lot 
7/6/2020 5:39 AM  
Joined: 12/18/2014 Last visit: 8/15/2020 Posts: 19221 Rating: (2051)

Yes, with a combination of an analog comparator and the mathematical instruction and other blocks is it possible. 
7/9/2020 7:56 AM  
Joined: 3/2/2020 Last visit: 8/10/2020 Posts: 15 Rating: (1) 
If I understand you correctly, you're looking to get a flow rate. Is this right? I've implemented several kinds of flowrate measurment systems, each with it's own pros and cons. To decide which one is best suited for you, we have to answer a few questions first: How often do you want to update the value? (It seems, once a second) How many pulses do you get per second from your measurment device? What's the range? What precission do you need? How much delay is acceptable? Generally: the more pulses you count over a longer time the more precise and stable your result gets but also the longer it takes to measure (and there might be some influence on the update rate). I've attached an example the seems a bit crazy on first glace and relies on a constand cycle time of the PLC. The signals 1/M1 are basically the cycle clock. It's high one cycle and low on the next (therefore fa/2). I've got 1 pulse/ml. I count how many PLC cycles there are between the pulses of the flowmeter. AND I count how many PLCCycles there are in 12s. I than divide the "cycles per 12s" by "cycles per flowmeterpulse" and multiply by 50 (5 would be logical) and get ml/min. Oh yes, and if there are no pulses for 2 seconds I trigger a new calculation with the wiper function. This works because my cycle frequency is much higher than my maximum pulse frequency from the flowmeter. I get quick results but the fluctuate heavily. And it seems that using network communication let's my cycle freqency drop dramatically and makes it somewhat unpredictable. So, this might not work for everyone. Since I'm only using this value for display purposes that's ok, for process control I'm using another kind of measurment that measures the average flow over 20s and updates every 2 seconds. 
7/9/2020 9:54 AM  
Joined: 6/20/2020 Last visit: 7/24/2020 Posts: 17 Rating: (0) 
Merci pour cette réponse rapide Mon objectif est de calculer une consommation d'un système de projection à partir d'une constante de débit théorique. J'ai deux systèmes de projection. Un premier à 15 litres/min avec un temps de projection réglable (entre 1 et 5 secondes). Un second système à 2,4 litres/min pendant un temps réglable (entre 0,1 et 2 secondes) Je pensais faire un compteur incrémentiel sur base de temps rapide (0,1sec). A chaque impulsion, un compteur incrémente. Puisqu'on ne peut pas utiliser de flottant, je pense utiliser l'unité des millilitres. Mais comme il y aura beaucoup d'impulsions , à chaque fois que le compteur dépasse 1000ml, j'incrémente un compteur total de Litres. Il ne faut pas oublier de reporter ce qui est supérieur à 1000 Merci de votre aide. 
7/9/2020 9:57 AM  
Joined: 12/18/2014 Last visit: 8/15/2020 Posts: 19221 Rating: (2051)

Why do you not write in English?

7/9/2020 4:59 PM  
Joined: 6/20/2020 Last visit: 7/24/2020 Posts: 17 Rating: (0) 
Oh ! sorry, i wrote in a translator but copy the french text... 
7/9/2020 6:10 PM  
Joined: 2/22/2008 Last visit: 8/14/2020 Posts: 1840 Rating: (136) 
A nice way to add flows for volume calculation or e.g. voltage and current for energy meter you can see in attachment. This is a tank filler for manual or automatic mode another person have asked for. The flow is added every second in an arithmetic block. If full liters are reached, an up counter will be increased and full liter is subtracted from the arithmetic block. To avoid overflow (value>32767), full liters are subtracted up to 8 times per 1secondcylce. Use this program as you need or ask for details, Scorp AttachmentFlow1.zip (7 Downloads) 
This contribution was helpful to1 thankful Users 
Follow us on