Introduction To Siemens Data Types

Published on Jun18, 2021 | Category: data types
Share this article:

A data type specifies which type of value stored in memory of PLC. data type have fixed type of property. Each data type has a defined length.

Siemens BOOL Data Type

Boolean Types, only two values are possible either 1 or 0(true/false). bool data type are used to represent status of switch condition, flags in programs, status of plc, contact like NO, NC, reset, set, flip flop, various block output, comparison output, COIL, Enable(EN) and Enable output (ENO).Boolean 0 refers OFF(false) and 1 refers ON(true) . Boolean Types used where only two condition either ON or OFF like switch either ON or OFF, status of PLC FLAGS like overflow, under flow, error, plc status, status of motor running, sensors status. setting a 1 bit to coil of motor contactor, push button, limit status like high limit, low limit. output status of coil considered below example. for example I0.0 , Q0.0, m0.0 etc.

img/DATATYPEBOOLEXAMPLE.webp

Siemens INT Data Type

Data Type INT (INTEGER) is 16 bit and Store Only Natural Numbers Without Decimal Places Like 12, 56 Etc. Value Like 33.45, 23.56 Not Stored In INTEGER Data Type, If Value Is 33.56 so INT Data Type Store Only 33. In Terms Of PLC Integer Value Comes From Analog Signal Or Memory Of CPU. For Example If You Connect Your Positioner Sensor For Positioning, Output Of Positioner Sensor Is Analog(4 To 20 MA) .This Analog Signal Converted Into Digital Signal By Analog Module Than We Make Program For Plc. When We Make Program Of These Type Of Analog Signal Scaling Or Calibration Is Required (We Discuss In Next Article). In Siemens Integer Represent Signed Decimal Number. INT Represent Only Integer Value. Maximum Allowed Range Or Maximum Allowed Value +32 767 And Minimum Allowed Value Or Minimum Range -32 768. When You Entered Value Below Minimum Range Underflow Status Bit Set To 1 And If Value Is More Than +32 767 For Example 32768 Overflow Bit Set To 1. Integer Value The Space That An Integer Occupies In The Memory Is One Word. Example Of Int Types: MW2, MW 4, IW 4, IW6 , QW 34, PIW 32.

img/datatypeint.webp

Siemens Double INT Data Type

Data Type Double INT (DINT) is 32bit data tpe, Store Only Natural Numbers just like INT but range of DINT is more than int.double int is 32 bit and int is 16 bit. so the minimum range for DINT is -2 147 483 648 and maximum range is +2 147 483 647. example of DINT is MD 2, PID 40 etc.

img/datatypedint.webp

Siemens word Data Type

word is 16 bit data type and Word represent 3 digit BCD number, Binary number, Hexadecimal number. word store 3 digit BCD number, Binary number, Hexadecimal number. One group of 4 bits represents one digit of a signed decimal number or the sign of the decimal number. The groups of 4 bits are combined to form a word. The four most significant bits indicate the sign of the number where 1111 indicates minus and 0000 indicates plus sign. Range for word is -999 to +999 and 16 bit. for example mw 32, iw 34 etc.

img/datatypeword.webp

Siemens double word Data Type

word represent 3 digit BCD number signed, Binary number, Hexadecimal number. One group of 4 bits represents one digit of a signed decimal number or the sign of the decimal number. The groups of 4 bits are combined to form a word . The four most significant bits indicate the sign of the number where 1111 indicates minus and 0000 indicates plus sign. range for DWORD is -9 999 999 to +9 999 999.

img/datatypedword.webp

Siemens REAL Data Type

data type real is 32 bit and store only real or float value in the memory. The Floating-point numbers are the real numbers with fractional component. float has 32 bit storage.The upper limit for float is ±3.402823e+38, and lower limit for float is ±1.175 495e-38. input and output of some of the instruction like SQRT, SQR, sin, cos, tan, EXP, ASIN, ACOS, ATAN, LN real data type. real value represent with decimal number example of floating point number(real number) 1.3333, 12.456, 122.4345°C, 12.34 sqm, value of PI, etc . real type represent very large value as well as small values. Floating-point numbers in STEP 7 follows the rule of ANSI/IEEE-754-1985 for Binary Floating-Point Arithmetic described by, IEEE-754 Standard . format of real data type according to ANSI/IEEE

img/datatypedword.webp

Siemens Character (CHAR) data type

Character (char) data type store only ASCII Character like A, B, C, etc. char have 8 bit storage.

img/datatypechar.webp

Siemens S5TIME Data Type

Data Type S5TIME is 16 bit and store time duration of Siemens timer in BCD format. for example S5T#10s, S5T#10ms,W#16#10s when timer start so timer value decrement by 1 until it reaches 0. you can enter timer value by following syntax

  • S5T#aH_bM_cS_dMS : where a is timer value in hour, b timer value in minute, c timer value in second, d timer value in milliseconds. for example s5t#10s, s5t#1h, s5t#100ms, s5t#10M. The maximum time value which allowed in is 9,990 seconds, or 2H_46M_30S.
  • W#16#ABC : where W stands for timer base, and ABC represents timer value in BCD Format. for example W#16#9999.
  • img/datatypetime.webp

    Siemens TIME (IEC time) data type

    iec standard data type Time is 32 bit and store time value, where s5time is 16 bit but Time data type is 32 bit. data type time not used in Siemens timer directly.

    img/datatypetimevalue.webp

    Siemens date (IEC time) data type

    iec standard data type store date. date data type is 16 bit and store only date format value. The DATE value must be between the limits DATE#1990-1-1 and DATE#2089-12-31.

    Siemens date (IEC time) Time of day

    iec standard time of day data type represent time of day in Hours: Minutes: Seconds: Milliseconds. time of day is 32 bit and store only day of time format value. A TOD data type is stored as an unsigned integer number in milliseconds, with zero equal to midnight.

    img/datatypedateandtod.webp