dr_cronik
Member
Hi All
I have tried to use the following code to reset a tmr.
if Cycle.St & not(CycleStart_Rst) then
Tmr_Main.Reset [:=] 1;
CycleStart_Rst := 1;
elsif not(Cycle.St) then
CycleStart_Rst := 0;
end_if;
TONR(Tmr_Main);
As you can see the tmr.reset bit is set using a non retentive output [:=] as per RS help files
However the Tmr remained in the reset state until I manually cleared the bit. I then had to add the following code after the TONR(Tmr_Main); instruction to allow the timer to run after being reset.
if Tmr_Main.reset then
Tmr_Main.reset := 0;
end_if;
It is therefore clear form this that the [:=] instruction is causing the bit to retain its value.
Has anyone else encountered this problem?
Thanks
I have tried to use the following code to reset a tmr.
if Cycle.St & not(CycleStart_Rst) then
Tmr_Main.Reset [:=] 1;
CycleStart_Rst := 1;
elsif not(Cycle.St) then
CycleStart_Rst := 0;
end_if;
TONR(Tmr_Main);
As you can see the tmr.reset bit is set using a non retentive output [:=] as per RS help files
However the Tmr remained in the reset state until I manually cleared the bit. I then had to add the following code after the TONR(Tmr_Main); instruction to allow the timer to run after being reset.
if Tmr_Main.reset then
Tmr_Main.reset := 0;
end_if;
It is therefore clear form this that the [:=] instruction is causing the bit to retain its value.
Has anyone else encountered this problem?
Thanks