IEC TON Comparing in S7

nate8108

Member
Join Date
Aug 2005
Location
chatham on
Posts
8
I know the question has been asked, but I got lost in that thread. I am using S7 317T, and with On Delay Timer Coil and I want to compare the accumulated value. I can't seem to figure out how to do this. I am fairly green at Programming Siemens, so anyhelp would be welcome thanks.
 
A link to the thread you are referring to would be useful to ensure any help isn't simply a repeat of that thread.
 
ET is elapsed time. However you have to disable type checking in editor to make it working: Options>Customize...>LAD/FBD: Type Check of Address - unchecked.

untitled1234.JPG
 
The problem with comparing the .ET (expired time) on an IEC timer is that it is formatted as a #TIME. This is just another way expressing the time as milliseconds.
You cannot do the compare in LAD or FBD because type checking will complain if you try to compare with a DINT. And there is no compare functions in LAD or FBD for TIME variables.
The simple solution is to do the compare in STL, as there is no typechecking in STL. (You can turn typechecking in LAD or FBD off, but I wouldnt do that).

So it will look like this:

L MyTimer.ET
L MD20 //is a DINT or TIME with the required limit value.
>D // check for "greater than".
= M0.0 // is TRUE if MyTimer.Et>MD20.

Hope this helps :)
 
I also would not turn type checking off...declare a DINT and move ET to that and compare from there. Now you can leave it all in LAD/FBD.

Otherwise make a FC and roll your own instruction.

Nick
 

Similar Topics

Hello, I'm trying to use the IEC timer, SFB4, for the first time and it seems like it's not working properly. I've uploaded a picture of the...
Replies
3
Views
3,159
I am trying to deal with fragmented data, and have been getting stuck. So far I am able to command the Fuchs VE Software version correctly and I...
Replies
0
Views
163
Hi all, I am getting back to using IEC for schematics and was wondering about the 81346-2:2019 codes. What does everyone use for a diffuse...
Replies
3
Views
558
I just took a skim through 81346-2:2019 and was wondering which codes you all used for Safety devices like Safety Controllers, EStops, and guard...
Replies
0
Views
556
I know this is a PLC forum but there are many people from around the world that might be able to help me. I have an aspect question (IEC). I am...
Replies
20
Views
1,980
Back
Top Bottom