HCBBS Forum (English)
Submit Chemical Projects / Find Solutions
Amplify Your Requirements on a Broader Chemical Platform *Engineering · Technology · Equipment · Solutions*
Submit Request

How to make the analog input of S7-200 accumulate to a certain value before outputting a digital signal

2019-01-22View Original

Thread Content

Dear experts, I have a set of useless S7-200 units. There’s a flow accumulation controller on site that needs to be modified. The flow meter there provides a 4-20MA signal continuously; once this signal reaches the set value, a DO signal is generated, which in turn controls the pump to stop or the valve to close. In the next cycle, when the start button is pressed, the flow meter automatically resets and starts accumulating values again, and this cycle repeats. How should this PLC program be written? handshake
Reply #22019-01-23
Based on your description, the program logic involves performing accumulation—comparing the accumulated value with a set value—and outputting the result to DO. To carry out the accumulation, the measured flow rate is first converted into an actual flow rate; simply put, an addition is performed once per second. Place it in a fixed tag, and increase the actual flow rate once per second. For resetting, create a button to enter a value from 0 up to a fixed range; compare this value with the preset value. Connect the cumulative value and the preset value to the two input pins respectively. You can achieve this by using an appropriate comparison module, and then output a BOOL value to the DO terminal – this step is quite simple
Reply #32019-01-23
Based on your description, the program logic involves performing accumulation—comparing the accumulated value with a set value—and outputting the result to DO. To carry out the accumulation, the measured flow rate is first converted into an actual flow rate; simply put, an addition is performed once per second. Place it in a fixed tag, and increase the actual flow rate once per second. For resetting, create a button to enter a value from 0 up to a fixed range; compare this value with the preset value. Connect the cumulative value and the preset value to the two input pins respectively. You can achieve this by using an appropriate comparison module, and then output a BOOL value to the DO terminal – this step is quite simple
Reply #42019-01-23
The general programming approach is as follows: Initialize the data (reset the cumulative value), enter a loop (read the AI signal, convert it to actual values, accumulate them, and compare them; if the conditions are met, exit the loop), set DO to 1, reset the cumulative value, wait for a delay, set DO to 0, and then return to the loop.

Submit a Project

**Looking for Chemical Technology, Equipment & Solutions?** No Registration Required Broader Platform Exposure | Global Chemical Service Provider Connections

Submit Request — Free Consultation

Disclaimer

This is an automated machine translation of the original thread. Some technical terms may have inaccuracies; the original text shall prevail. Click "View Original" at the top right to access the source page, which supports IP-based automatic real-time language translation. Please watch out for contact details and sales inducements to prevent fraud. All content and translations are for reference only, representing solely the poster's personal views. For enquiries, email service@hcbbs.com.