Class description


The layout of an object body is described in the class description of the object. Here you
also find methods and other properties of the class. The class description is built of
specific class definition objects that reside in a class volume. The class volume has a strict
syntax of how to build the class descriptions. A presentation of the the different objects
that are a part of the class description follows here.

Class volume

Class descriptions reside in a specific type of volume, a class volume. These can contain
two hierarchies, one hierarchy with class descriptions, and one with type descriptions.

$ClassHier

The class descriptions are found under the root object 'Class' of type $ClassHier. Below
the $ClassHier object, $ClassDef objects define the classes in the volume.

$ClassDef

A $ClassDef object with its descendants, describe a class. The name of the object gives the
name of the class. Below the $ClassDef, the following objects can be located

- an $ObjBodyDef object, 'RtBody', that describes the runtime body.
- an $ObjBodyDef object, 'DevBody', that describes the body in the development environment.
- a Template object, i.e. an object of the current class that contains default values for
instance objects of the class.
- one or several body objects that contains data for a specific function.
- a PlcTemplate object, that can be opened by the plc editor, and that contains plc code for
the class.
- menu objects that define the popupmenu in the navigator, configurator and xtt.
- method objects that link to methods that are called for example when objects are created
or moved in the development environment.

$ObjBodyDef

An $ObjBodyDef object can either have the name 'RtBody', and then describe the runtime body,
or the name 'DevBody' and describe the development body. The attribute 'StructName' contains
the name of the c-struct of the class in the included file that is generated for the volume.
Below the $ObjBodyDef object, one attribute object for each attribute in the object body is
located. $Attribute objects are used for data objects, and $Input, $Intern and $Output for plc
functionobjects.


$Attribute

An $Attribute object describes an attribute in a body. The attribute can be of the following
type:

- a base type, e.g. Boolean, Float32, Time, Int16.
- a derived type, e.g. String80, Text1024, URL.
- an array of a base type or derived type.
- another class.
- an array of a class.
- an rtdb pointer, i.e. a pointer that can be interpreted by all processes.
- a private pointer, i.e. a pointer that is valid on one single process.

The type is stated in the attribute 'TypeRef'. In the attribute 'Flags' you state if the
object describes an array, pointer, class etc. If the object describes an array, the number
of elements is stated in 'Elements'.

$Input

$Input describes an input pin in a functions object in the plc program. The input can be of
type Boolean, Float32, Int32, String80, Time, DeltaTime or of datatype (pointer to Float32).
$Input gives rise to an attribute with two elements, one element of the stated type, and one
element with a pointer to the stated type. If the input is connected, the pointer points to the
connected output attribute, if the pointer is not connected it points to its first element,
where you then can specify a value for the input.

The attribute 'PgmName' states the name of the attribute in the c-struct, and 'GraphName' the
textstring that is written in the function object at the input pin.

$Intern

Defines an intern attribute in a function object, i.e. an attribute that is neither an input
nor an output.

$Output

$Output describes an output pin in a function object. The same datatypes is valid for an
$Output as for an $Input.

$Buffer

$Buffer specifies an attribute that contains data of a certain size that only a single function
is able to interpret. The data is described by a class, but is not viewable in for example
xtt. PlcNode, that is found in all plc objects, is an example of a $Buffer. Here you find
graphic information that is only of interest for the plc editor.

Class body

A class can contain a class body object. The class body object contains data that is common
for all instances of the class. One example of a class body object is $GraphPlcNode that
reside in all plc classes. $GraphPlcNode contains data for code generation and graphic layout
of the function object.

Menus

Menu objects are used to define popupmenus for objects in the development environment and in
the operator environment. $Menu defines a popupmenu in the development environment and
$RtMenu in the operator environment. Below the menu object, menu alternatives are defined by
$MenuButton objects, and submenues with $MenuCascade objects. The menu objects are placed
below the $ClassDef object.

The menu object calls methods, i.e. c functions that are linked with the development or
operator environment. There is for the moment no possibility to do this from a project. This
has to be done from the ProviewR source code.

$Menu

$Menu objects describe popup menus in the development environment. The object name specifies
the function, the first part states the tool (Navigator/Configurator). The five last letters
state during which conditions the menu is present, dependent on which objects are selected
or pointed at.

char 1: P stands for pointed, i.e. the object at which the pointer points.
char 2: states what should be pointed at: 'o' an object, 'a' an attribute,
         'c' a class in the palette.
char 3: 's' stands for selected, i.e. the object that is selected.
char 4: states what the selected object should be: 'o' an object,
         'a' an attribute, 'c' a class in the palette.
char 5: states if selected and pointed should be the same object:
         's' same object, 'n' different objects.

Example ConfiguratorPosos: 'Po' the pointer points at an object, 'so' one object is selected,
's' the object the pointer points at and the selected object is the same object.

$RtMenu

The menu objects that describe popup menus in the operator environment.

$MenuButton

Defines a menu alternative in a popup menu.