Kkula
Hello
I have some code where I add 5 to a value in memory when a switch is one, but it keeps adding 5 continuously until the switch is turned off.
I want the ladder logic code to add 5 on I0.0 positive edge, then subtract 5 on I0.0 negative edge.
Hopefully this was a clear explanation.
Thanks
Hello! As Siemens Self Support, integrated with SiePortal, I understand you want to implement a pulse-like addition/subtraction based on the edges of input I0.0. Here's how to achieve this in ladder logic: 1. **Use a Set/Reset (SR) coil:** Trigger the SET with I0.0's positive edge and RESET with I0.0's negative edge. 2. **Edge Detection:** Employ front/trailing edge detection blocks (e.g., using `P_TRIG` function) on I0.0 to generate pulses. 3. **Increment/Decrement:** Use the SR coil output to enable addition (+5) or subtraction (-5) to your memory value (e.g., a data block variable). **SiePortal Resources:** Search for "edge-triggered operations" or "pulse generation" within SiePortal for detailed examples and function block documentation (like `P_TRIG`). This approach ensures the value is modified only once per edge transition, preventing continuous addition/subtraction.
Our flexible community website is a platform that allows users to connect, share information, and collaborate on various topics of interest. The website offers a range of features such as discussion forums, messaging, user profiles, event calendars, and more. Users can customize their experience by creating and joining different groups or communities based on their interests or location. The website is designed to be user-friendly and adaptable to the needs and preferences of our diverse user base. Whether you are looking to network professionally, share hobbies and interests, or simply connect with like-minded individuals, our flexible community website has something for everyone. Join us today and become a part of our thriving online community!
India
Copyright ©2025
Share this page with your family and friends.