1.

What Is Meant By Complex Data Types?

Answer»

Complex data types define data groups that are larger than 32 bits or data groups CONSISTING of other data types.

The following table describes the complex data types. You define structures and arrays either in the variable declaration of the logic block or in a data block.

Data Types :

DATE_AND_TIME

Defines an area with 64 bits (8 bytes). This data type saves in binary coded decimal format: DT

STRING

Defines a group with a maximum of 254 characters (data type CHAR). The standard area reserved for a character string is 256 bytes long. This is the space REQUIRED to save 254 characters and a header of 2 bytes. You can reduce the memory required for a string by defining the number of characters that will be stored in the character string (for example: string[9] ‘Siemens’).

ARRAY

Defines a multidimensional grouping of one data type (either elementary or complex). For example: ”ARRAY [1..2,1..3] OF INT” defines an array in the format 2 x 3 consisting of integers. You access the data stored in an array using the Index (”[2,2]”). You can define up to a maximum of 6 dimensions in one array. The index can be any integer (-32768 to 32767).

STRUCT

Defines a grouping of any combination of data types. You can, for example, define an array of structures or a structure of structures and arrays.

UDT

Simplifies the structuring of large QUANTITIES of data and ENTERING data types when creating data blocks or declaring variables in the variable declaration. In STEP 7, you can combine complex and elementary data types to create your own ”userdefined” data type. UDTs have their own name and can therefore be used more than once.

FB, SFB

You determine the structure of the assigned instance data block and allow the transfer of instance data for several FB calls in one instance DB.

Structured data types are saved in accordance with word limits (WORD aligned).

Complex data types define data groups that are larger than 32 bits or data groups consisting of other data types.

The following table describes the complex data types. You define structures and arrays either in the variable declaration of the logic block or in a data block.

Data Types :

DATE_AND_TIME

Defines an area with 64 bits (8 bytes). This data type saves in binary coded decimal format: DT

STRING

Defines a group with a maximum of 254 characters (data type CHAR). The standard area reserved for a character string is 256 bytes long. This is the space required to save 254 characters and a header of 2 bytes. You can reduce the memory required for a string by defining the number of characters that will be stored in the character string (for example: string[9] ‘Siemens’).

ARRAY

Defines a multidimensional grouping of one data type (either elementary or complex). For example: ”ARRAY [1..2,1..3] OF INT” defines an array in the format 2 x 3 consisting of integers. You access the data stored in an array using the Index (”[2,2]”). You can define up to a maximum of 6 dimensions in one array. The index can be any integer (-32768 to 32767).

STRUCT

Defines a grouping of any combination of data types. You can, for example, define an array of structures or a structure of structures and arrays.

UDT

Simplifies the structuring of large quantities of data and entering data types when creating data blocks or declaring variables in the variable declaration. In STEP 7, you can combine complex and elementary data types to create your own ”userdefined” data type. UDTs have their own name and can therefore be used more than once.

FB, SFB

You determine the structure of the assigned instance data block and allow the transfer of instance data for several FB calls in one instance DB.

Structured data types are saved in accordance with word limits (WORD aligned).



Discussion

No Comment Found