Herunterladen Inhalt Inhalt Diese Seite drucken

Bosch rexroth IndraWorks 15VRS Anwendungsbeschreibung Seite 392

Feldbusse
Vorschau ausblenden Andere Handbücher für rexroth IndraWorks 15VRS:
Inhaltsverzeichnis

Werbung

380/395
Gebäudeautomatisierung
IF runObjID.typ = objID.typ AND
errCode := ERR_CODE_OBJ_ID_ALREADY_EXISTS;
BACnetEventCallback := FALSE;
EXIT;
END_IF
i := i + 1;
END_WHILE
ELSE
//No object specification given which can be interpretated, so
//issue a standard error
BACnetEventCallback := FALSE;
END_IF
ELSE
//If the object type is not supported to be created issue the
//appropriate error
errCode := ERR_CODE_DYN_CREATION_NOT_SUPP;
BACnetEventCallback := FALSE;
END_IF
//If everything is all right till now (BACnetEventCallback is TRUE) try to
//create the object
IF BACnetEventCallback THEN
IF pCreateObj^.pServiceInfo^.fValuesPresent > 0 THEN
//If property values are given by the service request use them
bacResult := CmpBACnet.BACnetConstructObject(destInstNumber,
ELSE
//If no property values are given by the service request just
//create the object using the default implementation
bacResult := ConstructDefaultObject(objID.typ, objID.instNumber,
END_IF
END_IF
//Check if everything went well
IF BACnetEventCallback AND bacResult = BACNET_STATUS_OK THEN
//If everything succeeded issue an result(+) response containing the
//object ID
CmpBACnet.BACnetCreateObjectResponseCbCompletion(pCreateObj^.phTransaction,
//We treated the service request, so no default API actions are
//necessary anymore
pCreateObj^.pCBStatus^ := CmpBACnet.IEC_BACNET_CB_STATUS.CB_STATUS_OK;
ELSE
//If something went wrong issue an error
BACnetEventCallback := FALSE;
//If no explicit error code was given till now, issue an internal error
IF errCode = 0 THEN
errCode := ERR_CODE_INTERNAL_ERROR;
END_IF
//Issue the result(-) response with the appropriate error code
CmpBACnet.BACnetCreateObjectErrorCbCompletion(pCreateObj^.phTransaction,
ERR_CLASS_OBJECT, errCode, 0);
//We treated the service request, so no default API actions are
//necessary anymore
pCreateObj^.pCBStatus^ := CmpBACnet.IEC_BACNET_CB_STATUS.CB_STATUS_OK;
END_IF
END_IF
END_IF
Bosch Rexroth AG R911393282_Ausgabe 05
runObjID.instNumber = objID.instNumber THEN
ADR(objID), pCreateObj^.pServiceInfo^.pValues,
pCreateObj^.pServiceInfo^.nValuesCount,
m_SupportUnsolicitedCOV, 1, m_HideToOutside);
STRING_TO_WSTRING(CONCAT('CreatedObject', DWORD_TO_STRING(objID.instNumber))),
bacObj, strBuffer);
ADR(objID));
Die Hauptaufgabe dieses Code-Beispiels ist es, die Information der Service-
Anfrage zu erhalten, um darin auf die Information in pParameter zugreifen
zu können.
Der Zugriff auf pParameter erfolgt, indem ein Casting von pCreateObj
(EVT_BACNET_CREATEOBJECT) auf pParameter durchgeführt wird.
Die Bibliothek CmpBACnet enthält die Hook-Anfragestruktur pCreateObj, in
der die Variable pCBStatus enthalten sein kann und die der Rückgabewert
an das API ist.
Der Rückgabewert pCBStatus entscheidet, ob das API die Service-Anfrage
weiter bearbeitet (Default) oder nicht (OK).
IndraWorks 15VRS Feldbusse

Quicklinks ausblenden:

Werbung

Inhaltsverzeichnis
loading

Inhaltsverzeichnis