[:=] Non retentive assignment Structured Text

dr_cronik

Member
Join Date
May 2012
Location
United Kingdom
Posts
47
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
 
Structured text does not have an OTE instruction, but you can achieve the same results using a non-retentive assignment.
data_bit [:=] BOOL_expression;

Can be found under OTE in instruction Help
 
Last edited:

Similar Topics

Been a long time since I've posted, but here we go. Started a new role in august and progressively learning about Codesys programming in...
Replies
2
Views
1,153
GE 90-30 using ME 6.0 - Newbie question... Let's say on rung 10 I set a coil (S) with a one-shot. Input to coil drops out, but coil stays...
Replies
30
Views
11,076
Hello guys, I am currently looking through some examples of how timers work, but this ladder logic diagram gets me really confused. Once I:1/0 is...
Replies
2
Views
1,847
I have a question about the TOFR instruction, a non-retentive timer that accumulates when the input bit goes low. For me this is in Rockwell's...
Replies
7
Views
3,704
I am using some MCR pairs in RSLogix 500 as if they were subroutines. I could, for example, have used JMP & LBL instruction pairs instead. When...
Replies
9
Views
6,152
Back
Top Bottom