FOR - Did not pass as many parameters

Frinehart

Member
Join Date
Jul 2018
Location
Ohio
Posts
21
All,

I am converting a PLC5 to a Controllogix program, I have it converted and downloaded to the new 1756-L83E processor, but every time I put the processor in run mode I get a fault of:

12/31/1997 7:51:29 PM
(Type 04) Program Fault (can be trapped by a fault routine)
(Code 31) JSR or RET did not pass as many parameters as expected.
Task: _2_MAIN
Program: _2_MAIN
Routine: _23_RAIL_SBR
Location: Rung 1

This is my first time converting a processor as well.

Thank you

FOR.PNG FOR1.PNG
 
Just guessing that you are exceeding the maximum number of parameters that an L83 will allow to be passed in a JSR (40 in, 40 out). Another little gotcha with the L8x series. If this is your issue, you would not have this problem converting to an L6x or L7x.

Take a look at page 94 of the conversion doc:

http://literature.rockwellautomation.com/idc/groups/literature/documents/rm/1756-rm100_-en-p.pdf

ALSO, check out page 73 for the proper procedure to convert the program (going thru an .L5K file). It sometimes catches some error messages that don't seem to get flagged other ways.
 
Is the Rung you posted a screenshot of in the _2_MAIN routine, or in the _23_RAIL_SUBR routine ?

The FOR instruction doesn't pass Input and Return parameters like JSR does. Instead it behaves like a repeated JSR except for setting the Index value (for the number of times it has executed)

The Index value (N7_120 in your case) isn't really "passed" to the subroutine because the subroutine doesn't explicitly designate the parameter that receives the value; it's just placed in the Index tag which is in the Program or Controller scope tag database.

My guess is that either you're calling the same routine the FOR instruction is in (which would create an infinite loop) or the _23_RAIL_SUBR routine includes SBR instructions that expect things to be passed to them by a JSR.

PLC-5 conversions require some attention, especially to the execution of routines. It's all do-able !
 
Is the Rung you posted a screenshot of in the _2_MAIN routine, or in the _23_RAIL_SUBR routine ?

The FOR instruction doesn't pass Input and Return parameters like JSR does. Instead it behaves like a repeated JSR except for setting the Index value (for the number of times it has executed)

The Index value (N7_120 in your case) isn't really "passed" to the subroutine because the subroutine doesn't explicitly designate the parameter that receives the value; it's just placed in the Index tag which is in the Program or Controller scope tag database.

My guess is that either you're calling the same routine the FOR instruction is in (which would create an infinite loop) or the _23_RAIL_SUBR routine includes SBR instructions that expect things to be passed to them by a JSR.

PLC-5 conversions require some attention, especially to the execution of routines. It's all do-able !

Ken,

In the PLC5 program it was calling a Q23 bit show in the attached photos. I had changed it to the routine to call the _23_Rail_SBR routine as the question Q23 bit had only shown up in that subroutine

PLC5 FOR.PNG PLC5 FOR 1.PNG
 

Similar Topics

I have an issue with Power Flex 525 during running processing, the VFD stopped suddenly while the PLC and VFD connection ok, VFD does not have any...
Replies
1
Views
85
In the past I have been familiar with the 1769-L35E series CompactLogix PLCs by Allen Bradley. For those PLCs (firmware version 20.19), when the...
Replies
7
Views
1,092
As some of you may know I'm currently at our property in Thailand, decided to do a re-wire before taking some R&R in and around the coasts, The...
Replies
5
Views
1,899
We run multiple products on our machines, which means we have multiple robot programs that we swap to, due to the points for the robots having to...
Replies
7
Views
1,880
I quoted for a job and was massively undercut by a competitor. I really couldn't see how they could do it for that amount. It was basically a...
Replies
14
Views
4,133
Back
Top Bottom