Reading/changing timer values in S7 "TON"

WilsonNC

Member
Join Date
Dec 2010
Location
Murphy
Posts
24
I am trying to set a timer in S7 for 30 seconds. i have blocks that nead to read this accumulated value as it timing, and perform some other functions. any way to do this? also how can I program the value of the setting time. I ma using ths SFB4 "TON" function bblock. It has addresss for these variables but they are of the "time" data type. how can I read or modify these?
 
TIME - (IEC time) - 32 bits IEC time in steps of 1 ms.

From this I presume its a DW where 1 = 1mS, 190000 = 190000mS, etc
 
I am trying to set a timer in S7 for 30 seconds. i have blocks that nead to read this accumulated value as it timing, and perform some other functions. any way to do this? also how can I program the value of the setting time. I ma using ths SFB4 "TON" function bblock. It has addresss for these variables but they are of the "time" data type. how can I read or modify these?

Look under the >downloads>siemens>
There's an AB style timer for you to use

Nice and simple
Counts up and has a "done" bit
 
Look under the >downloads>siemens>
There's an AB style timer for you to use

Nice and simple
Counts up and has a "done" bit


Just took a look at that and I'm sorry I cannot see any advantage of using a FC which utilises a Siemens timer internally over using SFB4.
 
Look at it again
It has a time base setting
He can use an int for the time
And he is use to AB terms

My 2 cents
 
Create your own FB as a wrapper for SFB4 but use DINT variables for the times instead of TIME variables.

Example attached:
 
Look at it again
It has a time base setting
He can use an int for the time
And he is use to AB terms

My 2 cents


The time base setting is as per S5TIME, the block possibly uses the two FC's that are with it (I can't be bothered to unlock the code to see). The fact its locked I don't like.

If you want an AB timer then buy an AB PLC, if you want to use a Siemens PLC then use the tools available or build your own (learn more).
 
Now thats funny
Then dont use the dam** thing :)

The idea is that from his previous posts is that he's an AB programmer
He previously asked for AB limit blocks..etc

This was supposed to help him
 
He did not ask ab limit block, but block that does same that ab limit block. Eg, block itself could be programmed in Siemens way not AB way. Get the difference? But using blocks that are not programmed in good way... s5 timers? really that is fossil from s5 days, dont use it if you dont really really need to.

Now he asked how to use SFB4, not that he would be taught s5 timers.

Btw I have nothing agaist AB, I have all against trying to fit square trough circular hole.
 
Just to throw a different slant on it, i tend to just create my own little FC with an internal counter and just pulse a clock bit into it, seems easier than farting about with time values IMHO :whistle:

LH(y)
 
Wilson, it is not so that rules would be any different. But rules can be enforced in lad/fbd editor, there is option to turn it off too, but i would not recommend it. Type checking is to make sure you know what you are doing.
 

Similar Topics

I am beginner in B&R Automation Studio and TIA Portal. Have an experience in electrical part of PLC cabinets. Now its time to get a new skills...
Replies
8
Views
1,684
Hello I have a s7-1200 and I would like to read the tags present in this controller with my controllogix controller. The two controllers don't use...
Replies
5
Views
182
Hi all, i have 8 CJ2m plc units that show different numbers on the plc display and i am stuck on reading the info. my unit has an ip address of...
Replies
3
Views
125
Hi Everyone, I am not proficient in RSLogix 500 so I have a question regarding the evaluation of N7:0 data as an input. So as I understand in...
Replies
1
Views
108
Trying to setup a message read via Ethernet. I have the path setup as 1, 1, 2, 192.168.66.10 I get an error code 1, ext err 315. I am beating...
Replies
9
Views
253
Back
Top Bottom