Heino Geerdens
Member
Hi all,
I've tried to calculate a Preset Timer Value for a CPU318-2 using this code;
TIME1 till 5 are local integers
TIME6 was S5TIME
// Convert Time --> INT
L "VW_T".Zeit[21]
T #TIME1
L "VW_T".Zeit[2]
T #TIME2
L "VW_T".Zeit[3]
T #TIME4
L #TIME1
L #TIME2
+I
T #TIME3
L #TIME4
+I
T #TIME5
So far so good... (I guess)
T #TIME6
T "VW_T".Zeit[107] //is S5TIME and will be used as the Timer Preset Value)
Loading this last part in PLCSim works as it should. When I load it into a CPU 318-2, the CPU stop's!!!
My only guess is that I might have to do the following, but I'm not sure what would be the difference.
L #TIME5
T #TIME6
T "VW_T".Zeit[107] //is S5TIME and will be used as the Timer Preset Value)
Anyone that can help me?
thx in advance
HG
I've tried to calculate a Preset Timer Value for a CPU318-2 using this code;
TIME1 till 5 are local integers
TIME6 was S5TIME
// Convert Time --> INT
L "VW_T".Zeit[21]
T #TIME1
L "VW_T".Zeit[2]
T #TIME2
L "VW_T".Zeit[3]
T #TIME4
L #TIME1
L #TIME2
+I
T #TIME3
L #TIME4
+I
T #TIME5
So far so good... (I guess)
T #TIME6
T "VW_T".Zeit[107] //is S5TIME and will be used as the Timer Preset Value)
Loading this last part in PLCSim works as it should. When I load it into a CPU 318-2, the CPU stop's!!!
My only guess is that I might have to do the following, but I'm not sure what would be the difference.
L #TIME5
T #TIME6
T "VW_T".Zeit[107] //is S5TIME and will be used as the Timer Preset Value)
Anyone that can help me?
thx in advance
HG