Bits in Ladder no longer being called, still set?

TheWaterboy

Lifetime Supporting Member + Moderator
Join Date
May 2006
Location
-27.9679796,153.419016
Posts
1,936
I just want to be sure I am right about this...
I have a number of ladders that I call based on a number, #1 = Ladder 1, #2 = ladder 2 etc.

The sequence works but I found that timer.acc and .dn bits remain set when the ladder exits. This makes the next trip through that ladder pretty brief since the timer .DN is already set.

I get whats happening and I now clear them. But I found the ONS bits do the same thing and I thought because of their nature, i.e. set only once, they just might be immune, i.e. they would reset the next time the ladder is executed.
Apparently I am wrong in that assumption so I need to clear these as well. No problem, I can do that but I just want to confirm that this is expected behavior.

Furthermore if this is expected, couldn't I exploit that and use the same ONS bits in every ladder since only one ladder would be executed at a time? Wont the ONS reset on the next ladder execution?

Or will it remain set until... when?

I know bits are cheap, this is an academic exercise at this point
 
When you stop scanning any logic, all the memory locations referenced will be left in their last state.
 
I get that, but supose I used the same ONS bit on 2 ladders, it gets set on the first ladder, will it still be set on the second ladder or does the instance of the second ladder "refresh" it?
 
Waterboy,

Sorry, but you cannot do that!
using a oneshot in 2 places will give you incorrect program results.
i made a mistake one time by doing just that thing and the system drove me nuts for several hours.
when i discovered the error, i changed the oneshot to another bit, the machine worked as designed.

as previously stated, when you stop scanning the logic, the rungs stay in the current position.

is the timers retentative?

before exiting the subroutine, you could reset the timers.

regards,
james
 
Yea, thats what I am doing now. The timers are not (intentially) retentive, they hold a bit set for a period of time, but they never clear since the last rung after the timer is /DN is to change to another ladder so it's ACC stays at the preset. Which makes sense after a minute of thought.
Its not a problem, I worked it out, but the ONS I thought might be different. y'all are saying it isn't, so I'll treat it like any other.
Thanks for the feedback
 

Similar Topics

Hello, I am in need of a solution to a problem I've failed to come up with a solution to that doesn't take entirely too long for my needs. I...
Replies
40
Views
15,754
Hi I am being given several fault words (as a DINT) from a Drive that I am receiving into a Compactlogix L33ER controller. I have a small...
Replies
12
Views
1,148
Dear Fellows; I am working on a very old machine which is designed in GE 90-30 PLC system. I have some difficulties like 1. How a force to...
Replies
3
Views
360
Hi All, I am trying to write some simulation logic for an existing project im working on. Does anyone know if this is possible to write to...
Replies
6
Views
1,285
Hi, I have this code: LAR1 P##structy L 0 T LW [AR1,P#0.0] which resets all the bits in this struct called structy...
Replies
1
Views
646
Back
Top Bottom