logix 5000 2d array, how to use a fifo to increment?

96kingo

Member
Join Date
Jan 2012
Location
Rochester
Posts
16
Hi All

Im using RSlogix 5000 and compactlogix.

I need to store 2 bits of data to a register in the PLC, one is a time stamp from the wall clock and one is a REAL value.

I have created a user defined table called 'STORAGE' with both values in, 1st being a DINT [7] and the 2nd being a REAL [1]. This STORAGE has 10 elements.

I need to write to these 2 areas (ive used a GST for the time and a MOV from an ana input for the REAL value), then increment the STORAGE to the next element, and write the 2 values to STORAGE [1].

I have been trying to use a FIFO to store, then increment to the next element in the array, but cant see how to incorporate both the bits of data, then move on.

Any ideas would be greatly appreciated.

Oliver
 
Oliver,

I do not think the FIFO is a good match for what you described. What you need is basic 2-dimensional Array indexing. This method was a common computer method long before PLCs were invented.

Set up your 2-dimensional Storage Array, "STORAGE(T,V); where T and V range from 1 to 10.

Now create an array write, where you write all values fro 1 to 10:

For I = Storage Position,
Write STORAGE(I,I)
If I=10 Go TO "Done"
Next I
 
So your UDT looks something like the first pic....

And your STORAGE[n] array tag has elements 0 to 9.

Simply create a DINT tag, e.g. INDEX, and use it inside the square brackets to access any of the STORAGE elements.

Edit : You can put expressions involving tags inside the square brackets also !


e.g.

If INDEX has the value 4, then STORAGE[INDEX] addresses the elements of the array STORAGE[4]

Increment INDEX to store successive values.

Second Pic shows STORAGE[4] before the testit tag is toggled, Third pic after

2012-01-23_211345.jpg 2012-01-23_212339.jpg 2012-01-23_212403.jpg
 
Last edited:
To follow on with this thread, is there a way to view all the data stored in the 'STORAGE' tag in a readable format (i.e. graph/table). I had a look at the file instructions, but seems like you can only play with single arrays, and this has arrays within arrays.
 
To follow on with this thread, is there a way to view all the data stored in the 'STORAGE' tag in a readable format (i.e. graph/table). I had a look at the file instructions, but seems like you can only play with single arrays, and this has arrays within arrays.
you could DDE/OPC all of the values into Excel if necessary.
 
I have never used DDE/OPC, is it possible to get some pointers on here? If its a bit more complex, ive got a contact at AB I can get in to help me out.
 
Reasonable easy to just put DDE links in individual cells

=RSLINX|Topic!TagName

RSLINX is the Server application
| "pipe" character (above the backslash "\" on my keyboard)
Topic is the topic you create in RSLinx to point at the controller
! exclamation mark
TagName speaks for itself, although if the tagname contains non-alpha-numeric characters (like a "." or a "[", for instance), then put the TagName in single quotes.... !'STORAGE[4].TimeStamp'

Of course you will need a purchased copy of RSLinx to do this, RSLinx Lite does not support DDE/OPC.

You could also use the "...Free Eye-catching HMI..." (here), which has it's own DDE/OPC driver to talk to ControlLogix.
 
Last edited:
Thank you for your help daba, I should have the full version included with the RSLogix 5000 installer, but im only running lite at the moment, so will update that and try it out.
 
Thank you for your help daba, I should have the full version included with the RSLogix 5000 installer, but im only running lite at the moment, so will update that and try it out.

None of the RSLogix5000 packages include the full version of RSLinx, they all bundle in RSLinx Lite.

You have to purchase RSLinx as a separate package to get away from Lite.

Piece the two pictures together, taken from the RSLogix5000 Purchasing Information features table on the RA website....http://www.rockwellautomation.com/rockwellsoftware/design/rslogix5000/orderinginfo.html

2012-01-25_140328.jpg 2012-01-25_140404.jpg
 
Last edited:
Ahh, ok. I may be able to get hold of that, AB have also given the option of using a PV PLus6 and storing all the data in a readable and accessable format within the screen operating system, without any PLC interference. Im going to find out more about that and decide which way to go.
 

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,819
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,126
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,271
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,194
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,118
Back
Top Bottom