RS logix 5000 array question

dsg

Member
Join Date
Jul 2011
Location
Melbourne
Posts
9
Hi Peoples,

Was wondering if anyone could help me out...

I have created a 'Error log' array with a length of 5 and want it to store my minor and major fault codes in. Once the first fault code goes in I don't want it to be over-written by the next fault code. So basically first fault code will go into 'Error_Log[0]' then the next 'Error_Log[1]' and so on up to Error_Log[4]. A bit like a bit shift....

I've got the GSV minor and major fault record instructions (one for each) Dest 'Major_Fault_Reg' DINT[11] & 'Minor_Fault_Reg' DINT[11].
I've then got a MOV 'Major_Fault_Reg[2]' (source) to 'Error_Log[0]' (dest), At the moment it's just over writing.

Not sure how to go about this, any ideas or leads will be greatly appreciated!

Thanks in advance
 
Two simple ways:

1) Use a FIFO (FFL FFU instruction pair). A FIFO queue will always keep the most recent code at Error_Log[0] and the oldest at Error_Log[4].

2) Use an indirect pointer. Increment the pointer (oneshot add) when you store a new code. If the pointer > 4 then CLR it to set it to zero. This is circular queue. You'll have to look at the value of the pointer to determine which code is the newest.

See examples to the two methods below.

A092120111-1.JPG
 
Last edited:
Here is another really simple method but it works a little differently. You have to always store the newest code at Error_Log[4], with older codes shifting down the array. This is because the copy instruction first copies array[1] to array[0], then array[2] to array[1], etc. If you attempted to copy the other direction you would overwrite the next value to be copied.

Of the three methods shown method 2 matches what you described - but I wanted to show other options and possible advantages for your consideration.

A092120111-2.JPG
 
Make sure you test to see if you are recording the same error code as the last error code. Often, errors happen repeatedly and you will want to check to see if you are getting one error occurring multiple times or if you are getting unique errors.

I usually only want to record unique errors so I test to see if the error code is different than the last one recorded. If it isn't then I don't record it.

I tend to use the FAL instruction myself to increment through the array. The FIFO, SQL, LIFO, FAL, and indirect pointers can all do the trick. But the FIFO is handy for the "last 5 faults".

OG
 

Similar Topics

Hello, Wondering if the following setup would work. 1. Local PLC on the network has an array of 25 REALs 2. Supervisory PLC on the network needs...
Replies
14
Views
1,804
Hey all, I am trying to figure out how to import some alarm messages without having to type them all in by hand. They are in the format of an...
Replies
4
Views
1,121
Hello i have been trying to figure out a good way to take hex and convert it to an array of SINT[]. Here is what my failed attempt looks like.
Replies
5
Views
1,259
Hi Folks, I am trying to trend in Logix Designer an element of an INT[223] input data array. For some reason, the "add" button is greyed out. I...
Replies
7
Views
2,172
I have a subroutine that gets called to copy a UDT In an array to a tag. This subroutine will be called around once per minute and has been...
Replies
4
Views
2,114
Back
Top Bottom