S7-300 to S7-1500 migration: IEC timers

So that would infer that any program access to any element of the timer structure triggers a full-blown access to the whole function, in effect running all timer evaluations as part of the access. That would definitely explain things.

Keith




Only accesses to Q and ET calls the timer function.
 
Here is the two versions one in IEC & compiled code the other is in ladder compiled code (STL), However, I cannot show the call code as I have no real PLC at the moment and the simulator does not allow upload into STL

IEC Timer.png Ladder.png
 
Possible solutions:



1. As already mentioned, assign a bit on the Q output and use that bit instead of the timer.Q


2. Use Timer.IN inverted (example shown below)



3. Write a wrapper FB that uses the Siemens timer and use that instead.


4. ..... any other suggestions?




https://screenrec.com/share/2md6MKakUb
 
My cheaty solution was just to flip the order of the networks. Not sure if it works accurately, but at least it counts up in PLC SIM.


I think solution 1 is the cleanest in most situations, though.
 
mk42, flipping the order will probably work most of the time if you are checking the .Q very close to the TON call. However, if your program is rather large (or needs to scan very fast) and you use the .Q else where in the program it won't work reliably. That was the case that we had. We were using the .Q bit through our program that needed to scan very fast. So things worked most of the time, then every now and then it would mess up. If the .Q was being used to flash a light or horn; not a big deal. In my case when the .Q was being used to stop molten iron from spilling all over the place; it was a much larger concern that it wasn't reliable.
 
Last edited:
I believe the reason is because the first access of the timer with .Q sees the timer has expired and Q goes high,


so the second access of the timer with the TON sees the IN is low and resets the timer.



The third access of the timer (second access of .Q) then sees the timer as reset and Q isn't high.


So it actually goes back and re-evaluates a previous rung (network)?


Broken, it's definitely broken; I wonder what led them to program it the wrong way.
 
If the .Q was being used to flash a light or horn; not a big deal. In my case when the .Q was being used to stop molten iron from spilling all over the place; it was a much larger concern that it wasn't reliable.


Hah, yeah. My way was def not a good solution for anything that matters, I was more just amused that it happened to partially work.
 

Similar Topics

I have set up comms between an S7-1512SP-1 PN plc programmed with TIA v17 and an S7-314C programmed with Simatic S7 using GET and PUT blocks in...
Replies
4
Views
520
I have the Simatic Blocks Library from the ABB website to control their Drives they have Library for S7-300 (STL) and S71200/1500 (Ladder). STL...
Replies
2
Views
1,458
Hi all, Hope everyone is well. Finally getting around to a home project and am using a S7 1500 example but i only have an S7 300(WinAC RTX). Im...
Replies
2
Views
2,476
Purchased a new PV 300 because old screen keypad not working but still getting communication signal. Do I used panel builder 32 software to get...
Replies
2
Views
1,233
Hi everyone, At our facility there are plans to install new plant. My preference is for the project to utilize S7-1500, profinet and ET200MP...
Replies
12
Views
3,352
Back
Top Bottom