What exactly is a "Word" in relation to PLC's?

N

Thread Starter

New to Programming

I'm new to PLC programming and having a hard time understanding the concept of a "Word". Can anyone help define this (with as much detail as possible) or point me in the direction of a link that will do so. Thanks.
 
T
A word refers to the size of data the processor handles. This will vary by PLC model. If the PLC uses a 16 bit processor a word refers to 16 contiguous bits (2bytes). A 32 bit processor uses a 32 bit word. Older PLCs used 8 bit words, there are still alot of these out there. Sometimes a floating point number is refered to as a word, a convenient but inaccurate nomenclature.
 
Depending on the make and model of the PLC (or other computer), a word is 2, 4 or 8 bytes. On most PLCs, it's 2 bytes; on other computers, 4 is most common and 8 is just coming in on the high end. This is how many bytes the PLC (computer) can handle in one operation; for instance, addition will normally add two words to produce a third word.

2-byte is also called 16-bit
4-byte 32-bit
8-byte 64-bit

HTH - HAND

Jiri
--
Jiri Baum <[email protected]> http://www.csse.monash.edu.au/~jirib
MAT LinuxPLC project --- http://mat.sf.net --- Machine Automation Tools
 
In addition to being a defined size (e.g. 16 bits), in Modicon's Concept software a Word is also a specific data type, which is distinct from an integer (also 16 bits). Some operations can be done on a Word which cannot be done on an Int, and you cannot simply use one in place of another.

Don Zunti
Delco Automation Canada
 
A

Anil kumar J.P

hi, it's a software related program will be load in this part of hard ware, depends on data to be configured. now we r using plc's in our substation automation project.
 
G

George Robertson

A "word" is an arbitrary unit of measure of memory. It depends upon what is in the word as well.

For example, a 16 bit integer (two bytes) is commonly called a word.

A 32 bit floating point (4 bytes) is called a word in some cases, two words in others.

To the purist, the "word" size has to do with the number of bits the processor can handle in one operation. Even this blurs these days. Let's say you have a processor with a 32 bit accumulator. Yea! Our word size is 32 bits! (4 bytes). Well, not exactly. This processor has a 16 bit data bus. The accumulator is a double word wide, depending upon whom you ask.

Confused? Study more, and it will get worse!

The good news is that it doesn't matter in general. In each case, you need to study the manual for the particular PLC you are using. Make
sure you understand what is meant by a word in the context of the instruction you are using. If you are doing a move of a block of 100 floating point registers, and the instruction says that one of the arguments is how many words to move, you must know whether you need to move 100 or 200 words.

George G. Robertson, P.E.
Manager of Engineering
Saulsbury E & C
[email protected]
(915) 366-4252
 
J

jean-marie berger

The concept of word is not only used in PLC programming but is in fact coming from the "microprocessors world".

A quick definition could be "a word is a collection of bits". Based on the microprocessor used a word can be made of 2, 4, 8, 16, ... bits.

So in a PLC, in general words are used to store data and values (integer or others).

But as they are defined as collection of bits, some operations can be done at the bit level on words that couldn't be done on integers for instance. A simple exemple would be "shift the word to the left" which in fact is equivalent to multiply by two !!!

Hope it helps.
Regards
Jean-Marie
 
C
A word is usually, but not always, the "width" of the processor, in automation or other places. On a 16 bit uP it will often be 16 bits, etc. For a long time, everything was byte oriented, with a byte being 8 bits wide. Bytes still appear in everything because an ascii character fits in a byte and many more subtle things are tied to bytes. Since many PLCs were/are 16 bits wide, a word is usually held to be 16 bits or two bytes. The C language, for example, doesn't define data type widths except as a minimum because of the fact that these terms can be machine dependent. A reasonably valid rule of thumb at the present is that a byte is 8 bits, a word is 16 bits or two bytes, and a doubleword is 32 bit or four bytes. There are exceptions but I don't think you'll see any. I think this is pretty much an ad hoc "standard". I doubt we'll see any more
arbitrary length machines. As an aside, Octal became popular on 12 bit machines.

Regards

cww
 
The earlier post which referenced data types is probably the most useful definition of a 'word' here. Sure, the old concept of a word of information being whatever a given microprocessor could handle at one go was useful when designing machine level languages. But as far as modern PLCs are concerned, I think we should recognise the IEC61131-3 definition of various data types. Among other things, this standard defines certain data types not only in terms of how much memory they consume, but also what the valid representation, values, and operations for them are. For example, there are two IEC data types which are both 16-bits long: the WORD and the INTEGER. To get the full definition of these check out the IEC standard, but broadly speaking an INTEGER holds a numerical value between -32768 and +32767, whereas a WORD is simply a pattern of bits. You carry out arithmetic functions on an INTEGER (add, subtract etc.) but you carry out logical instructions on a WORD (AND, OR etc.) Many manufacturers of software and hardware blur these distinctions according to how they implement IEC61131-3, so although this industry standard definition exists you have to be aware of whether your supplier has adopted it or not.
 
D

Donald Pittendrigh

Hi All

It may be of little interest to the original request, but I believe that every text book I have ever seen and every PLC I have ever worked on is clear that a word is 2 x 8 bit bytes and a structure consisting of 2 words or 4 bytes is called a double word, unless in some cases it is used to represent a floating point number, where it normally still occupies a double word but is often referred to as a real value rather than a
double word. Similarly double precision integers are often called long but they still occupy a double word. I have never heard of a word used to refer to 4 or 8 bytes.

Regards
D. Pittendrigh
 
G
A word is the bit-width of a CPU's data and instruction handling capabilities. A word is 4 bytes on a 32-bit machine and 8 bytes on a 64-bit machine.

From the "whatis.com" site, the following definition:

"whatis.techtarget.com/definition/0,,sid9_gci498438,00.html":http://whatis.techtarget.com/definition/0,,sid9_gci498438,00.html

"In computer architecture, a word is a unit of data that can be moved in a single operation from storage to a processor register. In the most familiar architectures of the past few decades, a word has been four eight-bit bytes in length, or 32 bits. Both IBM's mainframe processors and Intel's processors, used in standard PCs, have used a 32-bit word.

Recent processor architectures from Intel and others provide for a 64-bit word"

Regards,
Greg Goodman
Chiron Consulting
 
Donald:
> It may be of little interest to the original request, but I believe that every text book I have ever seen and every PLC I have ever worked on is clear that a word is 2 x 8 bit bytes>

Yeah, which is what I said. On most PLCs it's 2 bytes.

> I have never heard of a word used to refer to 4 or 8 bytes.>

That's its meaning on most modern non-PLC computers, except perhaps the Intel x86 family. Those are a bit schizophrenic about what's a word, because it's changed from 16 to 32 bits mid-product-line and all the docs still use the old (16-bit) terminology.

Jiri
--
Jiri Baum <[email protected]> http://www.csse.monash.edu.au/~jirib
MAT LinuxPLC project --- http://mat.sf.net --- Machine Automation Tools
 
A word is 16 bits, a bit is the smallest data handled by a processor. A word of data can be looked at as 4 bytes also. You can have the processor look at individual bit values, byte values, or whole word values. It looks at each bit of data as a 1 or a zero. A word value in decimal radix of ooooooooooooo111 would be 7. The highest word value is 32767 with all positions being 1 except the far left, it is allways zero for positive numbers. When you go into different numbering systems it gets really interesting. This is explained faily well in Allen Bradleys advanced programming manual. You can find that and any other info you need to better understand plc programming at the Allen Bradley website.
 
Top