The following table outlines the most common data types and when to use
each.
Table 2.1 Data Types
For: Select:
‘analog device in floating-point mode REAL
‘analog device in integer mode (for very fast sample rates) INT
ASCII characters string
bit BOOL
counter COUNTER
digital i/0 point BOOL
floating-point number REAL
integer (whole number] DINT
‘sequencer CONTROL
timer TIMER
‘The minimum memory allocation for a tag is 4 bytes. When you create a tag
that stores data that requires less than four bytes, the controller allocates 4
bytes, but the data only fills the part it needs
Data type Bits
ED 16/15 aj7 1] 0
B00L not used Cort
SINT not used “128 10 +127
INT not used 32,768 t0 +32767
DINT 2,147 483 648 to +2, 147,483,047
REAL -3.40282347E* to -1.17549435E * (negative values)
0
117549435 to 3.40282347E* (positive values)seas GT
Al pogans ave acess to oe
Gatsrisathe onl: ta
sore Tan.3
Farm Fogon
rma ram
local dats) CT {local data)
ama Catena |
‘hme tes tein bea
ns be
vor mas
Dataat the progam scope is isolated from other programs:
«Routines cannot acces data thats at the program scope of another progam.
«+ You ean re-use the tag name of progian-scope tag nlp programs.
Fer example, both Pogcam_A and Frogram_8can ave a pogram tg named
Tat
Certain tags must be controller scope (controller tag).
Ttyou want to use the tag: Then assign this scope:
in more than one program in the project,
in a Massage (MSG) instruction
controller scope (controller tags)
to produce or consume data
to communicate with a PanelView terminal
none of the above program scope (program tags)