Siemens TON_TIME or IEC_TIMER

JDCROCKETT724

Member
Join Date
Jun 2010
Location
Michigan
Posts
249
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 and cons to one over the other? Is one better?

I have never had an issue with either one. I primarily programs with 1200 and 1500 PLCs.

Thoughts?
 
The few times I programmed a Siemens PLC, I used the TON because I was more familiar with it due to primarily programming AB PLCs. Only thing missing is a TT and that isn't hard to impliment.
 
I agree they don't have the TT bit. However, you can still use the two data types with the different instructions from my experience. So why choose one from another?
 
I use my own delay FB for most things with On/Off delay built in, however I would use TON.
 
Why would you use TON over IEC? Do you have a reason to prefer TON or is that simply your go to? My go to has been IEC. Which is better. Why does Siemens even have two? We need to know what the benefit is of the two so that and educated decision can be made when selecting a timer data type. Is one considered legacy from classic step 7, and the other is new for Portal?

I'm looking for why one would choose one over the other.
 
I see. Good question.
When I add a TON as multi-instance to an FB, it always gets automatically inserted as a TON_TIME.
As far as I know, the internal structure of IEC_TIMER and TON_TIME is identical.
I would play around with it to figure out the difference but I have shut down my programming VM for today.
 
The reason for IEC functions is to make it compatible over multiple platforms (well that was the idea), the problem as any multi-platform code is getting it to compile on another platform, the total IEC language was so that it could be exported as some kind of statement file so the code is re-usable on another platform, however, there are problems for example say Siemens use "I" as an input (E if in Germany) & Q or A for outputs, to compare this to Mitsubishi & it would be X & Y, so not truly compatible, in general platform dependent timers differ from IEC ones in respect that the underlying code, for example in most platforms a standard timer i.e. T0 is a fixed address as such an IEC is not what we call a timer as such, its a set of instructions that the compiler generates the native code that will work on that platform. It's a little hard to explain but for instance in Mitsubishi when you use an IEC timer the code generated does not use the native timers (function) as built in but builds it's own using words & bits as a subroutine. How others do it is not clear. I worked with a guy who developed one of the first IEC compatible IDE's (GXIEC) in the late 80's/ early 90's I learnt quite a bit how the IEC IDE integrated into the Mitsubishi system to make it compatible for older hardware, RW completely changed theirs with the introduction of Logix, Siemens has almost been IEC since the start of S7 & bet it is what IEC is based on due to the similarities even before IEC was introduced.
 
Great info Parky. I will change over to TON_TIME. However, I did notice that it is not universal to the timer instruction you are using like the IEC Timer is. If you use a pulse timer you have to use TP_TIME.

I also stumbled up this in a help file:
"Danger when reinitializing the actual values

Reinitializing the actual values of an IEC timer while the timer is running disrupts the function of the IEC timer. Changing the actual values can result in inconsistencies between the program and the actual process. This can cause serious damage to property and personal injury.

The following functions can cause the actual values to be reinitialized:

Loading the block with reinitialization

Loading snapshots as actual values

Controlling or forcing the actual values

The "WRIT_DBL" instruction

Before you execute these functions, take the following precautions:

Make sure that the plant is in a safe state before you overwrite the actual values.

Make sure that the IEC timer has expired before initializing its actual values.  

If you overwrite the actual values with a snapshot, make sure that the snapshot was taken at a time when the system was in a safe state.

Make sure that the program does not read or write the affected data during transmission."
 
Just to clarify, IEC timers come in many forms i.e. TON, TOF, PULSE etc. so it is not one generic IEC timer but a collection of timers the same goes for counters.

IEC Timers.png
 

Similar Topics

Context: PLC= S7-1212C, HMI=KTP1200 Basic. Hi, The operator has reported that, from time-to-time, when he presses the "Generate Report" button...
Replies
5
Views
464
Hi, Am I being daft (again)? I want to increment a tag (Integer) by 1 each time a button on the HMI is pressed. Before the button press, the...
Replies
22
Views
2,362
Hi I’m trying to work out how to get the alarm button to flash when there is an alarm or do I have it that the alarm page pops up with the alarm...
Replies
15
Views
1,388
On my HMI (KTP1200), I've got this button "Generate Report", which generates a report (CSV) when it's pressed. (see pic) While it's being...
Replies
1
Views
548
Hi, When the HMI (KTP1200 basic) powers up, the user has to enter their credentials to log in. In the screenshot, ADMIN has already logged in...
Replies
3
Views
1,004
Back
Top Bottom