Control Logix Fault

rta53

Lifetime Supporting Member
Join Date
Feb 2003
Location
North Carolina
Posts
619
I have just downloaded a new project to a CLGX L61 processor. When I try to go to run I get this fault.

12/8/2007 11:49:02 AM
(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: MainTask
Program: PRETREATMENT_PROGRAM
Routine: DAY_OF_WEEK
Location: Rung 0

What I have is a routine call DAY_OF_WEEK and one called CLOCK. The DAY_OF_WEEK logic is something that I got from Rockwell web site that calculates the day of the week. I have used this before on another project that had a Compact Logix controller and it worked just fine. I have tried to look at what might be different between the 2 projects and here is what I found. When I created an array called DateTime to access the time of day clock (which I have used before) in the new project I made it Program Scoped instead of Controller Scoped. Same is true of the tag I created called Day_Of_Week. I noticed that in my previous project I had made both of these Controller Scoped. Could this be causing the problem? I am using GSV to get the LocalDateTime
 
I don't think it's the GSV instruction causing this error.

What is the actual instruction on Rung 0 of the Day of Week routine ?

Is the JSR that calls the Day of Week routine parameterized to pass tags to the subroutine ?
 
Ken,

I found a more recent file on Rockwell's sample code site. It is an Add-On instruction that gives the Day of Week and time. Seems to work great except for the fact that it is returning a 5 for Saturday instead of 6 as the day of the week. According to the rung comments it is supposed to return a 0 for Sunday, 1 for Monday, etc. Can you tell if there is a way to correct this in the logic?

If I can't get this to work like I want it I will try to post my original logic tht is causing the fault.
 
Last edited:
Ken Roach said:
I don't think it's the GSV instruction causing this error.

What is the actual instruction on Rung 0 of the Day of Week routine ?

Is the JSR that calls the Day of Week routine parameterized to pass tags to the subroutine ?

Ok, attached are 2 PDF files that show the 2 routines I have in my program that provide the day of week and time. As I stated in my original post I have already used this logic in a previous project. Another difference in the 2 projects I just remembered is that the Compact Logix project was done using ver.15 of RSLogix 5000 while my current project is ver.16. Only other difference is the scope of the tags(as I mentioned before)
 
Take a look at your samples folder

C:\RSLogix 5000\Projects\Samples\ENU\v15\Rockwell Automation
or any other version
DayOfWeek. ACD is there
I just tested it with ver 15 - shows day=6
dow.jpg
 
Last edited:
In version 16 you must replace GSV DateTime with LocalDateTime
This may be your problem.

Edit:
I just tested v16 version and it looks OK, except I replaced GSV attibute as I said above to get time zone working
 
Last edited:
I had forgotten to attach the zip file with the AOI. Very clean way of doing what I would like to do except for the day of week issue.

And I did use LocalDateTime in the GSV.
 
The ControlLogix minor fault is being caused by a mismatch between the tag being passed by the JSR in Rung 2 of the Clock routine to the SBR in Rung 0 of the Day of Week routine.

The JSR's Input Parameter is "DateTime"
The SBR's Input Parameter is "DOW_InputDate"

Check to be certain both of these tags are of the same User Defined datatype.
 
Ken Roach said:
The ControlLogix minor fault is being caused by a mismatch between the tag being passed by the JSR in Rung 2 of the Clock routine to the SBR in Rung 0 of the Day of Week routine.

The JSR's Input Parameter is "DateTime"
The SBR's Input Parameter is "DOW_InputDate"

Check to be certain both of these tags are of the same User Defined datatype.

The data types are the same. And it is actually causing a Major Fault. I wonder if it matters that the DayofWeek logic I am trying to use is for ver15. Would the ver16 be any different other than the LocalDateTime in the GSV.
 
Time/Date AOI

The Time/Date AOI that I found works great except for the issue of Monday being computed as 0 instead of 1 as the rung comments indicate. I know this doesn't sound like a big deal but we have always used a 0 for Sunday when scheduling a process to start on a particular day of the week. In the AOI at rung 7 there is a CPT instruction that computes the Day of the Week. If you add 1 to the MOD 7 then Monday will be 1, Tues. will be 2, etc. This works until you get to Sunday which then becomes 7. I'm not much of a math whiz so I was wondering if there is another way to modify the CPT to the result I need. I suppose you could use additional logic to move a 0 into the Day_of_Week tag if the result of the CPT instruction = 7.

I attached the AOI in Post# 3.
 

Similar Topics

Hey guys, On my system, i got prop valve controling cylinder on the left and right to adjust the center of a lumber before it get in a woodmill...
Replies
8
Views
928
Hey All, I have a 1756-L81E. There is a piece of code I only want enabled when I don't have a communication error present from the ethernet...
Replies
8
Views
5,192
Hi, I am using control logix L75 Processor and RS Logix Rev 20.55. During testing i observed a minor error on processor. Minor Error Code from...
Replies
0
Views
1,372
Hello, I have a Mitsubishi GOT HMI connected to this processor via serial port. A few times a week it will freeze up and may take several...
Replies
0
Views
2,845
Hi, This is satish. My program shows minor fault code - 04 in PLC. I am using STOD ( String to DINT) Conversion in the logic. The string length is...
Replies
2
Views
2,072
Back
Top Bottom