Structured View objects
Structured View objects allow the operator view to be mapped to the objects present in a BACnet device, often using a data point addressing description.
With the exception of the top level (root level), all elements are connected to the respective parent object with the help of the iParent element.
The \/ (backslash and slash) characters can be used to create a text composition with the respective parent object.
For the properties Objectname, Description and EventMessageTextsConfig the separator is used, which is defined in the BACnet_Param of the library instance.
To use the function STRING_TO_UTF8
the library Tc2_Utilities must be integrated.
Variables
// use \/ to concat to the string provided by parent node
// countries (root level)
fbGermany : FB_BACnet_View := (
eNodeType := E_BACnet_NodeType.eOrganizational,
sObjectName := 'Germany',
sDescription := 'BECKHOFF offices in Germany' );
fbSwitzerland : FB_BACnet_View := (
eNodeType := E_BACnet_NodeType.eOrganizational,
sObjectName := 'Switzerland',
sDescription := 'BECKHOFF offices in Switzerland');
fbSpain : FB_BACnet_View := (
eNodeType := E_BACnet_NodeType.eOrganizational,
sObjectName := 'Spain',
sDescription := 'BECKHOFF offices in Spain');
// view structure Verl
fbVerl : FB_BACnet_View := (
iParent := fbGermany,
eNodeType := E_BACnet_NodeType.eOrganizational,
sObjectName := '\/Verl',
sDescription := '\/Verl offices');
fbEiserstr : FB_BACnet_View := (
iParent := fbVerl,
eNodeType := E_BACnet_NodeType.eOrganizational,
sObjectName := '\/Eiserstr',
sDescription := '\/Eiserstr offices');
fbFirstFloor : FB_BACnet_View := (
iParent := fbEiserstr,
eNodeType := E_BACnet_NodeType.eOrganizational,
sObjectName := '\/Floor 2',
sDescription := '\/Hardware Development');
fbCabinet : FB_BACnet_View := (
iParent := fbFirstFloor,
eNodeType := E_BACnet_NodeType.eCollection,
sObjectName := '\/Controllers',
sDescription := '\/Cabinet 07');
fbAv01 : FB_BACnet_AV := (
sObjectName := '\/AV01',
sDescription := '\/Analog Value01',
iParent := fbCabinet );
fbController : FB_BACnet_View := (
iParent := fbCabinet,
eNodeType := E_BACnet_NodeType.eDevice,
sObjectName := '\/C6015',
sDescription := '\/Edge Device');
fbAv02 : FB_BACnet_AV := (
sObjectName := '\/AV02',
sDescription := '\/Analog Value02',
iParent := fbController );
// view structure Madrid
fbMadrid : FB_BACnet_View := (
iParent := fbSpain,
eNodeType := E_BACnet_NodeType.eOrganizational,
sObjectName := '\/Madrid',
sDescription := '\/Madrid offices');
fbAv03 : FB_BACnet_AV := (
sObjectName := '\/AV03',
sDescription := '\/Test äöüÄÖÜß',
iParent := fbMadrid );
bChangeAv03 : BOOL;
sTest : STRING(255);
Code
// Germany
fbGermany();
fbVerl();
fbEiserstr();
fbFirstFloor();
fbCabinet();
fbAv01();
fbController();
fbAv02();
// Switzerland
fbSwitzerland();
// Spain
fbSpain();
fbMadrid();
IF bChangeAv03 THEN
bChangeAv03 := FALSE;
sTest := 'ßÄÖÜäöü This is a test';
// requires library Tc2_Utilities
STRING_TO_UTF8( ADR( fbAv03.sDescription ), ADR( sTest ), SIZEOF( fbAv03.sDescription) );
END_IF
fbAv03();