Help me with a preset time value ?

KAMEL ELSAYED

Member
Join Date
Nov 2016
Location
CAIRO
Posts
11
Hello,

I WANT TO MAKE THE PRESET TIME VALUE ( TV ) CHANGEABLE WHEN THE TIMER IS RUNNING .

EXAMPLE : THE START INPUT CHANGES FROM "0" TO "1" AND THE TIMER RUNS FOR THE PRESET TIME FOR EXAMPLE (300 SEC) I WANT TO CHANGE IT TO ANY OTHER VALUE BEFORE IT REACHES ( 0 SEC ).

ALSO I NEED TO KNOW HOW I CAN ENTER AREAL VALUE TO PRESET TIME (TV).

Thanks a lot
 
Kamel

The first rule in posting a specific question is to tell us what PLC make and model you are using....

I also suggest you switch CAPS off, it makes it appear that you are SHOUTING.
 
Sorry I can't help with Siemens....

In the Allen-Bradley/Rockwell world you can simply move new values into the .PREset register of a timer, as and when you want to.

I'm sure experienced Siemens guys will step in (pun intended)....
 
I have to admit that I have no field experience with Siemens programming yet (a decade of A-B, and everytime I use Step7 or TIA I want to add another..), but based on what I've learned in school what you want needs further programming...

Timer presets are typically stored as S5Time data types, without additional logic you are not able to use a real value as a preset for a timer. Basically the data type stores a BCD preset value of 0-999 together with a time base of 10ms up to 10s. It may be easy to convert a REAL value of a given time base but it will get more complex if you have to calculate the time base for any given REAL value (e.g. A value ranging from 0.01s to 60s).

S5Time Data Type:
https://support.industry.siemens.com/cs/document/56243/storing-the-s5time-data-type?dti=0&lc=en-WW

A quick search brought up this thread about converting REAL values for use as a preset:
https://support.industry.siemens.co...e-changed-from-wincc/54165?page=0&pageSize=10

As the timer functions count down from TW there is no easy way to apply a new preset while the timer is active, you will have to restart the timer to apply the new preset.
You can possibly calculate an intermediate preset time based on the actual time left and the new preset on change of the preset...
 
It is easeier if you avoid old S5 timer types. Use SFB3, SFB4 and SFB5 IEC timers instead (TP, TON, TOF), they work like in other PLC's (input/output = time, mseconds on dint format / t#1s )
 
thanks mareka and lare,

reply to mareka,
i opened links it is very useful
i will take my time to try every thing on it
actually i made the calculation for preset time value , to calculate it i changed it from s5time to real type after i got the result i can not move it to the preset ( tv ) because it is not s5time type .

reply to lare ,
i am trying SFB3, SFB4 and SFB5
i will get you the result after i finish
 
As I recall correctly SFB3/4/5 are using TIME format. So basically its DINT in miliseconds.
 
thanks adfox,

i am trying with sfb5 but i can not adress it yet.
also i want to say that i am still learning and it is the first project for me
 
Yes adfox,

I entered (t#30000ms) on (pt) and i got system fault
i think that the problem with the plcsim
 
Last edited:

Similar Topics

Hello, i need some help with attaching a preset timer value to a timer. This is the scenario. i have a conveyor system that transports 18...
Replies
2
Views
7,943
Hi pal, Need some enlightentment about the timer counter's preset value. The preset value changes to the default value whenever i am in the online...
Replies
11
Views
5,064
Hello I usually represent all my time delay in 0.001sec inside the hmi but know i need to enter values ranging to 2o minutes meaning 1200...
Replies
4
Views
3,617
So i've been at this for a long while, i have Citect Scada 2018, i have full access to everything but i can't seem to find any option or...
Replies
0
Views
25
Hi all, hope you are having a great day, I am in need of your help to create a AOI or program that does this kind of job: I have a IO Link...
Replies
9
Views
163
Back
Top Bottom