RSLogix 5000 - Program error: Invalid Start or Quantity value

Berkely

Member
Join Date
Jun 2014
Location
Coast
Posts
7
Hi,

I'm really bugged with this. The CPT instruction in below rung apparently generates the following program fault:
(Type 04) Program Fault
(Code 56) Invalid Start and/or Quantity value.
Task: MainTask
zaNgWCK.png


If I disable the CPT instruction (with tempint0.0), all goes well. If it's enabled the Program fault is generated. CLXPort.SplitPos is either 0 or 68 the other DINT is always 2. I really don't understand why adding these 2 DINT is generating this fault. This seems so simple straight forward.

Any help is really appreciated.
Thank you.
B.
 
Is the fault generated as soon as the processor goes into run mode or when CLX_Port.SplitPos > 0?

The fault text would seem to point to the FIND instruction but your test points to the CPT. I can't see anything specifically wrong with the CPT.

Keith
 
It's in the CPT instruction. First I thought it was the FIND but then I tried putting an AFI in front until I came to the CPT. It's 100% repetitive, enabling the tempint0.0 generates the fault immediately. The fault is not longer generated when the temp bit is low. I also don't see anything wrong with the CPT but already replaced it with an ADD to verify. Anyway, that generates exactly the same program fault which implies there really is something wrong.

Michael, the stringIn is a string similar to an NMEA string, it contains 86 characters and alternates between "nothing" and the "86 character" string. I don't think the find fails but if it would, the SplitPos wouldn't be bigger then 0 so the CPT wouldn't be executed I guess. You have a suggestion?
 
i think you might need a LIM function or similar
as it might be going above the 86 not a zero fault
 
Here's one to try. Replace the destination in the CPT with a test DINT. I'm wondering if the CPT is putting the value of the result above its permissible value and the FIND is faulting on the NEXT scan. The other way to test that is put an AFI directly in from of the FIND and then put an unconditional branch around both the AFI and the FIND. Then start typing random values into the two tags in the CPT expression and see if you can get the instruction to fault.

Keith
 
Could you export the rung and the UDT definition and post it?
I tried the rung using dint and string tags and it works OK for me.
 
+1 Mike_RH

Probably nothing wrong with the Code I have had some odd things like this happen very rarely

Please retype the rung (Do NOT Use Copy/Paste) then delete the rung at fault
OR Save the whole program as L5K then Open it and save as ACD
 
The KB seems to indicate that this fault is associated with string functions, so Keith may be right about the fault actually happening on the following scan. To check that put an OTL on the rung in series immediately after the CPT instruction. If it latches then you got past the CPT (you can actually move OTLs around to any location on the rung as a diagnostic to see how far you are getting through the rung.)

According to the help file type 4 code 56 is one of the faults of the find function. The suggested recovery is "Check that the Start value is between 1 and the DATA size of the Source."

Something else you could try is to use a TAG at the Start parameter instead of a constant.

Be aware that CLX supports multiple string types that can be defined with different data sizes. Make sure you aren't mixing some string types up there.
 
I still think that the add function is exceeding the 86 array value
try a LE in place of your tempint bit
 
Just curious - what happens if you replace the CPT with an ADD (since that is all you are doing anyhow)? I just got done scratching my head over a CPT that did not work a couple weeks ago and gave up on it, replaced it with 'simpler' functions. I had similar CPT's work in the same program - argh. In my case I'm sure it was something I did not understand, but why fight it - so I went to plan B.
 
Last edited:

Similar Topics

I am completely stuck on building a ladder program that requires a start button to be pressed 3 times to turn on motor 1. Then motor 2 starts...
Replies
20
Views
583
Hello all, I am working on a project on a CompactLogix L16ER-BB1B plc, and I was given a program that is on version 20.019, while my plc is on...
Replies
3
Views
1,845
I have been tasked to upgrade some SquareD PLCs at our plant. I have done several of these upgrades without any issues. However, I have now met my...
Replies
4
Views
2,447
I am trying to figure out how ladder programs in the compactlogix/controllogix platforms handle JSRs and general flow, etc. :banghead: If I have...
Replies
20
Views
5,123
Back
Top Bottom