Help with timers and counters in STEP7

Lyle

Member
Join Date
Jan 2007
Location
Johannesburg
Posts
39
Im using STEP7 and ladder logic for my program.I need to start a timer when a bit is set.When the timer has elasped it must set the counter to increment.Once the counter has incremented the timer must start again until the counter has reached its value determined by my calculations.Please help.
 
Here's a start for the timer/counter logic. You will have to provide your own logic for the comparison and resetting the counter.

timecount.JPG
 
still got problems

Do you guys have anymore ideas that could work as i got the timer to work with the counter in that it only counts up once.Even though the timer repeats to do that line again it will not count up again.
 
booth these designs should work what is your preset value to the counter? You can monitor that value beacausse if its 1 the counter will only count to 1
 
bara - In S7 300/400 plc's the timers update asynchronously to the scan of the program. This means that T1 may be at a different state at different parts of the program - this is why I have used M1.0 as the state of the timer in other networks. Using T1 instead of M1.0 in my posted code does not work (in the simulator). I can't comment on the S7200 range.
 
Cpu

I am using the S7-300 cpu.I got the program working so thanks for your help.You are right L D[AR2,P#0.0] you cant use T1 in the simulator. Thanks guys.
 
For the knowledge in S7-200 it´s only the 1ms resoulution timers that updates asynchronously.


From the system manual:

"Since the current value and T-bit of a 1-ms timer are updated by a system routine(independent from the programmable logic controller scan and the user program), the current value and T-bits of these timers can be updated anywhere in the scan and are updated more than once per scan if the scan time exceeds one millisecond. Therefore, these values are not guaranteed to remain constant throughout a given execution of the main user program."​
"Updating Timers with 10-ms Resolution
The S7-200 CPU provides timers that count the number of 10-ms intervals that have elapsed since the active 10-ms timer was enabled. These timers are updated at the beginning of each scan by adding the accumulated number of 10-ms intervals (since the beginning of the previous scan) to the current value for the timer. Since the current value of an active 10-ms timer is updated at the beginning of the scan, the update is automatic. Once a 10-ms timer is enabled, execution of the timer’s controlling TON/TONR instruction is required only to control the enabled or disabled state of the timer. Unlike the 1-ms timers, a 10-ms timer’s current value is updated only once per scan and remains constant throughout a given execution of the main user program. A reset of an enabled 10-ms timer turns it off, resets its current value to zero, and clears its T-bit"
 

Similar Topics

Hi, I have a project that i have to use a Mitsubishi FX3G with GX WORKS2, wich i never worked with before. I´ve been working with TIA Portal...
Replies
0
Views
2,998
I am an aspiring control systems engineer. I have a lab right now that we use plcs and programs to control what motors do. I am racking my brain...
Replies
16
Views
4,632
I'm programming a PLC in zeliosoft 2 using the FBD mode. I was wondering if anyone knew if it is possible to record the time between two switches...
Replies
13
Views
2,807
Hello im new to plc programming with Omron Cx Programmer I have made a program to trigger timers one after the other and repeat the process...
Replies
23
Views
5,652
Hi everyone. Long story short, we are using ladder logic to run an SFC. Due to the nature of an SFC we need about as many timers as we do states...
Replies
4
Views
5,310
Back
Top Bottom