Logix5000 Subroutine Question

Lakee911

Member
Join Date
May 2006
Location
Columbus, OH
Posts
98
Hey all Jim,

I have a question regarding subroutines in Logix5000. I've attached a bit of code (3 rungs) from one of my programs. When I call this subroutine with JSR, will my Return Par remain sealed in? I'm thinking that it would. I am calling this subroutine about 9 times in a row with different input parameters and different return parameters.

Thanks,
Jason
 
Lakee911 said:
Hey all Jim,

I have a question regarding subroutines in Logix5000. I've attached a bit of code (3 rungs) from one of my programs. When I call this subroutine with JSR, will my Return Par remain sealed in? I'm thinking that it would. I am calling this subroutine about 9 times in a row with different input parameters and different return parameters.

Thanks,
Jason

If you have V16 of Clgx you may wish to use the Add On Instruction (AOI). Makes troubleshooting multiple calls to a common SBR easier.
 
Yes, the 'Deviation' variable would remain in the state it was in as a result of the last subroutine call. However, in a multiple instance subroutine case you would typically not use the value of 'Deviation' directly. You would use whatever variable is in the 'RET' field of the calling JSR.

Keith
 

Similar Topics

Does anybody have run into the issue when the same structured text code from a subroutine has hiccups while copied/pasted an AOI? The issue is...
Replies
12
Views
6,260
Hi, I'm new to RSLogix5000 and this forum so apologies in advance if I do something wrong! My question is, how do I comment at the very start of...
Replies
8
Views
5,601
How do I delete a subroutine? Delete is always grayed out.
Replies
5
Views
7,431
Hi! So my problem is a little funky, I had Studio 5000 v 24 and 30 installed, but forgot to install RSLogix (which I cannot go without). Is there...
Replies
2
Views
119
So I had an odd request from a customer for the above. I have written the logic and tested it all in one PLC with only using 7 outputs and 7...
Replies
15
Views
428
Back
Top Bottom