Arrays and Words

Controls Tech

Member
Join Date
Jun 2014
Location
Inside a OR gate
Posts
54
Hello everyone, this is just a general question that has me thinking, what is the difference between a Word and an Array, reading bits from a word and elements from an array have me kinda confused. Seems like the terms are almost interchangeable. Tag addressing examples for logix5000.
 
In regards to RSLogix, a "Word" is usually used to describe a tag that stores an integer (SINT, INT, DINT).

An array is a tag that is declared in a way that can store many values in the same tag name. A tag declared like this would be an array:

TagName: MyTag
DataType: DINT[10]

Now you have a tag called MyTag that can store 10 different DINT's. MyTag[0], MyTag[1], MyTag[2] and so on.

Each tag in that example could be called a "word". Or MyTag can store 10 "Words"

Arrays can be any data type, "Words", STRING, TIMERS, UDT's, Messages, and so on. Whenever you see "[ ]" being used, you are looking at an array.
 
A word (we'll use a DINT for this example) is a collection of 32 BOOLs in one container (the DINT). So as it applies to BOOLs in a DINT, neither the storage element (a BOOL), nor the container (the DINT) can be changed.

As for arrays, you have greater freedom as to what your store in your array (BOOL, SINT, DINT, REAL, etc), and greater freedom as to how large or how small to make your container.

With arrays you are not limited to one type of element for the array, you could create a UDT (with a combination of BOOLs, DINTs, REALs, for example) and then create an array of those UDT types.
 

Similar Topics

Hi. This is pretty basic but I'm struggling to find an efficient solution. I have a float value of let say 666.555 that I want to move / split...
Replies
3
Views
154
Hello. I've been using the answers in this forum for a while now, so thank you. Usually I can find the answer I'm looking for with a basic...
Replies
8
Views
733
Hello, first time poster here! A belated "thank you" for the direction I've already received from this forum! So, can I do this? Move value 1...
Replies
6
Views
677
My first real attempt at utilising the AOI function in Compactlogix. The issue I'm having is, I have an array of INT[400], but in my AOI I'm only...
Replies
1
Views
439
Is there a way in CX-Programmer to initialise an array? Set all values to zero or false depending on the data type Solutions in Ladder and...
Replies
2
Views
1,225
Back
Top Bottom