Please help rslogix 5000 bit array

Brandon_L

Member
Join Date
Aug 2016
Location
Ceres
Posts
3
Hello everybody I really need help on understanding an array of data in logix5000 everything from creating them,dimensions,how to use them ect...anything and everything will help I have read the Rockwell literature on it but their explanations are a little confusing to understand I have gone through this forum and I found good knowledge but a lot of you guys are using it at a higher level than I am.. I have never worked with an array and want to start so I can get in that next level...
Thank you for your time it will be much appreciated
 
if you have every done any Basic or C programming, the Logix arrays are very similar. The main difference is that arrays can also be of a user defined type (which has a structure of one or many different types).
The multi-dimensional part I have rarely use myself, but somebody here may have found a use. as far as what they are used for, that list would be very long and it all depends on the need. I use them with a user defined type a lot for keeping recipes in the PLC. So I make a user defined type called Recipe, then create an array tag like Recipes[100] to store up to 100 recipes in the PLC.
 
As far as dimensions go that seems pretty simply if I'm remembering it right.

---X1 X2 X3 X4
-------------------
Y1| A - B - C - D
Y2| E - F - G - H
Y3| I - J - K - L

In the instance of having an array with 12 elements split among two dimensions you have 4 X rows and 3 Y rows. Say the arrays name is Bottles[12]

If we called for Bottles[X2, Y1] that would be the letter B, Bottles[X2,Y2] would be the letter F. Bottles [X3, Y1] the letter C, etc.

The dimensions simply increase further when we're talking about 3 dimensional arrays, so therefore you have an [X,Y,Z] array instead it's basically just more information but with an increased category level.

Thing is you don't have to do anything unless it makes sense to you, sometimes it's not wise to use arrays sometimes it is. A lot of times it depends on how much information you need to read/write and how often are you going to read/write that information.
 
Last edited:
I'm sorry, Plastek but that's not quite right. You can create an array from any tag type. When you define the tag you give it a tag type and define the number of elements in each dimension. So if Bottles is an array of type DINT[12] then there are 12 DINT's - Bottles[0] through Bottles[11].

To do what you've shown, Bottles would have to be defined as a DINT[4,3]. Now you'll still have 12 DINT's but they're arranged as Bottles[0,0], Bottles[0,1], Bottles[0,2], Bottles[1,0], etc.

Recipes are a a great use for this type of structure as JaxGTO said. Also for indexing and tracking. Usually, arrays are used with indirect addressing so what you'll address like Bottles[RecipeNumber,ColumnNumber]. As a result, it can be somewhat tricky for newer PLC programmers to follow and troubleshoot without proper documentation, but I would be hard pressed to find a better way to duplicate the same functionality.
 
Brandon_L,
Your question is quite broad, let's see if it can get narrowed down a bit. Are you a student who's taking a class on PLCs or are you in a plant trying to learn a how particular section of code works? What experience do you have with programming, PLC or otherwise? This will help us know how big of a chunk of info to give.

If you have access to RSLogix5000/Studio5000, go to the online help and search the Index tab for Array. There you'll find topics such as Array, Arrays - Array Concepts and Arrays - Specifying Bits Within. These are good starting points to consume before reading about Array (file) instructions.

I'd suggest sticking with one-dimensional arrays until you get the concept down. I rarely, if ever, use multi-dimensional arrays. If you have access to a processor, try programming an array tag or two. Then create a rung or two with simple MOV instructions as they deal with single elements of an array. Afterwards, go to COP instructions, etc. which handle multiple contiguous elements at a time. If you get hung up, post a reply with details to help us help you.
 

Similar Topics

This may seem like a really simple question to ask, but I can't seem to find how to delete the last two modules I added to the backplane in...
Replies
11
Views
11,462
Hello all, I have been in the maintenance field for about six years now, and I work around many machines running with the SLC 5/03 and 5/04. We...
Replies
35
Views
9,050
Hi all Longtime lurker, first time poster. Been in the industry for many years, of which the last 12 years have been in the mining industry...
Replies
3
Views
1,628
Hi guys I am trying to get how fifo work in my head and I have attached a program that I have got working but not sure about the unload, I have...
Replies
37
Views
9,792
Hi All, I am facing a problem I configure in my IO Configuration 2 new 1734-AENT each one has a tree of some RTD and some AI Modules After i...
Replies
13
Views
7,131
Back
Top Bottom