Size Determined Data Type For Simatic Global Symbols; Advantages Of Data Type Checking - Siemens SIMATIC S7-200 System Manual

Hide thumbs Also See for SIMATIC S7-200:
Table of Contents

Advertisement

Basic Concepts for Programming an S7-200 CPU
No Data Type Checking The no data type checking mode is available only for
SIMATIC global variables where the data types are not selectable. In this mode, all
data types of equivalent size are automatically assigned to the symbol. For
example, a symbol that is assigned the address VD100 is assigned the data types
shown in Table 4-6 automatically by STEP 7-Micro/WIN 32.
Table 4-6

Size Determined Data Type for SIMATIC Global Symbols

User Selected Address
V0.0
VB0
VW0
VD0

Advantages of Data Type Checking

Data type checking helps you to avoid common programming mistakes. If an
instruction supports signed numbers, STEP 7-Micro/WIN 32 will flag the use of an
unsigned number for an instruction operand. For example, the relation comparison
< I is a signed instruction. -1 is less than 0 for signed data type operands.
However, when the < I instruction is allowed to support an unsigned data type, the
programmer must ensure that the following never occurs. During run-time program
execution, an unsigned value of 40,000 is actually less than 0 for a < I instruction.
Warning
!
You should ensure that the use of the unsigned number for signed instructions
does not cross the positive and negative boundary.
Failure to ensure that unsigned numbers for signed instructions do not cross the
positive and negative boundary can create unpredictable results in your program
or controller operation. Unpredictable controller operation can result in death or
serious injury to personnel, and/or substantial property damage.
Always ensure that the unsigned number for a signed instruction does not cross
the positive and negative boundary.
In summary, under the IEC 1131-3 editing mode, strong data type checking helps
you to identify these errors during compilation by generating errors for data types
that are illegal for the instruction. This capability is not available for the SIMATIC
editors.
4-14
Assigned Equivalent Data Type
BOOL
BYTE
WORD, INT
DWORD, DINT, REAL
S7-200 Programmable Controller System Manual
A5E00066097-02

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents