Hello, I want to thank everyone for their assistance. I am becoming more comfortable with the S7-300 PLC. In the meantime, I have completed a course on TIA for a new machine featuring S7-1500 and I am impressed with the capabilities of the TIA portal. However, I am facing challenges with my S7-300 PLCs. I am seeking guidance on creating logic to generate a pulse every half-second based on accumulated time. In Rockwell systems, there is a retentive timer that holds the accumulated value when the input (enable) toggles on and off, and resets the cumulative value to zero with a timer reset. I have experimented with various timers in the S7-300, but have not found a suitable solution. How can a logic rung be set up to achieve this? How can a pulse be triggered for every 500 milliseconds of accumulated value? I am open to utilizing a combination of timers, counters, adders, and other functions, but I am struggling to implement this without complex coding. Any guidance or suggestions would be greatly appreciated. Thank you!
Please note that my expertise lies in working with STEP7 Classic for PLCs such as the S7-300 or S7-400. Within STEP7 Classic, there is a helpful library known as TI-S7 that includes a block called FC80 TONR. While I am unsure of its compatibility with or availability in TIA, the code in TONR is relatively straightforward. By following the same principles, you can create your own version. Essentially, in OB1, you must transfer the local variable #OB1_PREV_CYCLE to a global INT variable (marker). This allows you to increment the timer value during each scan.
On other platforms where there is no Real-Time Operating System (RTO), I have implemented a method using a one-second timer to accurately count up. By continuously running the timer and triggering the counter conditionally, you can avoid losing valuable time during the start and stop process. Through my testing on a CLX system for a month, I have found that this technique only resulted in a 2-second discrepancy over tens of thousands of starts and stops. Utilize the counter accumulator feature to reset and maintain accurate timing measurements.
JesperMP mentioned that when working with an S7-300 or S7-400 PLC, they specifically use STEP7 Classic. Within STEP7 Classic, there is a library known as TI-S7 that contains a block called FC80 TONR. It is uncertain if this block is compatible with or available in TIA. The code within TONR is relatively straightforward, allowing users to create their own based on similar principles. To achieve this, one must transfer the local variable #OB1_PREV_CYCLE to a global INT variable (marker) within OB1. This marker can then be utilized to increment the timer value in each scan. I will explore the library for the "converting block," even though the Step 7 version I am using is not in the TIA portal but rather in 5.4 on an XP VM.
Hi there, it's fantastic to hear that you're making strides with the S7-300 PLCs and the TIA portal. To generate a pulse every half a second based on accumulated time, the S7-300 PLCs have a SFB (System Function Block) called SFB 5 which is equivalent to the retentive timer that you are familiar with Rockwell systems. You can use this to create a logic rung. With SFB 5, the accumulated value will hold until the set value is reached, triggering the pulse at the set intervals. This eliminates the need for creating complex codes using multiple timers, counters, adders, and other functions. You just need to become comfortable with how SFB is used and controlled within the PLC environment. I'd suggest exploring the Indirect addressing in the PLC controller alongside mastering SFB 5 for further ease and efficiency. Happy coding!
It sounds like you're making excellent progress with the S7-300 PLC! Creating a pulse every half-second based on accumulated time can be set up using a Pulse Timer (S_PULSE) which will produce a pulse every 500ms when the input condition is true. You may also want to consider utilizing the System Function Blocks (SFBs) such as SFB 5 'TP' or 'TON', which are retentive timers. For your reset issue, you could use a separate rung and use a 'SET' instruction to reset your timers each time the reset condition is met. In this scenario, no complex coding is required as you just need to properly utilize the available SFBs and basic logic functions. Hopefully, this steers you in the right direction, and keep up the good work!
It's great to hear about your progress with the S7-300 and the TIA portal! Now, coming to your challenge, if I understand you correctly, you want to mimic the functionality of a retentive timer in Siemens platform, which can be a little tricky. One way you can achieve this with the S7-300 is by combining standard timers and a memory bit. Essentially, you would set up a standard timer to run for 500 milliseconds. When this timer finishes, it would trigger a pulse and toggle a memory bit. Then, when the input toggles off, instead of resetting the timer, you'd only reset the memory bit. Then, when the input toggles on again, the timer would start again, but only because the memory bit had been toggled back on. It may not be the most straightforward solution, but I hope this helps. Don't hesitate to reach out if you have further questions!
✅ Work Order Management
✅ Asset Tracking
✅ Preventive Maintenance
✅ Inspection Report
We have received your information. We will share Schedule Demo details on your Mail Id.
Answer: - To achieve this in S7-300 PLCs, you can set up a logic rung using timers, counters, adders, and other functions. You may need to utilize a combination of these elements to create the desired pulse every 500 milliseconds based on accumulated time.
Answer: - While S7-300 PLCs do not have a specific retentive timer function like Rockwell systems, you can still achieve similar functionality by using timers and counters effectively in your logic programming.
Answer: - You can simulate the behavior of holding the accumulated value when the input toggles on and off by carefully designing your logic using timers and counters to maintain the accumulated value until it needs to be reset.
Answer: - While implementing the pulse generation logic in S7-300 PLCs may require a thoughtful combination of timers, counters, and other functions, you can simplify the process by breaking down the task into smaller subtasks and implementing each part step by step. Keep the logic as clear and concise as possible to avoid unnecessary complexity
Join hundreds of satisfied customers who have transformed their maintenance processes.
Sign up today and start optimizing your workflow.