Mitsubishi Electronics FX1S manual Word Devices, Interpreting Word Data

Models: FX1S

1 120
Download 120 pages 31.35 Kb
Page 113
Image 113

FX Series Programmable Controllers

Devices in Detail 4

4.14.2Word Devices

Word devices such as T, C, D, V and Z can store data about a particular event or action within the PLC. For the most part these devices are 16 bit registers. However, certain variations do have 32 bit capabilities, as can pairs of consecutive data registers or combined V and Z registers.

It may seem strange to quote the size of a word device in bits. This is not so strange when it is considered that the bit is the smallest unit of data within the PLC. So by identifying every thing in bit format a common denomination is being used, hence comparison etc is much easier.

Additional consequences of this bit interpretation is that the actual data can be interpreted differently. The physical pattern of the active bits may be the important feature or perhaps the numerical interpretation of the bit pattern may be the key to the program. It all comes down to how the information is read.

4.14.3Interpreting Word Data

As word data can be read in many ways the significance of certain parts of the word data can change. PLC’s can read the word data as:

-A pure bit pattern

-A decimal number

-A hexadecimal number

-Or as a BCD (Binary Coded Decimal) number

The following examples will show how the same piece of data can become many different things depending wholly on the way the information is read or interpreted.

a)Considering a bit pattern

The following bit pattern means nothing - it is simply 16 devices which have two states. Some of the devices are randomly set to one of the states. However, if the header notation (base 2) is added to the 16 bit data the sum, decimal, total of the active bits can be calculated, e.g.,

1

0 0 1 1 1 1 0 0 1 1 1 0 1 0 1

MSB 214

213

212

211

210

29

28

27

26

25

24

23

22

21

20

 

1

0

 

0

 

1

 

1

 

1

 

1

0

0

1

1

1

0

1

0

1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Decimal value = (20 x 1) + (22 x 1) + (24 x 1) + (25 x 1)

+(25 x 1) + (29 x 1) + (210 x 1) + (211 x 1) + (212 x 1)

Decimal value =

7797

This is in fact incorrect!

There is one bit device which has been shaded in. If its header notation is studied carefully it will be noted that it says MSB. This is the Most Significant Bit. This single bit device will determine if the data will be interpreted as a positive or negative number. In this example the MSB is equal to 1. This means the data is negative.

The answer however, is not -7797.

4-39

Page 113
Image 113
Mitsubishi Electronics FX1S manual Word Devices, Interpreting Word Data