timers and subroutine

jasonc

Member
Join Date
Nov 2007
Location
BC
Posts
7
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:

subroutine.jpg


Thanks! Jason
 
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
 
Removed as PeterW noted an error in my statement thanks Peter

icon14.gif

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:
Gil47 said:
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.
 
Here is my main program:

main.jpg


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!!
 
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.
 

Similar Topics

I'm new to PLC'S and I was given the task to program a valve with a HL and LL. If HIGH LIMIT isn't reached within 15s you must have a FAIL_TO_OPEN...
Replies
1
Views
5,801
I recently did a program conversion from logix 500 to studio 5000 and when machine runs it depends on two ton instructions to keep the machine in...
Replies
17
Views
550
Hi, I'm quite new to Rockwell PLC and currently trying to implement the following if Sw1 then for i:=1 to 20 by 1 do xEnable := 1...
Replies
9
Views
412
I'm writing some alterations to an FPWin program and need to see the running value of timers so I can set them correctly. It's my first time with...
Replies
0
Views
148
Hi everyone I am using Winproladder software for programming FATEK FBs PLCs and in programming, we often use Timers for activation of the...
Replies
4
Views
646
Back
Top Bottom