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 March 30th, 2008, 01:34 AM   #1
jasonc
Member
Canada

jasonc is offline
 
Join Date: Nov 2007
Location: BC
Posts: 7
Unhappy timers and subroutine

Hi folks,

Pretty new to this stuff and here is the problem I am looking for an answer too.

I have a main program that calls my subroutine which is working perfectly, however when I press a reset pushbutton in my main program, it should unlatch my binary bit B3:0/1. It does, but for some reason the timers in my subroutine fail to de-energize (they stay enabled and the DN flags don't de-energize). Here is my subroutine:



Thanks! Jason
  Reply With Quote
Old March 30th, 2008, 01:59 AM   #2
504bloke
Lifetime Supporting Member + Moderator
England

504bloke is offline
 
504bloke's Avatar
 
Join Date: Jan 2005
Location: West Ssx
Posts: 2,621
Can you post your code ? (zipped rss file)
__________________
Regards

Dave



"When you are courting a nice girl an hour seems like a second. When you sit on a red-hot cinder a second seems like an hour. That's relativity."
Albert Einstein (1879-1955)
  Reply With Quote
Old March 30th, 2008, 04:14 AM   #3
bikerdude
Member
United States

bikerdude is offline
 
bikerdude's Avatar
 
Join Date: Jul 2003
Location: Indiana
Posts: 296
jasonc,

We need to see the rung where the push button turns B3;0/1 on & off before we can help. B3:0/1 may be alternating off/on every other scan, which is so fast that you won't see it on your PC screen.
BD
  Reply With Quote
Old March 30th, 2008, 05:28 AM   #4
Gil47
Member
New Zealand

Gil47 is offline
 
Gil47's Avatar
 
Join Date: Apr 2007
Location: South Island, NewZealand
Posts: 1,151
Thumbs up

Removed as PeterW noted an error in my statement thanks Peter


PeterW you are dead right, I missed that my excuse is I need a larger screen so I dont need to scroll across

Last edited by Gil47; March 30th, 2008 at 05:49 AM.
  Reply With Quote
Old March 30th, 2008, 05:34 AM   #5
PeterW
Member
Canada

PeterW is offline
 
Join Date: Jun 2006
Location: Edmonton
Posts: 2,431
Quote:
Originally Posted by Gil47
The done bits need to be changed to XIO, instead of the XIC, that you have used, for these timers to operate in this subroutine, so if you are seeing the timers running, then you must be using them somewhere else, as well as in this subroutine.
Don't agree with that. The timers are T4:1, T4:2 and T4:3. The first N/O is T4:0, which I suspect is outside the sub routine, then once that has timed out T4:1 times, which in turn on completion starts timer T4:2, etc.

The code in the sub-routine looks fine if T4:0 exists externally.

As others have mentioned, we would need to see the external code.
  Reply With Quote
Old March 30th, 2008, 11:22 AM   #6
jasonc
Member
Canada

jasonc is offline
 
Join Date: Nov 2007
Location: BC
Posts: 7
Here is my main program:



I am using the RSLogix500 PLC Simulator form theLearningPit.com. I mainly am just wondering if there was something I misunderstood in the way subroutines work. If not, this could be a bug in the Simulator software. The T4:0 and T4:4 Timers reset perfectly when I hit the STOP button in the main program; it is just the T4:1 to T4:3 timers that the EN and DN flags stay stuck on.
I don't have access to the PLC till Monday, I can try it on the real-world one and see if this problem goes away.

Thanks for all the responses!!
  Reply With Quote
Old March 30th, 2008, 11:33 AM   #7
bernie_carlton
Lifetime Supporting Member + Moderator
United States

bernie_carlton is offline
 
bernie_carlton's Avatar
 
Join Date: Apr 2002
Location: Yakima, Washington
Posts: 4,623
It's your understanding.

When B3:0/1 is turned off because of the stop the logic leading to T4:0 and T4:4 is still scanned - it's just evalueated as FALSE letting the timer commands perform the appropriate 'turning off' functions like turning off the EN and DN flags.

But the timers in the subroutine ARE NOT SCANNED AT ALL. They don't get the opportunity to process the turning off of the enable.

Try this as a test - remove the B3:0/1 and T4:0/DN in rung #3 of your main program.
__________________
Controlling outputs is the PLC's way of getting its inputs to change.

www.thePLCguy.com
  Reply With Quote
Old March 30th, 2008, 01:42 PM   #8
jasonc
Member
Canada

jasonc is offline
 
Join Date: Nov 2007
Location: BC
Posts: 7
Ahhhh, yes, I get it now. That did the trick. Thank-you bernie.

Best Regards,
Jason
  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
about AB's timer qikuidg LIVE PLC Questions And Answers 16 March 13th, 2007 09:01 AM
Another newbie question of the day :) EmesiS LIVE PLC Questions And Answers 11 October 24th, 2006 08:11 PM
s7 - 200, subroutines and timers adfox LIVE PLC Questions And Answers 13 July 20th, 2006 03:03 AM
How AB Timers work. PhilipW LIVE PLC Questions And Answers 0 January 28th, 2005 02:47 PM
SLC 5/02,03, 04, 05 - VS Siemens S-?? Similar Logic / workings??????? soop7667 LIVE PLC Questions And Answers 11 September 14th, 2004 07:27 AM


All times are GMT -5. The time now is 02:44 AM.


.