Discussion: Making use of program parameters in Studio 5000

asdf6

Member
Join Date
Apr 2018
Location
Vancouver, BC
Posts
15
Since v24 Rockwell introduced a feature called Program Parameters, which allows programmers to better customize the data sharing interface between programs. In a nutshell, the types of parameters they offer are:

- Input Parameters - pass by value
- Output Parameters - pass by value
- InOut Parameters - pass by reference
- Public Parameters - Similar to aliasing

Discussion questions:

- Do you make use of this feature?
- Does this feature actually contribute to code encapsulation? (Is it noticeably easier to reuse code?)
- In which scenarios would you use or not use this feature.

The company I work for now does not make use of this feature at all. We mainly use routines within a program for code segregation rather than programs within a task.
 
Last edited:
As with everything I suspect it comes down to how you determine your upper level program structure.

One scenario may be the control of a 4-color printing press with an unwind and rewind on the ends. All the presses would be controlled identically. From a development standpoint you could write the control for one press, get it working the way you want it to work, then copy and paste that program three more times in the same task. The parameters you pass the program would be those for the press it controls. The unwind and rewind would be treated the same way. So from a development standpoint you would get six machine sections coded in the effort of two machine sections. It's kind of like the AOI concept writ large, except modifications in one program do not affect the others. You would just need to make sure you use all program level tags unless the data is truly non-sectional in scope.

We don't do that here but that is one scenario I could see where it might be useful.

Keith
 
Since v24 Rockwell introduced a feature called Program Parameters, which allows programmers to better customize the data sharing interface between programs. In a nutshell, the types of parameters they offer are:

- Input Parameters - pass by value
- Output Parameters - pass by value
- InOut Parameters - pass by reference
- Public Parameters - Similar to aliasing

Discussion questions:

- Do you make use of this feature?
- Does this feature actually contribute to code encapsulation? (Is it noticeably easier to reuse code?)
- In which scenarios would you use or not use this feature.

The company I work for now does not make use of this feature at all. We mainly use routines within a program for code segregation rather than programs within a task.

This appears to be used for Add-on instructions only?

Pass by reference would reduce the number of values pushed onto the stack and pulled back off, if you are passing in values that are changed by the Add-on. That should reduce your scan time. But that's only an issue if you have dozens or hundreds of calls to an add-on.

We don't use add-on instructions. At least not yet. Our whole system is set up to use global tags, with subroutine calls. Passing large structures into an add-on, instead of having the data stored within the add-on, just didn't make sense. We tried it ... I guess it must have been before V24, since the penalty for doing 300+ Add-on calls took our scan times from 50-ish ms to almost 100 ms.

When we migrate to the 1756-L83s, it may make sense. Our biggest problem with subroutine calls are all human error. Using the wrong type, or fat-fingering the number of parameters ... which faults the processor after you accept edits. So we end up doing all of our subroutine call changes in a test processor to verify function before pasting the code/importing the tags into a running PLC.
 
I have used them in PackML programs to help with inter-program communication without having to create controller level tags. It is less confusing than following aliased global tags from each end but would probably confuse the average sparky trying to troubleshoot. Seeing as it was a PackML program that boat had well-and-truly already sailed.
 
I have been asked to use these program parameters by some Rockwell programmers. they look to be solving a problem I don't think I have.
 
Last edited:
- Do you make use of this feature?
- Does this feature actually contribute to code encapsulation? (Is it noticeably easier to reuse code?)
- In which scenarios would you use or not use this feature.

The company I work for now does not make use of this feature at all. We mainly use routines within a program for code segregation rather than programs within a task.

I will probably give them a go on my next project. They really should be useful when you use multiple programs, take a look at Rockwell's fundamentals of modular programming guide. While program parameters aren't discussed the modular approach leads into why program parameters are valuable.

Simple example, say I have 4 mix tanks:

Program 1: Mix Tank 1
Program 2: Mix Tank 2
Program 3: Mix Tank 3
Program 4: Mix Tank 4

Now, lets say these 4 mix tanks all share some common raw materials

Program 5: Raw Material 1 Delivery
Program 6: Raw Material 2 Delivery
Program 7: Raw Material 3 Delivery

Programs 1-4 can now directly pass raw material set points (parameters) to programs 5-7 without having to use Controller Tags as the medium to do so.
 
Thanks for the insights Paully.


I use multiple programs to keep the clutter of program scope tags down, especially since Rockwell creates a tag for every FBD block even for simple ones such as add.


My processes generally do not have identical machines controlled by the same CPU. Where there is identical equipment it is more on the AOI level for a pump or valve.
 

Similar Topics

What's the best way to use lots of MSG instructions in the same program? Both multiple messages with the same device, and other devices. I've read...
Replies
10
Views
1,081
Hi, I have a Master Thesis to write and my topic is Vertical Bag Packing Machine with continuous cycle. I am almost done with the mechanical...
Replies
16
Views
4,786
Hello all, There comes a time in everyone's career when you have to say enough is enough. That day for me is today. My manager is currently 630mi...
Replies
27
Views
8,598
Yup, that whole IOT 4.0 thing. Do you folks use a security gateway or router? In plants where there are isolated islanded networks that you may...
Replies
7
Views
2,282
So Last week there was a discussion on new laptop options. Looking at new ones got me trying to strategize as best I can when I also have to make...
Replies
1
Views
2,283
Back
Top Bottom