Device Interpretation

<< Click to Display Table of Contents >>

Manual > Server Creation Guide > Tag Edition > Function Explanation >

Device Interpretation

Interpreting the device

There are several types of standard PLC devices, including bit devices, byte devices, and word devices. For example, in Mitsubishi Electric PLCs, "X", "Y", and "M" are bit devices, with the size of one device being 1 bit. "D", "W", and "R" are word devices, with the size of one device being 16 bits. In other words, 16 bit devices such as "X" are equivalent to the size of one word device such as "D".

 

To give a specific example, in Mitsubishi Electric's PLC, "X" corresponds to the input. If the device connected to the input card's contact is On, the value is 1, and if it is Off, the value is 0. Normally, each of these contacts is connected to a different device, and the information the user wants to know is the On/Off state of the device. However, devices have various semantic interpretations depending on the device's specifications. For example, if a BCD input such as a thumb rotary switch is connected to the input card mentioned above, the behavior is usually as follows: BCD uses four contacts to express 0 to 9 in four bits. In other words, the information from X0 to X3 represents one digit. To express a four-digit number, 4 x 4 = 16 bits are required. In such a case, it is only when the unit from X0 to X15 has meaning as a single piece of information, and interpreting each one individually is meaningless. Alternatively, while word devices such as "D" normally represent a single number in 16-bit units, there are cases where they must be handled on a bit-by-bit basis when storing various pieces of information as flags in each bit that makes up the word device.

 

This package is designed to be flexible enough to be interpreted in a variety of ways, regardless of the type of device mentioned above, and is written in a very simple format.

 

The following explains how to set the address of a tag property as an example.

 

c_tag_0081

 

When setting the tag address, you can select the type from Bit, Integer BCD, Integer Binary, ASCII, etc. from the "Type" combo box. If you select "Integer Binary" here, you can select the size from 1 bit, 8 bits, 16 bits, 32 bits, free specification, etc. Furthermore, if you select "free specification", you can specify the number of bits, such as 3 bits or 12 bits. How the device is interpreted is determined by combining these settings.

 

The interpretation of the device follows these rules:

 

■Address
Specifies the position of the device you want to communicate with. If you want to reference bit data from a device that uses an address system expressed in 16-bit units, such as a word device, you can specify the data in bit units by specifying "@" + an integer between 1 and 15 at the end of the address (for example, if you want to get the third bit from the word at address 0 of data register "D", add "@3" to the end of the address and specify it as "000000@3").

 

■ Type
Determines how to interpret the bit string. The same bit string will have different values depending on whether it is retrieved as binary, BCD, or ASCII.

 

■Size
Determines the data size. Specifies how many bits are to be targeted from the device position specified by "Address".

 

 

 

hint

When referencing a bit from a word device, you can indicate which bit it is by specifying "@" + an integer between 1 and 15 at the end of the address. Similarly, for a byte device, specify "@" + an integer between 1 and 7. Note that if you want to get the 0th bit from a word device, there is no need to add "@" to the address. Simply change the type to bit and the 0th bit will be obtained.

 

 

Example of device address setting

Below are some configuration examples.

 

■ Interpret the bit device "X0000" as a bit

c_tag_0082
 

 

■ Interpret the bit device "X0000 to X0015" as a 16-bit integer
c_tag_0083

 

 

■ Interpret the bit device "X0004 to X0019" as a 16-bit signed integer
c_tag_0084

 

 

■ Interpret the 12 bits of the bit device "X0004 to X0015" as 3-digit BCD

c_tag_0085
 

 

■Interpret the word device "D0000" as a 16-bit signed integer

c_tag_0086
 

 

■Interpret the word device "D0000-D0001" as a 32-bit signed integer

c_tag_0087
 
 

■ Of the 16 bits in the word device "D0000," the 0th bit is interpreted as a bit.

c_tag_0088
 

 

■Of the 16 bits of the word device "D0000", the third bit is interpreted as a bit.

c_tag_0089
 

 

■Of the 16 bits in the word device "D0000," the 4th to 7th bits are interpreted as an integer.
c_tag_0090