Home > Common Problem > What data type is dint?

What data type is dint?

WBOY
Release: 2022-09-05 11:05:03
Original
26749 people have browsed it

dint is a 32-bit integer type with a signed bit; the representation method and range of dint are "L#-2147483648~L# 2147483647", which is defined as a double integer or a long integer, and the bytes are the data in the computer Units of quantity. In computers, data are only expressed in the form of 0 and 1.

What data type is dint?

The operating environment of this tutorial: Windows 10 system, DELL G3 computer.

What data type is dint

DINT 32-bit integer has a value range of -2147483648~2147483647

dint is 32-bit with sign bit bit integer. The representation method and range of dint are L#-2147483648~L# 2147483647; byte is the unit of data amount in the computer. In the computer, data is only expressed in the form of 0 and 1.

dint data introduction

A 32-bit integer with a signed bit, DINT type data - a 32-bit integer with a signed bit, defined as a "double integer" ” or “long integer”, its representation method and range are: L#-2147483648~L# 2147483647. In the market, 1500 points and 3000 points are usually called double integers

Extended knowledge

Take Siemens TIA S7-1200 as an example , the basic data types of 1200 include: binary numbers, integers, floating point numbers, timer data, time and date, strings, etc. The following mainly explains the confusing binary numbers, integers and floating-point numbers:

1. Binary numbers (BOOL, BYTE, WORD, DWORD, LWORD)

(1) BOOL type: Boolean , represents a 1-bit value, that is, 0 or 1.

(2) BYTE: Byte is a bit string, occupying 8 bits. For example, 2#0 to 2#1111_1111, the corresponding hexadecimal number is 16#00-16#FF. Such as IB2, MB10, DB1.DBB4

(3)WORD: word is a bit string, occupying 16 bits, for example: 2#0 to 2#1111 1111 1111 1111, the corresponding hexadecimal number That is 16#0-16#FFFF. Such as MW10, DB2.DBW1.

(4)DWORD: double word, which is a bit string occupying 32 bits. For example: 2#0 to 2#1111 1111 1111 1111 1111 1111 1111 1111. The corresponding hexadecimal number is 16#0 —16#FFFFFFFF. Such as MD10, DB2.DBD1.

2. Integers (SINT, USINT, INT, UINT, DINT, UDINT, LINT, ULINT), where S stands for short, U stands for unsigned, and D stands for double.

(1)SINT and USINT

these two are the same short integer, occupying 8 bits, address examples: MB0, DB1.DBB0. But the value ranges of these two are different.

SINT: signed short integer, the value range is -128-127, 2#0-2#0111 1111, the highest bit is the sign bit,

USINT: unsigned short integer, taken Value range 0-255, 2#0-2#1111 1111

(2)INT and UINT

are the same as integer numbers, occupying 16 bits, address example: MW0, DB1.DBW0. But the value ranges of these two are different.

INT: signed integer, value range -32768-32767, 2#0-2#0111 1111 1111 1111, the highest bit is the sign bit,

USINT: unsigned short integer, The value range is 0-65535, 2#0-2#1111 1111 1111 1111

(3) LDNT and UDINT

are the same double integers, occupying 32 bits, address Example: MD0, DB1.DBD0. But the value ranges of these two are different.

DINT: signed integer, value range -2,147,483,648—2,147,483,647, 2#0—2#0111 1111 1111 1111 1111 1111 1111 1111, the highest bit is the sign bit,

UDINT: None Symbolic integer, value range 0-4,294,967,295, 2#0-2#1111 1111 1111 1111 1111 1111 1111 1111

3, floating point number

real (or floating point) number in 32 bits Represented by single precision number (Real) or 64-bit double precision number (LReal). Single-precision floating-point numbers have a precision of up to 6 significant digits, while double-precision floating-point numbers have a precision of up to 15 significant digits.

When entering floating-point constants, you can specify up to 6 (Real) or 15 (LReal) significant digits to maintain precision.

To summarize: The above data types are the most commonly used data types in programming. Through the above introduction, everyone should have a certain understanding of them. Although the number of bytes occupied by data of different data types may be They are the same, but their data are actually different. For example, INT and WORD are both 16 bits, but their data content is different. You must pay attention to it in programming. Generally speaking, WORD is often used for logical calculations, and INT is often used for mathematical calculations. The distinction is strict when using SCL programming for TIA S7-1200.

For more related knowledge, please visit the FAQ column!

The above is the detailed content of What data type is dint?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template