Siemens S7 Timer Questions

GTX

Member
Join Date
Dec 2003
Posts
36
Hi

I am working with a S7-314 PLC attached to a TP170B Simatic HMI and programming with Step 7.

What I am trying to do is the following:

1. I created a timer will time to 15 minutes, but i want to dispaly the preset of the timer and the accumulated value in an output box on the HMI. Can this be done with siemens like you can with Allen Bradley ?

2. I want the preset value of the timer mentioned above to be able to be modified. For example, i want to have an input box on the screen where the user can enter a number like 10 (minutes) and the timer will run for 10 minutes.

Thanks for any help !! :)

Barry
 
If you use S5 timers, then you would have to load the timer value from a variable adress into the TV tab (S5TIME format), not from a constant.
You can load the remaining time into a variable from the BI tab (integer format) or the BCD tab (in BCD format).

If you use IEC timers, then you always have the PT (Preset Time) and ET (Expired Time) symbols for each timer. Both use the TIME format.

Notice that an S5 timer, times DOWN. An IEC timer, times UP.
 
Hello GTX,
I do not have Protool available right now, so this is from memory. If I remember correctly, Protool allows an output format of TIME datatype in their output boxes; IEC timers (SFB3/4/5 in the Standard functions library) use the same format for the PT and ET parameters, so you can use them directly.
If you prefer S5Timers (integrated timers of Step7), then you will need to convert from TIME to S5Time datatypes (and back), using FC33 and FC40 in the IEC library.
Hope this helps,
Daniel Chartier
 
edit: STOOOP, what am I saying ???
Protool supports the "timer" format (same as S5TIME).

I'll keep my writings just to let you see how easy it is to get started in the wrong direction.

Old text starts here:
Thats right, I forgot that Protool doesnt have the S5TIME format.
So you would have to do as Daniel suggests.

An alternative approach using S5 timers without going over the TIME format, would be to load the set value from a BCD coded variable limited to 0-999. Then combine it with the desired timebase like this:

L MW100       //Set time from TP170B (limit in the panel to 0-999).
L W#16#0000 //time base 0.01 sec.
//time base 0.1 sec = W#16#1000
//time base 1 sec = W#16#2000
//time base 10 sec = W#16#3000
OW //Combine set time and time base.
T MW102 //Set time used to load into the S5 timer.

 
Last edited:
Thanks for all the help everyone.

I will try your suggestions this week.
 
Last edited:
Alright, i tried your suggestions but i am a bit confused so bare with me :)

Ok i have setup and ouput box on the Touch Panel (HMI TP170B) and i set it up to display timer T16. So when the timer is running the output box displays its value. I have one question about this, i have the timer set for 3 minutes and 30 seconds (210 seconds) so the output box displays 210, which is correct. However, is there a way to make it dispay the number in a minutes:seconds format (ie. 3:30) ?

My next question is, i am trying to setup an input box on the touch screen that i can enter a number into (ranging from 1-15) and i want this number to become the preset time for timer T16 in minutes. For example, if i enter a number in the input box of 5 i want the timer preset to become 5 minutes. Is there a way to do this ?

Oh i am using S5 timers.

Thanks for everyones help !!!
 
GTX,
1. question:
I use IEC timers myself, thats why I am not completely sure how S5 timers settings are set up in Protool.
Its possible to select "Timer" as the tag type, but it doesnt really make sense to me, because an S5 timer has to load its setpoint from somewhere else (a constant or from a MW or DBW address). I think that maybe you have to use the tecnique I described in post #4.

Maybe it is only the remaining time tag that you can select as a "Timer" type. Then I would guess that Protool formats the display according to the time base.
If you are displaying the remaining time via a variable that gets filled with the BI or BCD pins, then it will simply display an interger or BCD value (without timebase info). You therefore have to specify the number of decimals when you set up output field in Protool.

There is no quick and easy way to convert "210 seconds" to "3:30 minutes:seconds". You can do a lot of programming to get the effect, but maybe its not worth the trouble.

2. question:
You can do the conversion in both Protool and the S7 program.
In Protool open the properties for the tag and select "conversion"
specify value ranges for operating unit and PLC.
for example 0-10 (minutes) and 0-600 (seconds) respectively.
 

Similar Topics

Hi! i'm just wondering did there is any chance to change Set Time(TV) on Siemens plc timer without step 7 using c# or python if timer not set in...
Replies
1
Views
1,217
I have been doing Siemens for a while now. Just wondering what everyone prefers and why. I typically stick with the IEC_TIMER, but is there pros...
Replies
11
Views
2,775
Hi there I'm guessing this is a straightforward one but after much experimenting I've been unable to find an answer. The software is TIA V16...
Replies
5
Views
2,249
Tried Googling and searching this forum for the answer to this, but no luck, so figured start a new post to see if anyone can help me...or confirm...
Replies
8
Views
3,328
Dear Sir, can you explain that how can we implement the timer s5t Timer time base changes in plc working program. as i have changed the timer...
Replies
8
Views
2,447
Back
Top Bottom