You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old November 15th, 2011, 11:52 AM   #1
Narlin
Lifetime Supporting Member
United States

Narlin is offline
 
Narlin's Avatar
 
Join Date: Mar 2010
Location: phoenix
Posts: 320
Loop Consequences

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
  Reply With Quote
Old November 15th, 2011, 12:09 PM   #2
Tharon
Member
United States

Tharon is offline
 
Join Date: Jan 2007
Location: Michigan
Posts: 1,421
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.
  Reply With Quote
Old November 15th, 2011, 12:16 PM   #3
OkiePC
Lifetime Supporting Member
United States

OkiePC is offline
 
OkiePC's Avatar
 
Join Date: Mar 2005
Location: ENE of Nowhere Oklahoma
Posts: 9,982
I agree with Tharon. LAD2 is already an infinite loop, just count passes through it...

Quote:
Originally Posted by Narlin
. . .
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.
__________________
It's not all the variables I am most concerned with, it's the undiscovered constants.

Last edited by OkiePC; November 15th, 2011 at 12:23 PM.
  Reply With Quote
Old November 15th, 2011, 12:18 PM   #4
Narlin
Lifetime Supporting Member
United States

Narlin is offline
 
Narlin's Avatar
 
Join Date: Mar 2010
Location: phoenix
Posts: 320
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?
  Reply With Quote
Old November 15th, 2011, 12:27 PM   #5
Tharon
Member
United States

Tharon is offline
 
Join Date: Jan 2007
Location: Michigan
Posts: 1,421
Describe what you want to accomplish in this 10 minute loop and people here could help you implement it without using loops in ladder.
  Reply With Quote
Old November 15th, 2011, 12:28 PM   #6
bernie_carlton
Lifetime Supporting Member + Moderator
United States

bernie_carlton is offline
 
bernie_carlton's Avatar
 
Join Date: Apr 2002
Location: Yakima, Washington
Posts: 6,253
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.
__________________
Controlling outputs is the PLC's way of getting its inputs to change.

www.thePLCguy.com
  Reply With Quote
Old November 15th, 2011, 12:28 PM   #7
TConnolly
Lifetime Supporting Member
United States

TConnolly is offline
 
TConnolly's Avatar
 
Join Date: Apr 2005
Location: Salt Lake City
Posts: 6,148
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.
__________________
True craftsmanship is only one more power tool away.

That's the beauty of processors, they don't have emotions they just run code - The PLC Kid.

Last edited by TConnolly; November 15th, 2011 at 12:31 PM.
  Reply With Quote
Old November 15th, 2011, 12:40 PM   #8
Narlin
Lifetime Supporting Member
United States

Narlin is offline
 
Narlin's Avatar
 
Join Date: Mar 2010
Location: phoenix
Posts: 320
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
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Flow loop and pressure loop ddeshi2 LIVE PLC Questions And Answers 9 November 16th, 2011 12:29 PM
Servo "PID" Algorithim (Allen Bradley) kdcui LIVE PLC Questions And Answers 10 September 21st, 2011 03:59 PM
Loop Control PLC Vs. Loop Module ddnnis LIVE PLC Questions And Answers 9 August 31st, 2011 05:02 PM
Tuning Primary Loop in Cascade Loops?? RPax LIVE PLC Questions And Answers 9 November 14th, 2007 03:53 PM
Servo Velocity vs Torque control TimothyMoulder LIVE PLC Questions And Answers 10 June 26th, 2006 11:42 AM


All times are GMT -5. The time now is 05:40 PM.


.