S7 use of timers in AND functions

bgkdavis

Member
Join Date
Jan 2012
Location
brisbane
Posts
13
What is the effect of a Tnn input to an AND function instead of a bit, I'm guessing its one of the following

Im also seeing timer and counter addresses used for NO and NC relays instead of bits, which Im guessing follow a similar logical function


a) if the timer Tnn is 'done' then the bit is high
b) if the value of Tnn is non zero then the bit is high... ie if the timer is active
 
likewise Im also looking at the useage of counters in STL as follows

A "M0.1"
A "Z6"
CD "Z6"
AN "M8.4"
R "Z6"

The use of the A "Z6" suggests that its high when Z6 is non zero, as counting down when the counter is 'done' doesnt make sense
 
I know that using the Timer's address with the those boolean instructions, the address is 1 when the timer is done. SO I think it's correct to say that it's true with counters as well. (But we all know that making logical conclusions like that doesn't mean anything when it comes to using Step 7!).

As for counting down when the counter is "done" not making sense, it makes perfect sense. Count up until it's done (other pieces of code). If it's down, and something occurs, count down. I could see reasons to do this.
 
Thanks, I can see your point about counting down when counter done, it would indeed suggest a back step function... but surely an up counter is done when it reaches nn and a down counter is done when it reaches zero, so this function would only facilitate a back step between nn to nn-1, and would only proceed to the reset

however, I've done a little more reading on the CU and CD functions, in stl they only change the POU to 1 when they reach 0 and 999 respectively, other than this neither appear to have a done flag.....

I guess its possible that timer are high when done and counter are high when they are non zero, however since timers cant count below 0 this makes the A "Z6" line a little redundant

unfortunately I'm trying to transcribe someone elses S7 code which is a mixture of FBD and STL to AB ladder, and getting stuck with these functional issues
 
With the timer it depends on the timer:

TON (Time On) it is when its done
TOF (Time Off) its when its timing and when the input is true
TP (Timed pulse) again when its timing

Counters are true when the accumulated value is greater than zero, which is why most applications that use a timer set it and then count down.


Put your cursor on the instruction and press 'F1' the full explanation will magically appear.
 
With the timer it depends on the timer:

TON (Time On) it is when its done
TOF (Time Off) its when its timing and when the input is true
TP (Timed pulse) again when its timing

Counters are true when the accumulated value is greater than zero, which is why most applications that use a timer set it and then count down.

Put your cursor on the instruction and press 'F1' the full explanation will magically appear.


Thanks, I believe this explanation best fits my own logical analysis of the code, the 'F1' tip sounds great, .....does it work on PDFs :D

The code I'm translating uses both S_ODT and S_OFFDT (on/off delay timers).... I'm trusting that the original author hasn't tried to use both on the same timer address....would this be possible?, what would the answer be if a T address was used by both (other than sacking the original programmer)
 
another question in a similar light

looking at the following STL

L "T33"
L 535
>=I
= "M21.0"

T33 is an SD function set to 6 Seconds

My interpretation of this is is t33 >= 5.35seconds then set M21.0 high, this is pretty confusing because T33 appears to have multiple functions or values depending on how its being used
 
Thanks, I believe this explanation best fits my own logical analysis of the code, the 'F1' tip sounds great, .....does it work on PDFs :D

The code I'm translating uses both S_ODT and S_OFFDT (on/off delay timers).... I'm trusting that the original author hasn't tried to use both on the same timer address....would this be possible?, what would the answer be if a T address was used by both (other than sacking the original programmer)

They would screw each other up. The timer starts with the rising edge of the input conditions.
 
I would suggest doing a search for S5Time, there are quite a few descriptors here.

The timers a BCD number and the preset includes a code to determine the range.

I would normally use IEC timers, which are in the SFB library.
 

Similar Topics

Greetings, I am coding for S7-300 CPU315-2 DP and I have come to an impasse. I made a function to generate pulses of varying duty cycle. As an...
Replies
4
Views
3,337
Hi, I'm quite new to Rockwell PLC and currently trying to implement the following if Sw1 then for i:=1 to 20 by 1 do xEnable := 1...
Replies
9
Views
363
I'm writing some alterations to an FPWin program and need to see the running value of timers so I can set them correctly. It's my first time with...
Replies
0
Views
131
Hi everyone I am using Winproladder software for programming FATEK FBs PLCs and in programming, we often use Timers for activation of the...
Replies
4
Views
577
Hi all, I have what is likely not a complex issue, but I am working in Automation Studio and want an accumulating/retentive timer when a...
Replies
17
Views
1,912
Back
Top Bottom