Hello
I'm programming something in STEP 7 package for S7-300 PLC and I'm having some problems with timers. One of my function blocks (written in SCL) has to calculate one REAL variable and then put that result as initial value (specify runtime) in timer.
runtime is in S5TIME format and my variable is REAL
e.g. my variable is calculated as 7.41 (means seconds)
and I need to put those 7410 miliseconds as the initial value in timer and then in every cycle multiply new value of timer with
a constant and sending that as an output.
e.g.
1st cycle
-value of the TIMER is 7410 miliseconds
-output is = const*7.41
2nd cycle
-value of the TIMER is 7400 miliseconds
-output is = const*7.40
3rd cycle
-value of the TIMER is 7390 miliseconds
-output is = const*7.39
(so, I also have to put somehow "time base" bits in "00" (for 10 ms timebase)).
Can You please give me some instructions how to do that?
I'm programming something in STEP 7 package for S7-300 PLC and I'm having some problems with timers. One of my function blocks (written in SCL) has to calculate one REAL variable and then put that result as initial value (specify runtime) in timer.
runtime is in S5TIME format and my variable is REAL
e.g. my variable is calculated as 7.41 (means seconds)
and I need to put those 7410 miliseconds as the initial value in timer and then in every cycle multiply new value of timer with
a constant and sending that as an output.
e.g.
1st cycle
-value of the TIMER is 7410 miliseconds
-output is = const*7.41
2nd cycle
-value of the TIMER is 7400 miliseconds
-output is = const*7.40
3rd cycle
-value of the TIMER is 7390 miliseconds
-output is = const*7.39
(so, I also have to put somehow "time base" bits in "00" (for 10 ms timebase)).
Can You please give me some instructions how to do that?