Nick Birke
Member
I have done a fair share of PLC programming in my time... but not with Siemens. So far I don't like it very much. The timers are nearly intolerable. I am mostly a LAD guy. So right now I am self-teaching myself S7 on a 315-2 DP. I thought I would start out by creating a stoplight program. It works the way I like and I am using the included pulse timer... this is all in S5 time.
I made a small HMI to see the stoplight work in WINCC Windows HMI. So far doing pretty well. Then I wanted to display the time remaining in various timers for the "lights" to change. This is when it was necessary to learn much more about timer time bases.
Ultimately... the way I get the timer value to the PLC by moving the Tn value to an MW location, and then pull it in as an integer... but there is a problem... the time base... this messes up my linear scaling. I understand the time base bits... but I don't know how to read them to compensate for them.
I decided to make a test program using FC80. This seems like it has potential... however... instead of loading PV with a constant, I have programmed it to read an MD value. Before the timer is started, I can see that value in debugging, when the timer is started, the PV value is set to some value... 30 becomes 33554462. When the timer is stopped, it retains how much it counted... and the PV value jumps between 30 and 134217758. Then when I reset it... it all resets and goes back to 30.
I am very open minded to different solutions. I generally get STL... I would just rather not write my own timer. PLEASE HELP. I have been staring at and playing with timers for almost two days, so if I am missing something obvious forgive me.
I made a small HMI to see the stoplight work in WINCC Windows HMI. So far doing pretty well. Then I wanted to display the time remaining in various timers for the "lights" to change. This is when it was necessary to learn much more about timer time bases.
Ultimately... the way I get the timer value to the PLC by moving the Tn value to an MW location, and then pull it in as an integer... but there is a problem... the time base... this messes up my linear scaling. I understand the time base bits... but I don't know how to read them to compensate for them.
I decided to make a test program using FC80. This seems like it has potential... however... instead of loading PV with a constant, I have programmed it to read an MD value. Before the timer is started, I can see that value in debugging, when the timer is started, the PV value is set to some value... 30 becomes 33554462. When the timer is stopped, it retains how much it counted... and the PV value jumps between 30 and 134217758. Then when I reset it... it all resets and goes back to 30.
I am very open minded to different solutions. I generally get STL... I would just rather not write my own timer. PLEASE HELP. I have been staring at and playing with timers for almost two days, so if I am missing something obvious forgive me.