ralph.rose@comcast.net
2020-04-29T22:50:14Z
On the Logix 5000 I notice you did not cover call a subroutine and pass parameters and return value etc. I found some info in Rockwell AB book and if I understand correctly used a JSR with parameters. I thnk you can start with normal JSR and add parameters by right clicking JSR block and clicking on add parameter and return value if you want one. Then in the subroutine you start with a SBR with the same type and number of parameters as in the JSR. I found this in 1756-RM094F-EN-P page 33. Do I have it right? And if you pass a structure as a parameter and change something in the structure in the subroutine will the calling routine see it? What I found is for ladder program calling a ladder subroutine. What or how does it work if I switch languages? Can you point me to a Allen Bradley manual that discusses it?
I will continue my investigation. I think JSR and SBR have different forms for difference languages and you just have to use the proper form for the proper language. The problem I will have is that I can not test it. What I would like to do I create Visio drawing of predicted screens etc and get feedback on if I got it right.
ralph.rose@comcast.net
2020-04-29T22:52:26Z
I think I found part of the solution. JSR and SBR instructions come in different forms for different languages. If you look in 1756-RM003M-EN-P pages 442-446 you will find what you need. What is not discussed is SFC but if you look at SFC it uses ST in some blocks. If you look in 1756-PM006D-EN-P page 51 you will find a SFC calling a second SFC. This demo is without parameters. The next page shows adding a SBR block, but if you look in 1756-RM003M-EN-P, SFC is not discussed for the SBR instruction. I am confused. If I had software I could test it. Question: Does SFC use or contain a SBR instruction?
Guest
2020-04-29T22:54:23Z


I did not ever use the ability to pass parameters before the Logix 5000. Thats why there are no vids on it. It did not really serve much purpose in the SLC or PLC5 the way they use memory. The Logix is different. I still have not had to pass parameters for a real project, but at least I can see a purpose for it in this platform. Keep in mind that PLC programs should be as simple as possible. That means passing parameters should happen about as often as the moon turns blue. All that said, you are correct in the manner that parameters are passed in ladder. There is a list of parameters in the JSR and a corresponding list in the SBR. Keep in mind that local variables should then be used in the SBR or it really defeats the purpose of passing variables. Now the question - why would you want to do this? Here is an example. The logix has a lot of goodies. One of them is the user defined instruction or add on. Once again, keep it simple should be king, but the add on instructions have their place. They also are not editable when online. Any problem that a programmer might have will require changes made offline and a new download. This is not generally acceptable so such instructions should only be used when they are fully tested. This brings me to my point. The JSR with parameters can be used to pass parameters to a subroutine that will do the same thing as your new instruction but will also be editable while online. The subroutine can be called from different places in your program and variables passed to it to allow the code to run generically. Now is this something I would like to see in my programs regularly - NO. It will be confusing to most techs that have to troublshoot problems by looking at the ladder. It is however very powerful and gives the logix flexibility to do some very complex tasks.

As for the other languages, I will have to check. I am not sure I can even come up with a good reason to pass parameters to a function block routine, but structured text I can see as viable. I will have to spend some time with this later this week.

Finally keep in mind that 99% of all your JSR's are going to be without parameters and for program organization only.
ralph.rose@comcast.net
2020-04-29T22:55:14Z
My objective was to be able to say I can do it in an interview situation etc. I do not like the idea of there being major holes in my understanding of a technology when I am claiming I understand it. I have more questions that will do a lot to complete my mental picture. We have task, programs and routines. It looks to me that programs do not serve any purpose other than a store of local tags. A better solution would be to have local tags for routines, but this is not the way it is. All the work is done in routines, and routines call other routine. If you pass tags, etc these other routines can be referred to as subroutines. Can a routine in one program call a routine in another program or even task? Task seem to be used for scheduling of work. But still the work is done in its routines. I can see the possibility of a desire to use a routine in one task in more than one task. Is this possible?

Different subject: I looked in 1756-RM003 "Logix5000 Controller General Instructions Reference Manual" and saw a number of instructions in other manuals, Coordinate, Motion, PhaseManger, Process Control. Can you discuss there areas and how and when they are used? Look in the Instruction Locator.
Guest
2020-04-29T22:56:15Z


Its been a while on this, but I have finally had time to look into it more. First - everyone has gaps in their knowledge on this stuff. I have been at this over 25 years and find new things to learn every week. I am sure that if I stay at it another 25 years it will be the same. This stuff just moves to fast to be able to complete projects and keep up with everything new that is comming out. My point on your interview situation woud be stick to the stuff that is commonly required. No reasonable employer expects someone to know everything. I would reasonably expect my employees to be able to learn it if they dont know it though.

So with that said you have hit a gap in my knowledge. I dont really like SFC's so I have not studied them much; however, understanding that each step in the SFC is basically a ladder or other program block then I see no reason that the program could not call subroutines. In fact I would expect it.

Concerning the organization of tasks programs and routines. To better understand the divisions, you need to think more on program organization. The tasks are primarily to set different priorities and scan times. Used to be everything ran at the same speed and priority with older PLCs. With the Logix you have the ability to have stuff run in the classic continuous style scanning or more advanced periodic scanning. You also have the ability to set prioritys if two things need to run at the same time. Programs are generally used within the tasks to separate operations or equipment areas. For example you may have a reactor in a chemical plant. This reactor may have various valves, pumps and motors and other things necessary to make it operate properly. You can setup a program to hold all the routines associated with that reactor. The program tags associated with the program are in a sense associated with that area and local to that area. You cannot use those tags in other programs. To go across programs you must use controller tags which are global. I really think "routine" tags would clutter things up and make them useless as they could only be seen by that routine. If I were to complain, it would be for them to add folders in the controller tags to allow better organization of the tags there.

The logix is very powerful. Yes there is motion control, process control via the phase manager and probably other stuff I have not even heard about. You dont have to know it all. You do have to know what you need or learn it to be able to use it. The motion control capabilities of the logix allow it to tightly control such equipment. They have put into the Logix (and now the Compact Logix) the ability to do fairly advanced motion control with the processor. Phase Manager allows phase control that adheres to the ISA S88 spec. Which once again is a whole new can of worms. To understand that you need to spend a month or two delving into the S88 spec and even then the first client you work with will have a different take on how it should be applied. Like many things in the controls world, I like the idea of the Phase manager and it applies to much of what I do; however, it also adds a level of complexity that I have not been able to find a place that it would be a good fit.

Hope my rampling helps.
ralph.rose@comcast.net
2020-04-29T22:57:03Z
Thanks. I think I will read documentation about Task, Programs and Routines before I ask my next question. I will first see if I can find answer. If can do so I will share it.
RSLogix500 Introduction
RSLogix500 Inserting Instructions
RSLogix500 Opening a File
RSLogix500 Creating a Project
RSLogix500 Instruction Comments
RSLogix500 Rung Comments Page Titles
RSLogix500 Inserting Branches
RSLogix500 Program Organization, Part 1 - Overview
RSLogix500 Program Organization, Part 2 - Examples
RSLogix500 Using Symbols
RSLogix500 View Properties
RSLinx
RSLogix500 Online Offline
RSLogix500 Dowloading and Uploading
RSLogix500 Processor Modes
RSLogix500 Processor and Cards
RSLogix500 Introduction to Faults
RSLogix500 Indirect Addressing
RSLogix500 Indirect Addressing Faults
RSLogix500 Handling Faults
RSLogix500 Forcing I/O
RSLogix500  Custom Data Monitor
RSLogix500 I/O Configuration
RSLogix500 Advanced Diagnostics
RSLogix500 Instructions OTL OTU, Part 1
RSLogix500 Instructions OTL OTU, Part 2
RSLogix500 Instructions OTL OTU, Part 3
RSLogix500 Instructions, OTE
RSLogix500 Instructions, XIC XIO
RSLogix500 Instructions, ADD
RSLogix500 Instructions, COP
RSLogix500 Instructions, CPT - Part 2
RSLogix500 Instructions, CTU CTD - Part 1
RSLogix500 Instructions, CTU CTD - Part 2
RSLogix500 Instructions, CTU CTD - Part 3
RSLogix500 Instructions, CPT - Part 1
RSLogix500 - Comparison - Part1
RSLogix500 - Comparison - Part 2
RSLogix500 Instructions, DIV
RSLogix500 - FIFO - FFL and FFU - Part 1
RSLogix500 - FIFO - FFL and FFU - Part 2
RSLogix500 Instructions, FLL
RSLogix500 Instructions, JMP and LBL
RSLogix500 Instructions, Masking and MEQ
RSLogix500 Instructions, MUL
RSLogix500 Instructions, MOV
RSLogix500 Instructions, LIM
RSLogix500 Instructions, NEG
RSLogix500 Instructions, OSR
RSLogix500 Instructions, RTO
RSLogix500 Instructions, SQO sequencer - Part 1 of 3
RSLogix500 Instructions, SQO sequencer - Part 2 of 3
RSLogix500 Instructions, SQO sequencer - Part 3 of 3
RSLogix500 Instructions, SUB
RSLogix500 Instructions, TOF
RSLogix500 Instructions, JSR and RET
RSLogix500 Shift registers
RSLogix500 Instructions, SQR
RSLogix500 Instructions, TON - Part 1
RSLogix500 Instructions, TON - Part 2
RSLogix500 Instructions, TON - Part 3
Introduction to Ladder Logic