MicroLogix ladders (very EZ question)

Skidood

Member
Join Date
Oct 2016
Location
Ontario
Posts
213
Hi guys, I am back in the game after a time away...and I have a real dumb question.
My RS Logix 500 project has 4 ladders. LAD 2 is the main ladder which contains some conditional JSRs to ladders 3, 4, or 5.
Do ladders 3-5 get scanned after ladder 2 regardless of whether or not they are referenced by the JSRs in LAD 2, or are they ignored if the JSRs in LAD 2 are not "activated".
In other words, if the scan gets to the bottom of Ladder 2 without encountering any JSRs to other ladders, does it just start again at the top of ladder 2 for the next scan?
 
An activated JSR pauses scanning the current ladder immediately, jumps to and scans the target ladder, then returns and continues in the original ladder with the next instruction.
 
Do ladders 3-5 get scanned after ladder 2 regardless of whether or not they are referenced by the JSRs in LAD 2, or are they ignored if the JSRs in LAD 2 are not "activated".
It's the second option: only LAD2 is scanned automatically.

Any other Ladder routine, no matter what number is associated with it, has to be executed by a JSR instruction, or a Discrete Input Interrupt, or a Selectable Timed Interrupt.

The PLC-5 had multiple "main control programs" that would run one after the other, and ControlLogix has multiple Programs within each Task, as well as watchdog execution for event-driven tasks.

But the SLC/MicroLogix operating system is old and simple. Only the LAD2 relay ladder logic program runs automatically, over and over.
 
CAUTION !!

when you call a subroutine, the logic is solved (just like its supposed to).
you turn on certain outputs.

then you turn off that subroutine and it does not scan.
several minutes later, you have a condition that needs those outputs turned off, BUT; the subroutine is not called so the outputs stay on.

subroutines are great don't get me wrong, I use them all the time.
I just want to point out an issue you can have by turning the subroutines off.

if I am wrong, someone please correct me.

james
 
James Mcquade said:
CAUTION !!

when you call a subroutine, the logic is solved (just like its supposed to).
you turn on certain outputs.

then you turn off that subroutine and it does not scan.
several minutes later, you have a condition that needs those outputs turned off, BUT; the subroutine is not called so the outputs stay on.


subroutines are great don't get me wrong, I use them all the time.
I just want to point out an issue you can have by turning the subroutines off.

if I am wrong, someone please correct me.

james

Hi James,

You are not "wrong" in what you have suggested may happen, but I would suggest that the "issue" here would be down to poor programming more so than the fact that preconditional subroutines may have been used. Preconditioning JSR instructions is perfectly valid, as I know you are aware. But of course, yes, you do have to be careful when implementing such coding practices. I think that is what you are more saying here?

One example of using preconditional logic for a subroutine's JSR instruction may be an infrequent process event that may only happen once every so often to seldom. The logical subroutine required to be executed when this event occurs may be lengthy or quite taxing on the processor, or just unnecessary, and as such it may be undesirable to have this subroutine continuously executing while the event is inactive. A machine mode selector switch, for example - Here, other regularly executing subroutines may be required to temporarily or even indefinitely suspended their execution while the newly selected mode preconditions a different subroutine be executed. Often, the same input or output addresses may be used in more than one preconditional subroutine, where only one of these preconditional subroutines are executed at any one time.

If you have a scenario, such as the one you have outlined above, then you must make sure that all logic that is required to have control over any outputs has the means to do so. If programming, and a former function of the process requires a subroutine be preconditional and inhibited from executing under certain circumstances (this subroutine containing output instructions), then the latter function of the process, which must now further control these same outputs, must either precondition the same subroutine to execute under its certain circumstances, or, precondition another subroutine which also has control of the same outputs via further instructions.

Note: Again, both subroutines are not simultaneously controlling the same outputs via there instructions. Only one subroutine is executing at any one time.

That's a programming "method", which is valid (duplicate output instructions). Whether it's the best, clearest or safest "method", I'll not get into a debate over here. But to balance that "method" with another - I could also suggest that all output instructions be, where suitable, executed under one subroutine which is never preconditioned. Here, the preconditional logic for the output instructions within this subroutine may be executed within other subroutines, which themselves may be preconditioned. This way, no matter where the preconditions for the output instructions originate from, the output instruction logic is always executing.

In such cases, whichever method is implemented, they, and others, are valid. The key is to program these methods correctly so that the intended functions of the process or machine are achieved. Proper testing should help determine if any such anomalies, such as you have suggested, exist and then allow the programmer to address such issues.

Seeing, or using, preconditional Jump to Subroutine (JSR) instructions should not be feared, or avoided, but should be approached like most other programming features - carefully, thoughtfully, and with an open mind.

And for the Opening Poster...

Skidood said:
Hi guys, I am back in the game after a time away...and I have a real dumb question...

Dumb questions do not, or should not, exist on this Forum!

Welcome back.

Regards,
George
 
Geospark,

you are correct, I sometimes do a long post when a shorter post is better.

Skidood,
take 10,000 people and you are one of them.
if everyone but you knows the answer to a question, then ask the question.
others may be afraid to ask as well.

james
 

Similar Topics

I'm using a SLC typed write from the ControlLogix5572 to the MicroLogix 1400, with path: 2, (MicroLogix IP). The ControlLogix equipment has a...
Replies
0
Views
35
"Hello! Good day! Excuse me, I have a question regarding the 1761-NET-ENI. RSLinx has already detected it but it's not connecting to the PLC...
Replies
4
Views
58
Hi, I cannot find the DLCA1764.EXE utilty software for data retrieving. Can someone share the link to download this software. Thanks!
Replies
4
Views
85
I am working on setting up a Prosoft Datalogger model PLX51-DLplus-232. This unit will be collecting data from a SLC 5/05 on the DB9 port set to...
Replies
3
Views
93
Hello, I have a 1764 1500 LSP Series A that keeps failing with DTL_E_FAIL I/O error. Searching around it seems there's a weird issue specifically...
Replies
2
Views
98
Back
Top Bottom