P4: PLC for SINUMERIK 828D
14.3 Programming
Basic Functions
1104
Function Manual, 09/2011, 6FC5397-0BP40-2BA0
14.3.2.4
Data types
When defining symbols in the global symbol table, a data type does not have to be explicitly specified, as it is
implicitly specified by the data associated with the symbol.
If you assign values in the local variable table, then you must specify a data type for every local variable.
By explicitly specifying a data type for a value, you give the Programming Tool PLC828 clear instructions how
much memory must be assigned for the value (e.g. the value 100 can be stored as BYTE, WORD or DWORD)
and how the value is to be represented (e.g. should 0 be interpreted as BOOL or as numerical value?).
The operations and parameterized subprograms are recognized using a precise definition. This definition is also
called signature. For all standardized operations, the data types permissible for the addresses of the operation
are specified in the signature. For parameterized subprograms, the signature of the subprogram is generated by
the user in the local variable table.
Data type check
The Programming Tool PLC828 offers a simple data type check. If a data type is specified for a local or global
variable, the software checks that the data type of the address corresponds to the signature of the operation.
Note
Using local and global symbols
Local variables use the temporary, local memory of the target system. Subprograms that only
use local variables and transfer parameters, are easy to port and can be flexibly used.
If you wish to use a parameter in several program organizational units, then it makes sense
to define this parameter as global symbol in the symbol table - and not in the local variable
table. This reason for this is that then you would have to include the parameter in every local
variable table of the individual POUs.
Note
Initialization of local variables
As local variables occupy temporary memories, you must initialize the local variables in the
POU each time that the POU is called. You cannot assume that a local variable keeps a data
value from one POU call to the next.
Elementary data types
Description
Memory area
BOOL (bit)
Boolean
0 ... 1
BYTE
Byte, unsigned
0 ... 255
WORD
Integer number (16 bit)
-32768 ... +32767
DWORD (Double Word)
Integer number (32 bit)
-2147483648 ... +2147483647
REAL
32-bit floating point
+/- 10
-37
... +/- 10
+38
Complex data types
Description
Memory area
TON
Switch-on delay
100 ms T0 ... T15
10 ms from T16
TOF
Switch-off delay
100 ms T0 ... T15
10 ms from T16
Содержание SINUMERIK 828D Turning
Страница 34: ...Basic Functions 34 Function Manual 09 2011 6FC5397 0BP40 2BA0 ...
Страница 146: ...A3 Axis Monitoring Protection Zones 2 6 Data lists Basic Functions 146 Function Manual 09 2011 6FC5397 0BP40 2BA0 ...
Страница 328: ...F1 Travel to fixed stop 6 5 Data lists Basic Functions 328 Function Manual 09 2011 6FC5397 0BP40 2BA0 ...
Страница 816: ...K2 Axis Types Coordinate Systems Frames 10 9 Data lists Basic Functions 816 Function Manual 09 2011 6FC5397 0BP40 2BA0 ...
Страница 1198: ...P4 PLC for SINUMERIK 828D 14 6 Function interface Basic Functions 1198 Function Manual 09 2011 6FC5397 0BP40 2BA0 ...
Страница 1752: ...Appendix 20 2 Overview Basic Functions 1752 Function Manual 09 2011 6FC5397 0BP40 2BA0 ...
Страница 1774: ...Glossary Basic Functions 1774 Function Manual 09 2011 6FC5397 0BP40 2BA0 ...