Loop Consequences

Narlin

Lifetime Supporting Member
Join Date
Mar 2010
Location
phoenix
Posts
320
I want to use a goto Loop in a pH subroutine (RSLogix).

Issue #1: From reading the posts here I have one immediate concern, which is that the watchdog timer S2:3/H will interfere with my loop. I anticipate that the loop needs to be active for ~10 minutes and the watchdog timer defaults to 10ms.
(10 min / 10ms) = 60000!
I rather doubt that i can increase the watchdog timer value enough.

Issue #2: I went into LogixPro Simulator to see what the consequence might be to an infinite loop. To my surprise, it was necessary to use Windows Task Manager to recover. If i manage to put a ML-1100 into such a loop, and since it reboots by running whatever program is loaded, how might I recover. I would like to know this answer before i do the loop!

Narlin
 
Is there any reason you need to use a loop in your subroutine? I'll admit, I haven't done very "complex" programs, but Jumps and Loops are one thing I've never used in a ladder program. Just always seems that anything I can think of that could use one has a simpler solution that works with the way a PLC ladder program is executed.

Especially considering you want to "stay in the subroutine" for 10 minutes. Seems like you are trying to use a programming language thought process (like C++) when programming ladder logic.
 
I agree with Tharon. LAD2 is already an infinite loop, just count passes through it...

Narlin said:
. . .
I went into LogixPro Simulator to see what the consequence might be to an infinite loop. To my surprise, it was necessary to use Windows Task Manager to recover. If i manage to put a ML-1100 into such a loop, and since it reboots by running whatever program is loaded, how might I recover. I would like to know this answer before i do the loop!

Narlin

It will fault (and stop the running program) when the watchdog timer is done, killing all outputs and just sit there with a red light saying "fix me". If you power cycle it or otherwise clear faults and put it in run mode, it will do the same thing again. I am not sure what the max watchdog timer is, but that would be that maximum time that your Micro will be "frozen" by the loop. During that period, I don't think you will be able to communicate with it.

Hopefully we have talked you out of using JMP/LBL looping for this task.
 
Last edited:
Tharon, you are right on my wavelength here. Understanding that the PLC loops continuously and all the time anyway, I am working hard to not use a JMP-LBL loop. I am an old C++ programmer (learned on Fortran), and PLCs can be programmed like that, but i agree that there is also another way.

Any comment on the consequence of an infinite loop?
 
Describe what you want to accomplish in this 10 minute loop and people here could help you implement it without using loops in ladder.
 
Without more information there is no way to discuss the merits of an infinite loop within a subroutine. Why do you feel that the normal looping of the PLC is insufficient for your needs? Can you describe your operation?

If in the subroutine continously then the system cannot perform the other functions like communication processing.
 
The watchdog timer of your ML1100 cannot be made greater than 2.5 seconds, at which time your processor will fault. If you clear the fault and put it in run mode again it will fault again in 2.5 seconds. So in practice you cannot make an infinite loop using JMP-LBL pairs.

For next loops are useful for things you want to process in a single scan - for example you might use one to sum a finite series of values. Otherwise construct your ladder to take advantage of the fact that ladder 2 repeats infinitely.
 
Last edited:
Thank you for the watchdog timer limit. I see why the jmp-lbl structure exists and that i was thinking about it in a manner not suitable to the PLC device.

Bernie, I am not going to put the logic forward just yet. Part of the fun with these toys is to program them myself. If i get stuck, I will come back for help and give a lot of detail.

I suspect that i am on the right track now.

narlin
 

Similar Topics

I have always controlled servos in Rockwell motion using position loop. I have an application where one process will push against a servo...
Replies
3
Views
244
Hello All Could we get some expertise on flow control ? -Using a PID loop in Productivity 2000 with an analog output, How can we convert...
Replies
19
Views
1,514
Complete noob here, using a Click C0-02DD1-D to run a test stand. Requirement is to turn on motor run for X seconds, turn off and dwell for X...
Replies
6
Views
1,019
Hi guys, so I'm using BOOTP/DHCP tool in my virtual machine for setting up an IP addresses for basically everything. My only issue is always with...
Replies
3
Views
330
Hey all, Studio v20.05 Background. We are piggy backing another system to record attributes for product travelling down the line and several...
Replies
21
Views
3,418
Back
Top Bottom