RS Logix 5000- Sub Routine rung outputs will not activate. JSR is active .

Rob S.

Member
Join Date
Sep 2008
Location
Maryland
Posts
739
Good Morning ,

I'm merging another RS Logix 5000 PLC program ( CompactLogix ) into another . Everything is working great except this one sub routine . The timers work , but not the outputs of the rungs . I have a JSR for that Sub Routine in with all the rest . I took notice I have a asterisk * at the top of the Sub Routine folder . I did a verify and everything is good accept a few AFI's I have installed .

Any ideas ? Thanks so much for your help in advance .
 
Cross-reference the outputs to make sure they are not being turned off somewhere else in the program, though you would have gotten a warning for duplicate destructive address in the verify. So maybe not.
 
The best way to verify if the rung is going true would be to put a new OTL instruction tied to a new BOOL tag on the rungs in question. If that rung is going true we would know for certain. Place the OTL either next to, or in a parallel branch around, the output.

The warning on duplicates could have been disabled.

OG
 
Good Morning ,

I'm merging another RS Logix 5000 PLC program ( CompactLogix ) into another . Everything is working great except this one sub routine . The timers work , but not the outputs of the rungs . I have a JSR for that Sub Routine in with all the rest . I took notice I have a asterisk * at the top of the Sub Routine folder . I did a verify and everything is good accept a few AFI's I have installed .

Any ideas ? Thanks so much for your help in advance .

The * on the folder name means there are changes that have not been saved to your PC. Nothing to worry about.

Agree with 2 posts regarding OTL on a new bit, and checking the cross-reference.

Other than those 2 suggestions, do you have a TND or a RET instruction above the OTEs that terminates the execution of the subroutine before it reaches this code? Not much of a suggestion, but something to check ...
 
Other than those 2 suggestions, do you have a TND or a RET instruction above the OTEs that terminates the execution of the subroutine before it reaches this code? Not much of a suggestion, but something to check ...

This reminds me, also check for an MCR instruction above the rungs whose outputs are not turning on.
 
Is it possible in one of your other subroutines, you are jumping to a different subroutine? So in Lad 2, it goes back to the top (rung 0) and does not execute the subroutine you are referring to. Maybe re-arrange the order of the jsr instructions in your Lad2.

I don't know if ladder logic works like I mentioned, I just remember writing code in C language, and it kept skipping one of my lines for this reason.
 
Is it possible in one of your other subroutines, you are jumping to a different subroutine? So in Lad 2, it goes back to the top (rung 0) and does not execute the subroutine you are referring to. Maybe re-arrange the order of the jsr instructions in your Lad2.

I don't know if ladder logic works like I mentioned, I just remember writing code in C language, and it kept skipping one of my lines for this reason.


+1 for alive15. As far as I know, I've always lined up my JSR's like the order in the main task. Most of them are alphabetical or in numerical order. I've never had any problems of routines being skipped this way. Hope this helps.
 
Some routine info...

Just a passing "heads up"...

alive15 said:
...So in Lad 2...

Rob S. said:
...RS Logix 5000 PLC program ( CompactLogix )...

There is no "Lad 2" in Logix 5000 controller projects.

There is the default "MainRoutine" under the default "MainProgram", under the default "MainTask". The default "MainRoutine" is automatically given the assignment of "Main", which assigns it as an auto executed routine (like LAD 2), and where we will usually place JSR instructions for the other routines within this Program.

If we create a new Program under this Task, or indeed under any Task, there will be no routines automatically created. When we create the first routine for the new Program, we are given the option to assign the routine as the "Main" routine, allowing it to auto execute (like LAD 2). Once this routine is assigned as the "Main" routine, any subsequently created routines will not be allowed to also be assigned as the "Main" routine. The assignment options are simply "none" or "Fault" routine.

So for a Logix 5000 project, we may have several Tasks with several Programs with several "Main" assigned routines, all containing JSR instructions. We may then, of course, also have several non "Main" assigned routines within each Program which may also contain JSR instructions, depending on the JSR nesting structure used.

Rob S. said:
...The timers work , but not the outputs of the rungs...

Could you please further clarify what type tag addresses and which type instructions are used for these "outputs"? I'm just curious as to whether they are controller-scoped tags or local program-scoped tags?

As you've merged logic between two similar platforms, I'm definitely also wondering about overlaps in tag addressing i.e. duplicates?

But doing as suggested will help you narrow things down here.

Regards,
George
 
Just a couple of other random thoughts:

It's possible to have no "MainRoutine" in a program, without one, no routines will scan. When you start a new project, however you could probably bring in logic into a new non default program and not have an assigned "MainRoutine".

Make sure you output module isn't inhibited. I've made that mistake before, where I was testing a program in a PLC where I didn't have the physical I/O attached. When I went to load the project in the actual machine, I forgot to un-inhibit it. [/facepalm]

Of course, the output being used multiple times as others have mentioned is a classic. A cross-reference would expose that one.
 
A routine assumption...

Just an observation on the possibility of the routine not being scanned...

According to Rob...

Rob S. said:
...The timers work , but not the outputs of the rungs...

While it would also be useful to have that further qualified, it would be my assumption that, at the least, the timers with their rung-condition-in TRUE may be observed as accumulating, and possibly also eventually transitioning to the Done condition? Further, it may also possibly be the case that timer Done bits are being observed as executing their intended logic elsewhere?

Whatever those three words actually amount to, if timers are being observed as "working", then the routine they are in is being scanned.

Also observed...

Rob S. said:
...I have a JSR for that Sub Routine in with all the rest...

I'm also assuming here that, in an already functional Program within the target project, this routine has been created/copied/imported and a JSR instruction has been added to an existing "Main" assigned routine, which has existing JSR instructions executing existing functional routines?

But they are just assumptions, of course.

A couple of screenshots here, if possible, might also help move us closer to the front row?

Regards,
George
 

Similar Topics

I'm sorry to be a pest, but I was making some program modifications at home yesterday and downloaded it to the controller this morning , and I am...
Replies
4
Views
3,073
I am completely stuck on building a ladder program that requires a start button to be pressed 3 times to turn on motor 1. Then motor 2 starts...
Replies
20
Views
519
Is there a way to use the FAL instruction to do +=2 instead of +=1? I have an array that is organized with alternating "data" and "flag" values...
Replies
5
Views
123
I have an AOI with revision notes. Someone entered the last note into the description instead of the notes. I cannot just click into the revision...
Replies
4
Views
146
Back
Top Bottom