Page 330
PROFIBUS-Specification-Normative-Parts-6:1997
Copyright by PNO 1997 - all rights reserved
4.3.2 Coding of Structure Information
User data may be combined to structured (constructed) components.
The communication partner shall be able to identify these structures and the
components of these structures. The P/C flag of the ID Info is 1.
4.3.2.1 SEQUENCE
The SEQUENCE structure is comparable with a record. It represents a collection
of user data of the same or of different Data Types.
Before the SEQUENCE structure there is an ID Info, which conveys the length not
in octets but in number of components. The number of components is less than the
total length in octets. In most cases an extension is not necessary due to this
length encoding.
+----+----+----+----+----+----+----+----+
! 1 ! tag ! length = number !
! ! of components !
+----+----+----+----+----+----+----+----+
b8 b7 b6 b5 b4 b3 b2 b1
Figure 14. Coding of ID Info for a SEQUENCE
A structure may contain user data or further structures as components. Single
components may be OPTIONAL, i.e. they may be omitted. In this case the ID Info
is omitted too. A SEQUENCE shall be counted as a single component even if it
contains several components.
EXAMPLE: The hexadecimal notation is used for the following example of encoding.
The upper case letter X is used as a fill-in for unknown values, such as the
length of the single components or the tag of the structure. A lower case letter
x represents user data.
Syntax Description Code comment
Person [1] IMPLICIT SEQUENCE { 94 4 components
[0] Surname, 0X xx ... tag 0
[1] First name, 1X xx ... tag 1
[2] City, 2X xx ... tag 2
[3] Street 3X xx ... tag 3
}
4.3.2.2 SEQUENCE OF
The SEQUENCE OF structure represents a succession of components. It is compara-
ble with an array. The structure may contain one or more components. The compo-
nents may be user data or structures.
The coding is as for the structure SEQUENCE. For the statement of the number of
components the number of repetitions shall be taken into account. The tags of
the Syntax Description shall be used for the components of SEQUENCE OF. The same
tags may be coded several times in succession.
EXAMPLE:
employeedata [2] IMPLICIT SEQUENCE OF {
[0] Person
}