Management Plattform Gateway
Dieser Abschnitt enthält Hintergrundinformationen zur Arbeit mit dem Management Plattform Desigo CC Gateway, das zur Integration von einem Subsystem 1 in ein Subsystem 2 verwendet wird. Für zugehörige Prozeduren oder Workflows siehe den Abschnitt Schritt-für-Schritt.


Die nachfolgende Beschreibung (Workflows, Beispiele) bezieht sich jedoch auf die Integration von OPC und BACnet.
Hauptmerkmale der Integration in Desigo CC sind:
- Die Werte, die per Script von einem Subsystem auf des nächste übermittelt werden, können umgerechnet werden. Ein gutes Beispiel sind die Enum Werte in BACnet, die meist bei 1 beginnen, während sie bei OPC bei 0 starten.
- Werte die nicht übermittelt oder umgerechnet werden müssen, können direkt in Desigo CC verwendet werden (z.B.: Referenz in einem Grafiksymbol).
- Die Abbildungen funktionieren bidirektional.
- Die in der Library zur Verfügung stehenden Umrechnungsmethoden sind in beschrieben. Es können jederzeit auch mit einem eigenen Script Umrechnungen durchgeführt werden.
- Diese Zuweisung muss für jeden übermittelnden Datenpunkt erfolgen.
- Die benötigten Funktionen müssen als COV oder Polling ausgeführt werden.
- Die benötigten Scripte sind in der Desigo CC Bibliothek verfügbar.
- Virtuelle Desigo CC Datenpunkte können erstellt werden z.B. wenn ein Mittelwert aus zwei Datenpunkten berechnet werden muss.
- Ist die Desigo CC Managementplattform nicht verfügbar, so werden keine neuen Werte zwischen Subsystem 1 und Subsystem 2 aktualisiert.
Technische Umsetzung
Datenpunkte, die weitergeleitet oder konvertiert werden, müssen mit einer entsprechenden SX-Funktion erweitert werden.
Nach einem OPC-Import:
- Datenpunkte müssen durch ein Skript zur Weiterleitung an ein BACnet-Gerät ergänzt werden.
- Alle anderen OPC-Datenpunkte können ohne zusätzliche Verarbeitung (z.B. Anzeige in der Grafik) in Desigo CC verwendet werden.
- Die drei Skriptbeispiele werden in einer Bibliothek gespeichert. Für die Migration muss nur ein Skript angepasst werden.

Erklärung:
- Es gibt nur Einwegaktionen (OPC -> BACnet oder BACnet -> OPC).
- Die Funktion muss nach Bedarf verwendet werden.
Abonnement
Zu einem OPC- oder BACnet-Datenpunkt:
- Im Prinzip startet eine Wertänderung an ein OPC-Gerät eine Funktion, die den geänderten Wert in den entsprechenden BACnet-Datenpunkt schreibt und umgekehrt.
- Der OPC/BACnet-Treiber kommuniziert automatisch mit dem angeschlossenen OPC- oder BACnet-Datenpunkt und dem entsprechenden Element der OPC- oder BACnet-Geräte. Es ist lediglich ein Abonnement für einen OPC- oder BACnet-Datenpunkt erforderlich, um auf eine Gerätewertänderung reagieren zu können.
Abrufen
Zu einem OPC- oder BACnet-Datenpunkt:
- Das Abrufen erfolgt mit Lesen/Schreiben in einer Zeitschleife.
- Diese Variante führt zu einer erhöhten Netzwerklast, da Desigo CC Werte in relativ kurzen Intervallen abfragt. Durch die Verwendung verschiedener Abrufzyklen kann die Netzwerklast optimiert werden.
Beispiel Script
Nachfolgende Codes zeigen beispielhaft, wie diese verwendet werden können. Die genaue Funktionsanwendung ist im Script als Kommentar beschrieben.

///ApplicationView_Logics_Scripts_SXOpenMainScript.SXOpenMainScript.v=1_8.b=3_1_0021_0.10001.SX Open Main Script.
///ApplicationView_Logics_Scripts_SXOpenMainScript.SXOpenMainScript.v=1_8.b=3_1_0021_0.10001.SX Open Main Script.
// The Main Script is an example to show how to use the SX Open Replacement in Management Platform
// Version 1.8 (31.01.2019)
// Strict mode makes it easier to write "secure" code, introducing better error-checking
'use strict';
//---------------------------
// SX Open Main Script
//---------------------------
/*
---------------------------------------------------------------------------------
Syntax of a subscription (3 lines):
----------------------------------
line 1: // subscription 001 - SXAdd -> Parser.OPC01
line 2: var result001 = subscribeValues(<objectReference>,<propertyNames>,<callback>,<initialValue>);
line 3: function Opc2Bac001(object, values) {<Parser.OPCxxx>(object,<objectReference>,<"SX Open Function">,Param01[...Param40]);}
---------------------------------------------------------------------------------
-- Parser function are used in case of number of parameter ---------------
Parser.OPCxx are used for OPC->BACnet
Parser.BACxx are used for BACnet->OPC
-----------------------------------------
Parser.OPC00 is used for: SXBoolToMulti, SXMultiToBool
Parser.OPC01 is used for: SXAdd, SXBitPos, SXConst, SXDiv, SXEqual, SXMul, SXSubstract, SXWriteBit, SXDirect
Parser.OPC02 is used for: SXBetween, SXSelectBool, SXBitSet, SXScaleBAC
Parser.OPC03 is used for: SXAddLimiter, SXSelectVal1
Parser.OPC16 is used for: SXAvg
Parser.OPC32 for: SXIntToMulti, SXMulitToInt, SXMulitState2BstrHash, SXBstrHash2MultiState, SXIntFromBits
Parser.OPC40 is NOT IMPLEMENTED as this SX Open Function is not defined!!!
----------
Parser.BAC00 is used for; SXBoolToMulti, SXMultiToBool,
Parser.BAC01 is used for: SXAdd, SXBitPos, SXConst, SXDiv, SXEqual, SXMul, SXSubstract, SXWriteBit, SXDirect
Parser.BAC02 is used for: SXBetween, SXSelectBool, SXBitSet, SXScaleOPC
Parser.BAC03 is used for: SXAddLimiter, SXSelectVal1
Parser.BAC16 is used for: SXAvg
Parser.BAC32 for: SXIntToMulti, SXMulitToInt, SXMulitState2BstrHash, SXBstrHash2MultiState, SXIntFromBits
Parser.BAC40 is NOT IMPLEMENTED as this SX Open Function is not defined!!!
------------
Parser.SpecValue(Value, TargetObject, TargetProperty, ConsoleOutput) : to write a value to a defined property (e.g. LoLm/HiLm ...)
---------------------------------------------------------------------------------
*/
// the Parser contains function according the amount of parameters and give back the result of the "SX Open Function"
// Parser Script from ApplicationView
var Parser = include("SXOpenParser");
// Parser Script from SX OPEN library
// var Parser = include("SXOpenParser", "BA_Software_SXOPEN_1")
// ConsoleOutput is used to show the result of COV in the console of the Script Editor (true or false)
var ConsoleOutput = true;
// This TextGroups are used for different MultiState State-Text in the SXOpenFunction "SXMultiStateToBstrHash" ==>> see below Subscription 013
// The name of the text group contains the number defined in the Excel sheet for OPC configuration!
var TextGroup9160 = ["S1", "S2", "S3", "S4"]; // index implicit => [0, 1, 2, 3]
//============
// OPC -> BACnet with COV
//============
// Subscription 001a - SXAdd -> Parser.OPC01
var result001a = subscribeValues("System11.ManagementView:ManagementView.FieldNetworks.SXOpen.Server_Softing.CC2SX.CC_SXAdd_AI","Value", Opc2Bac001a, false);
function Opc2Bac001a(object, values) {Parser.OPC01(values.Value.value.value,"System11.ManagementView:ManagementView.FieldNetworks.MON1.Hardware.MON1'M1aB00.SXopen1'IO01'AVAL01" , "SXAdd", ConsoleOutput, 10); }
// Subscription 001b - SXAdd -> Parser.OPC01
var result001b = subscribeValues("System11.LogicalView:Logical.SXBAC.CC2SX.SXAdd.CC_SXAdd_AV","Value", Opc2Bac001b, false);
function Opc2Bac001b(object, values) {Parser.OPC01(values.Value.value.value,"System11.LogicalView:Logical.Rack4053.BACnetDP.Add.3" , "SXAdd", ConsoleOutput, 10);}
// Subscription 001c - SXAdd -> Parser.OPC01
var result001c = subscribeValues("System11.LogicalView:Logical.SXBAC.CC2SX.SXAdd.CC_SXAdd_MSI","Value", Opc2Bac001c, false);
function Opc2Bac001c(object, values) {Parser.OPC01(values.Value.value.value,"System11.LogicalView:Logical.Rack4053.BACnetDP.Add.6" , "SXAdd", ConsoleOutput, 1);}
// Subscription 001d - SXAdd -> Parser.OPC01
var result001d = subscribeValues("System11.LogicalView:Logical.SXBAC.CC2SX.SXAdd.CC_SXAdd_MSV","Value", Opc2Bac001d, false);
function Opc2Bac001d(object, values) {Parser.OPC01(values.Value.value.value,"System11.LogicalView:Logical.Rack4053.BACnetDP.Add.4" , "SXAdd", ConsoleOutput, 1);}
//============
// Subscription 002a - SXAddLimiter -> Parser.OPC03
var result002 = subscribeValues("System11.LogicalView:Logical.SXBAC.CC2SX.SXAddLimiter.CC_SXAddLimiter_AI","Value", Opc2Bac002a, false);
function Opc2Bac002a(object, values) {Parser.OPC03(values.Value.value.value,"System11.LogicalView:Logical.Rack4053.BACnetDP.AddLimite.5" , "SXAddLimiter", ConsoleOutput, 1, 3, 4);}
// Subscription 002b - SXAddLimiter -> Parser.OPC03
var result002 = subscribeValues("System11.LogicalView:Logical.SXBAC.CC2SX.SXAddLimiter.CC_SXAddLimiter_AV","Value", Opc2Bac002b, false);
function Opc2Bac002b(object, values) {Parser.OPC03(values.Value.value.value,"System11.LogicalView:Logical.Rack4053.BACnetDP.AddLimite.3" , "SXAddLimiter", ConsoleOutput, 1, 3, 4);}
// Subscription 002c - SXAddLimiter -> Parser.OPC03
var result002 = subscribeValues("System11.LogicalView:Logical.SXBAC.CC2SX.SXAddLimiter.CC_SXAddLimiter_MSI","Value", Opc2Bac002c, false);
function Opc2Bac002c(object, values) {Parser.OPC03(values.Value.value.value,"System11.LogicalView:Logical.Rack4053.BACnetDP.AddLimite.6" , "SXAddLimiter", ConsoleOutput, 1, 3, 4);}
// Subscription 002d - SXAddLimiter -> Parser.OPC03
var result002 = subscribeValues("System11.LogicalView:Logical.SXBAC.CC2SX.SXAddLimiter.CC_SXAddLimiter_MSV","Value", Opc2Bac002d, false);
function Opc2Bac002d(object, values) {Parser.OPC03(values.Value.value.value,"System11.LogicalView:Logical.Rack4053.BACnetDP.AddLimite.4" , "SXAddLimiter", ConsoleOutput, 1, 3, 4);}
//============
// Subscription 003a - SXAIarray (SXDirect!) -> Parser.OPC01
var result003a = subscribeValues("System11.LogicalView:Logical.SXBAC.CC2SX.SXArray.CC_SXAIarray","Value", Opc2Bac003a, false);
function Opc2Bac003a(object, values)
{
Parser.OPC01(values.Value.value.value[0],"System11.LogicalView:Logical.Rack4053.BACnetDP.AIarray.5", "SXDirect", ConsoleOutput, 0);
Parser.OPC01(values.Value.value.value[1],"System11.LogicalView:Logical.Rack4053.BACnetDP.AIarray.6", "SXDirect", ConsoleOutput, 0);
}
// Subscription 003b - SXBIarray (SXDirect!) -> Parser.OPC01
var result003b = subscribeValues("System11.LogicalView:Logical.SXBAC.CC2SX.SXArray.CC_SXBIarray","Value", Opc2Bac003b, false);
function Opc2Bac003b(object, values)
{
Parser.OPC01(values.Value.value.value[0],"System11.LogicalView:Logical.Rack4053.BACnetDP.AIarray.8", "SXDirect", ConsoleOutput, 0);
Parser.OPC01(values.Value.value.value[1],"System11.LogicalView:Logical.Rack4053.BACnetDP.AIarray.11", "SXDirect", ConsoleOutput, 0);
}
//============
// Subscription 004 - SXAvg -> Parser.OPC16
var result004 = subscribeValues("System11.LogicalView:Logical.SXBAC.CC2SX.SXAvg.CC_SXAvg_AI","Value", Opc2Bac004, false);
function Opc2Bac004(object, values) {Parser.OPC16(values.Value.value.value,"System11.LogicalView:Logical.Rack4053.BACnetDP.Avg.5" , "SXAvg", ConsoleOutput, 2, 10, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);}
//============
// Subscription 005 - SXBetween -> Parser.OPC02
var result005 = subscribeValues("System11.LogicalView:Logical.SXBAC.CC2SX.SXBetween.CC_SXBetween_BI","Value", Opc2Bac005, false);
function Opc2Bac005(object, values) {Parser.OPC02(values.Value.value.value,"System11.LogicalView:Logical.Rack4053.BACnetDP.Between.8" , "SXBetween", ConsoleOutput, 10, 20);}
//============
// Subscription 006a - SXBitPos -> Parser.OPC01
var result006a = subscribeValues("System11.LogicalView:Logical.SXBAC.CC2SX.SXBitPos.CC_SXBitPos_MSI","Value", Opc2Bac006a, false);
function Opc2Bac006a(object, values) {Parser.OPC01(values.Value.value.value,"System11.LogicalView:Logical.Rack4053.BACnetDP.BitPos.6" , "SXBitPos", ConsoleOutput, 1);}
// Subscription 006b - SXBitPos -> Parser.OPC01
var result006b = subscribeValues("System11.LogicalView:Logical.SXBAC.CC2SX.SXBitPos.CC_SXBitPos_MSV","Value", Opc2Bac006b, false);
function Opc2Bac006b(object, values) {Parser.OPC01(values.Value.value.value,"System11.LogicalView:Logical.Rack4053.BACnetDP.BitPos.4" , "SXBitPos", ConsoleOutput, 1);}
//============
// Subscription 007a - SXBoolToMulti -> Parser.OPC00
var result007a = subscribeValues("System11.ManagementView:ManagementView.FieldNetworks.SXOpen.Server_Softing.CC2SX.CC_SXBoolToMulti_MSI","Value", Opc2Bac007a, false);
function Opc2Bac007a(object, values) {Parser.OPC00(values.Value.value.value,"System11.ManagementView:ManagementView.FieldNetworks.MON1.Hardware.MON1'M1aB00.SXopen1'IO01'SXbool2MS'MVAL01" , "SXBoolToMulti", ConsoleOutput);}
// Subscription 007b - SXBoolToMulti -> Parser.OPC00
var result007b = subscribeValues("System11.ManagementView:ManagementView.FieldNetworks.SXOpen.Server_Softing.CC2SX.CC_SXBoolToMulti_MSV","Value", Opc2Bac007b, false);
function Opc2Bac007b(object, values) {Parser.OPC00(values.Value.value.value,"System11.ManagementView:ManagementView.FieldNetworks.MON1.Hardware.MON1'M1aB00.SXopen1'IO01'SXbool2MS'MVAL02" , "SXBoolToMulti", ConsoleOutput);}
//============
// Subscription 008a - SXDiv -> Parser.OPC01
var result008a = subscribeValues("System11.LogicalView:Logical.SXBAC.CC2SX.SXDiv.CC_SXDiv_AI","Value", Opc2Bac008a, false);
function Opc2Bac008a(object, values) {Parser.OPC01(values.Value.value.value,"System11.LogicalView:Logical.Rack4053.BACnetDP.Div.5" , "SXDiv", ConsoleOutput, 2);}
// Subscription 008b - SXDiv -> Parser.OPC01
var result008b = subscribeValues("System11.LogicalView:Logical.SXBAC.CC2SX.SXDiv.CC_SXDiv_AV","Value", Opc2Bac008b, false);
function Opc2Bac008b(object, values) {Parser.OPC01(values.Value.value.value,"System11.LogicalView:Logical.Rack4053.BACnetDP.Div.3" , "SXDiv", ConsoleOutput, 2);}
//============
// Subscription 009 - SXEqual -> Parser.OPC01
var result009 = subscribeValues("System11.LogicalView:Logical.SXBAC.CC2SX.SXEqual.CC_SXEqual_BI","Value", Opc2Bac009, false);
function Opc2Bac009(object, values) {Parser.OPC01(values.Value.value.value,"System11.LogicalView:Logical.Rack4053.BACnetDP.Equal.8" , "SXEqual", ConsoleOutput, 10);}
//============
// Subscription 010 - SXIntToMulti -> Parser.OPC32
var result010 = subscribeValues("System11.LogicalView:Logical.SXBAC.CC2SX.SXIntToMulti.CC_SXIntToMulti_MSV","Value", Opc2Bac010, false);
function Opc2Bac010(object, values) {Parser.OPC32(values.Value.value.value,"System11.LogicalView:Logical.Rack4053.BACnetDP.ItoM.4", "SXIntToMulti" , ConsoleOutput, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1);}
//============
// Subscription 011a - SXMul -> Parser.OPC01
var result011a = subscribeValues("System11.LogicalView:Logical.SXBAC.CC2SX.SXMul.CC_SXMul_AI", "Value", Opc2Bac011a, false);
function Opc2Bac011a(object, values) {Parser.OPC01(values.Value.value.value,"System11.LogicalView:Logical.Rack4053.BACnetDP.Mul.5" , "SXMul", ConsoleOutput, 2);}
// Subscription 011b - SXMul -> Parser.OPC01
var result011b = subscribeValues("System11.LogicalView:Logical.SXBAC.CC2SX.SXMul.CC_SXMul_AV", "Value", Opc2Bac011b, false);
function Opc2Bac011b(object, values) {Parser.OPC01(values.Value.value.value,"System11.LogicalView:Logical.Rack4053.BACnetDP.Mul.3" , "SXMul", ConsoleOutput, 2);}
//============
// Subscription 012a - SXMultiMap (function: Parser.OPC01->SXDirect for Value, Parser.SpecValue for Limits)
// 012a: subscription for Value
var result012a = subscribeValues("System11.LogicalView:Logical.SXBAC.CC2SX.SXMultiMap.CC_SXAnalogInputPrval", "Value", Opc2Bac012a, false);
function Opc2Bac012a(object, values) {Parser.OPC01(values.Value.value.value,"System11.LogicalView:Logical.Rack4053.BACnetDP.MultiMap.5" , "SXDirect", ConsoleOutput, 0);}
// 012b: Polling for Limits
setInterval(polling012b, 5000)
function polling012b() {
var objValueRead =read("System11.LogicalView:Logical.SXBAC.CC2SX.SXMultiMap.CC_SXAnalogInputLoLm","Value");
Parser.SpecValue(objValueRead.Value.value,"System11.LogicalView:Logical.Rack4053.BACnetDP.MultiMap.1", "Low_Limit", ConsoleOutput);
//
var objValueRead =read("System11.LogicalView:Logical.SXBAC.CC2SX.SXMultiMap.CC_SXAnalogInputHiLm","Value");
Parser.SpecValue(objValueRead.Value.value,"System11.LogicalView:Logical.Rack4053.BACnetDP.MultiMap.1" , "High_Limit", ConsoleOutput)
}
//============
// Subscription 013 - SXMultiState2BstrHash -> Parser.OPC01
var result013 = subscribeValues("System11.ManagementView:ManagementView.FieldNetworks.SXOpen.Server_Softing.CC2SX.CC_SXMultiState2BstrHash_MSI","Value", Opc2Bac013, false);
function Opc2Bac013(object, values) {Parser.OPC01(values.Value.value.value,"System11.ApplicationView:ApplicationView.Logics.VirtualObjects.SX_OPCms2Bstr" , "SXMultiState2BstrHash" , ConsoleOutput, TextGroup9160);}
/============
// Subscription 014 - SXMultiToInt -> Parser.OPC32
var result014 = subscribeValues("System11.ManagementView:ManagementView.FieldNetworks.SXOpen.Server_Softing.CC2SX.CC_SXMultiToInit_AI","Value", Opc2Bac014, false);
function Opc2Bac014(object, values) {Parser.OPC32(values.Value.value.value,"System11.ManagementView:ManagementView.FieldNetworks.MON1.Hardware.MON1'M1aB00.SXopen1'IO01'AVALOP01" , "SXMultiToInt" , ConsoleOutput, 1111, 2222, 3333, 4444, 5555, 6666, 7777, 8888, 9999, 1010, 1111, 1212, 1313, 1414, 1515, 1616, 1717, 1818, 1919, 2020, 2121, 2222, 2323, 2424, 2525, 2626, 2727, 2828, 2929, 3030, 3131, 3232);}
//============
// Subscription 015a - SXMultiToBool -> Parser.OPC00
var result015a = subscribeValues("System11.ManagementView:ManagementView.FieldNetworks.SXOpen.Server_Softing.CC2SX.CC_SXM2B_BI" ,"Value", Opc2Bac015a, false);
function Opc2Bac015a(object, values) {Parser.OPC00(values.Value.value.value,"System11.ManagementView:ManagementView.FieldNetworks.MON1.Hardware.MON1'M1aB00.SXopen1'IO01'SXms2Bool'BVAL01" , "SXMultiToBool", ConsoleOutput);}
// Subscription 015b - SXMultiToBool -> Parser.OPC00
var result015b = subscribeValues( "System11.ManagementView:ManagementView.FieldNetworks.SXOpen.Server_Softing.CC2SX.CC_SXM2B_BV" ,"Value", Opc2Bac015b, false);
function Opc2Bac015b(object, values) {Parser.OPC00(values.Value.value.value, "System11.ManagementView:ManagementView.FieldNetworks.MON1.Hardware.MON1'M1aB00.SXopen1'IO01'SXms2Bool'BVAL02" , "SXMultiToBool", ConsoleOutput);}
//============
// Subscription 016a - SXScaleBAC -> Parser.OPC02
var result016a = subscribeValues("System11.LogicalView:Logical.SXBAC.CC2SX.SXScaleBAC.CC_SXScaleBAC_AI" ,"Value", Opc2Bac016a, false);
function Opc2Bac016a(object, values) {Parser.OPC02(values.Value.value.value,"System11.LogicalView:Logical.Rack4053.BACnetDP.ScaleBAC.5" , "SXScaleBAC", ConsoleOutput, 5, 2);}
// Subscription 016b - SXScaleBAC -> Parser.OPC02
var result016b = subscribeValues("System11.LogicalView:Logical.SXBAC.CC2SX.SXScaleBAC.CC_SXScaleBAC_AV" ,"Value", Opc2Bac016b, false);
function Opc2Bac016b(object, values) {Parser.OPC02(values.Value.value.value,"System11.LogicalView:Logical.Rack4053.BACnetDP.ScaleBAC.3" , "SXScaleBAC", ConsoleOutput, 5, 2);}
//============
// Subscription 017a - SXScaleOPC -> Parser.OPC02 (Used to calc back a BACnet Value to OPC -> op
var result017a = subscribeValues("System11.LogicalView:Logical.SXBAC.CC2SX.SXScaleOPC.CC_SXScaleOPC_AI" ,"Value", Bac2Opc017a, false);
function Bac2Opc017a(object, values) {Parser.BAC02(values.Value.value.value,"System11.LogicalView:Logical.Rack4053.BACnetDP.ScaleOPC.5" , "SXScaleOPC", ConsoleOutput, 5, 2);}
// Subscription 017b - SXScaleOPC -> Parser.OPC02
var result017b = subscribeValues("System11.LogicalView:Logical.SXBAC.CC2SX.SXScaleOPC.CC_SXScaleOPC_AV" ,"Value", Bac2Opc017b, false);
function Bac2Opc017b(object, values) {Parser.BAC02(values.Value.value.value,"System11.LogicalView:Logical.Rack4053.BACnetDP.ScaleOPC.3" , "SXScaleOPC", ConsoleOutput, 5, 2);}
//============
// Subscription 018 - SXSelectBool -> Parser.OPC02
var result018 = subscribeValues("System11.LogicalView:Logical.SXBAC.CC2SX.SXSelectBool.CC_SXSelectBool_AI" ,"Value" , Opc2Bac018, false);
function Opc2Bac018(object, values) {Parser.OPC02(values.Value.value.value,"System11.LogicalView:Logical.Rack4053.BACnetDP.SelectB.5" , "SXSelectBool", ConsoleOutput, 10, 20);}
//============
// Subscription 019a - SXSelectVal1 -> Parser.OPC03
var result019a = subscribeValues("System11.LogicalView:Logical.SXBAC.CC2SX.SXSelectVal1.CC_SXSelectVal1_AI" ,"Value", Opc2Bac019a, false);
function Opc2Bac019a(object, values) {Parser.OPC03(values.Value.value.value,"System11.LogicalView:Logical.Rack4053.BACnetDP.SelectV.5" , "SXSelectVal1", ConsoleOutput, 100, 20, 10);}
// Subscription 019b - SXSelectVal1 -> Parser.OPC03
var result019b = subscribeValues("System11.LogicalView:Logical.SXBAC.CC2SX.SXSelectVal1.CC_SXSelectVal1_MSI" ,"Value", Opc2Bac019b, false);
function Opc2Bac019b(object, values) {Parser.OPC03(values.Value.value.value,"System11.LogicalView:Logical.Rack4053.BACnetDP.SelectV.6" , "SXSelectVal1", ConsoleOutput, 100, 2, 1);}
//============
// Subscription 020a - SXSubstract -> Parser.OPC01
var result020a = subscribeValues("System11.LogicalView:Logical.SXBAC.CC2SX.SXSubtract.CC_SXSubtract_AI" ,"Value", Opc2Bac020a, false);
function Opc2Bac020a(object, values) {Parser.OPC01(values.Value.value.value,"System11.LogicalView:Logical.Rack4053.BACnetDP.Substract.5" , "SXSubstract", ConsoleOutput, 10);}
// Subscription 020b - SXSubstract -> Parser.OPC01
var result020b = subscribeValues("System11.LogicalView:Logical.SXBAC.CC2SX.SXSubtract.CC_SXSubtract_AV" ,"Value", Opc2Bac020b, false);
function Opc2Bac020b(object, values) {Parser.OPC01(values.Value.value.value,"System11.LogicalView:Logical.Rack4053.BACnetDP.Substract.3" , "SXSubstract", ConsoleOutput, 10);}
// Subscription 020c - SXSubstract -> Parser.OPC01
var result020c = subscribeValues("System11.LogicalView:Logical.SXBAC.CC2SX.SXSubtract.CC_SXSubtract_MSI" ,"Value", Opc2Bac020c, false);
function Opc2Bac020c(object, values) {Parser.OPC01(values.Value.value.value,"System11.LogicalView:Logical.Rack4053.BACnetDP.Substract.6" , "SXSubstract", ConsoleOutput, 1);}
// Subscription 020d - SXSubstract -> Parser.OPC01
var result020d = subscribeValues("System11.LogicalView:Logical.SXBAC.CC2SX.SXSubtract.CC_SXSubtract_MSV" ,"Value", Opc2Bac020d, false);
function Opc2Bac020d(object, values) {Parser.OPC01(values.Value.value.value,"System11.LogicalView:Logical.Rack4053.BACnetDP.Substract.4" , "SXSubstract", ConsoleOutput, 1);}
//============
// Subscription 021a - SXWriteBit -> Parser.OPC01
var result021a = subscribeValues("System11.LogicalView:Logical.SXBAC.CC2SX.SXWriteBit.CC_SXWriteBit_MSI" ,"Value", Opc2Bac021a, false);
function Opc2Bac021a(object, values) {Parser.OPC01(values.Value.value.value,"System11.LogicalView:Logical.Rack4053.BACnetDP.WriteBit.6" , "SXWriteBit", ConsoleOutput, 1);}
// Subscription 021b - SXWriteBit -> Parser.OPC01
var result021b = subscribeValues("System11.LogicalView:Logical.SXBAC.CC2SX.SXWriteBit.CC_SXWriteBit_MSV" ,"Value", Opc2Bac021b, false);
function Opc2Bac021b(object, values) {Parser.OPC01(values.Value.value.value,"System11.LogicalView:Logical.Rack4053.BACnetDP.WriteBit.4" , "SXWriteBit", ConsoleOutput, 1);}
//============
// Subscription 022 - SXIntFromBits -> Parser.OPC32
var result022 = subscribeValues("System11.ManagementView:ManagementView.FieldNetworks.SXOpen.Server_Softing.CC2SX.CC_SXIntFromBits_AI" ,"Value", Opc2Bac022, false);
// ATTENTION!! The Value of above AI (subcription) is set as COUNT for this function
function Opc2Bac022(object, values) {Parser.OPC32(values.Value.value.value,"System11.ManagementView:ManagementView.FieldNetworks.MON1.Hardware.MON1'M1aB00.SXopen1'IO01'SXintFroB'AVAL01" , "SXIntFromBits" , ConsoleOutput, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);}
//============
// Subscription 023a - SXBitSet-> Parser.OPC02
var result023a = subscribeValues( "System11.ManagementView:ManagementView.FieldNetworks.SXOpen.Server_Softing.CC2SX.CC_SXBitSet_AI" ,"Value", Opc2Bac023a, false);
function Opc2Bac023a(object, values) {Parser.OPC02(values.Value.value.value, "System11.ManagementView:ManagementView.FieldNetworks.MON1.Hardware.MON1'M1aB00.SXopen1'IO01'SXbitSet'AVAL01" , "SXBitSet", ConsoleOutput, 5, 12);}
// Subscription 023b - SXBitSet-> Parser.OPC02
// ATTENTION!! This example has a special second line to show how it works! If the input value subscription 23a and 23b are the same, the same result are expected! Value of 23a is allways 12!
var result023b = subscribeValues( "System11.ManagementView:ManagementView.FieldNetworks.SXOpen.Server_Softing.CC2SX.CC_SXBitSet_AI2" ,"Value", Opc2Bac023b, false);
function Opc2Bac023b(object, values) {var P2 = values.Value.value.value; Parser.OPC02(values.Value.value.value, "System11.ManagementView:ManagementView.FieldNetworks.MON1.Hardware.MON1'M1aB00.SXopen1'IO01'SXbitSet'AVAL02" , "SXBitSet", ConsoleOutput, 5, P2);}
//============
// BACnet -> OPC with COV
//============
// Subcription 101 - SXBetween -> Parser.BAC02
//var result004 = subscribeValues(,, BacToOpc101, false);
//function BacToOpc101(object, values) {Parser.BAC02(values.Value.value.value, "System11.LogicalView:Logical.Rack4053.BACnet1.22", "SXBetween", ConsoleOutput, 20, 29);}
//============
// OPC -> BACnet with Polling
//============
/*
=====
setInterval(repeatMe1, 10000)
function repeatMe1() {
var objValueRead =read("System11.LogicalView:Logical.Static.IOP_static_R4","Value"); Parser.OPC02(objValueRead.Value.value, "System11.LogicalView:Logical.Rack4053.BACnet1.20", "SXBetween", ConsoleOutput, 20, 29)
var objValueRead =read("System11.LogicalView:Logical.Static.IOP_static_R4","Value"); Parser.OPC02(objValueRead.Value.value, "System11.LogicalView:Logical.Rack4053.BACnet1.20", "SXBetween", ConsoleOutput, 20, 29)
var objValueRead =read("System11.LogicalView:Logical.Static.IOP_static_R4","Value"); Parser.OPC02(objValueRead.Value.value, "System11.LogicalView:Logical.Rack4053.BACnet1.20", "SXBetween", ConsoleOutput, 20, 29)
var objValueRead =read("System11.LogicalView:Logical.Static.IOP_static_R4","Value"); Parser.OPC02(objValueRead.Value.value, "System11.LogicalView:Logical.Rack4053.BACnet1.20", "SXBetween", ConsoleOutput, 20, 29)
}
function repeatMe2(test2) {
console("I am repeating 2 - 5000 - test2:{0}", test2);
}
setInterval(repeatMe2,5000,20)
setInterval(repeatMe2,6000,60)
*/
//============
// BACnet -> OPC with Polling
//============
Unterstützte Funktionen
Konvertierungsfunktionen | ||||
Funktion | Inverse Funktion | Anz. Para. | Parameter | Beschreibung |
SXAdd | SXSubtract | 1 | offset | result := input + offset |
SXAddLimiter | SXSubtract | 3 | offset, max, overflow_val | if input < max then result := input + offset else result := overflow_val |
SxSubtract | SXAdd | 1 | offset | result := input - offset |
SXBitPos | SXWriteBit | 1 | bit; 0 <= bit <= 31 | result := input & (1 >> bit) & 0x0001 |
SXWriteBit | SXBitPos | 1 | bit; 0 <= bit <= 31 | result := (input << bit) |
SXDirect | SXDirect | 1 | not used | result := input |
SXBoolToMulti
| SXMultiToBool | 0 | - | if input < 0 then result := 2 else result := 1 |
SXMutliToBool | SXBoolToMulti | 0 | - | if input > 1 then result := -1 else result := 0 |
SXIntToMulti | SXMultiToInit | -2 | cnt, int1, int2, …, int<cnt> 1 <= cnt <=32 | if input == int1 then result := 1 else if input == int2 then result := 2 else if … else result := cnt + 1 |
SXMultiToInit | SXIntToMulti | -2 | cnt, int1, int2, … 1 <= cnt <= 31 | if input == 1 then result := int1 else if input == 2 then result := int2 else if … else result := int<cnt> |
SXScaleBAC | SXScaleOPC | 2 | offset, denom denom != 0 | result = (input+ offset) / denom |
SXScaleOPC | SXScaleBAC | 2 | offset, denom denom != 0 | result :== (input *denom) – offset |
SXMul | SXDiv | 1 | factor | result := input * factor |
SXDiv | SXMul | 1 | factor factor != 0 | result := input / factor |
MultiState2 BstrHash
| BstrHash2 MultiState
| -1 | cnt, hash1, hash2, …, hash<cnt> 1 <= cnt <= 30 | if 1 <= input <= 30 && input <= cnt then result := hash<input> else result := 0 |
BstrHash2 MultiState
| MultiState2 BstrHash
| -1 | cnt, hash1, hash2, …, hash<cnt> | if input == hash1 then result := 1 else if input == hash2 then result := 2 else if … else if input == hash<cnt> else result := 0 |
Funktions-Mapping | ||||
Funktion | Inverse Funktion | Anz. Para. | Parameter | Beschreibung |
SXConst | - | 1 | value | result := value |
SXEqual | - | 1 | value | if input == value |
SXSelectBool | - | 2 | value1, value2 | if input == 0 |
SXSelectVal1 | - | 3 | match, value1, | if input != match |
SXAvg | - | -2 | cnt, value1, | result := (input + value1 + value2 + … |
SXBetween | - | 2 | min, max | if min <= input and input <= max |
SXIntFromBits | - | -2 | cnt, value1, | result := 0 |
SXBitSet | - | 2 | pos, value | If input <> 0 |
Funktionsaufruf-Beispiele
Abbildungsrichtung BACnet→OPC | |||||||
Funktion | Par1 | Par2 | Par3 | Par4 | Wert-OPC | BACnet | Wert-OPC-nach-Rückkopplung |
SXAdd | 2.88 |
|
|
| 6 | 8.88 | 6 |
SXSubtract | 10 |
|
|
| 40 | 30 | 40 |
SXWriteBit | 2 |
|
|
| 7 | 4 | 1 |
SXWriteBit | 2 |
|
|
| 6 | 0 | 0 |
SXDirect |
|
|
|
|
|
|
|
SXIntToMulti | 3 | 12 | 24 | 36 | 12 | 1 | 12 |
SXIntToMulti | 3 | 12 | 24 | 36 | 14 | 3 | 36 |
SXMultiToInt | 10 | 20 | 30 | 40 | 3 | 40 | 3 |
SXMultiToInt | 10 | 20 | 30 | 40 | 1 | 20 | 1 |
SXScaleBAC | 2 | 4 |
|
| 10 | 3 | 10 |
SXScaleOPC | 4 | 2 |
|
| 100 | 196 | 100 |
SXMul | 5 |
|
|
| 7 | 35 | 7 |
SXDiv | 6 |
|
|
| 18 | 3 | 18 |
MultiState2BstrHash | 3 | 24 | 36 | 48 | 2 | 36 | 2 |
BstrHash2MultiState | 3 | 20 | 30 | 40 | 2 | 30 | 2 |
SXEqual | 7 |
|
|
| 7 | 1 | 7 |
SXConst | 112 |
|
|
| 555 | 112 | 112 |
SXSelectBool | 5 | 9 |
|
| 0 | 9 | 9 |
SXSelectBool | 5 | 9 |
|
| 1 | 5 | 1 |
SXSelectVal1 | 44 | 1 | 2 |
| 44 | 1 | 44 |
SXSelectVal1 | 44 | 1 | 2 |
| 1300 | 2 | 1300 |
SXAvg | 3 | 32 | 64 | 128 | 256 | 160 | 256 |
SXBetween | 7 | 21 |
|
| 8 | 1 | 8 |
SXIntFromBits | 3 | 1 | 2 | 4 | 0 | 7 | 0 |
Abbildungsrichtung BACnet→OPC | |||||||
Funktion | Par1 | Par2 | Par3 | Par4 | Wert-OPC | BACnet | Wert-OPC-nach-Rückkopplung |
SXAddLImiter | 2,88 | 3 | 45 | - | 100 | 42,12 | 45 |
SXBitPos | 1 | - | - | - | 2 | 4 | 0 |
SXBitPos | 1 | - | - | - | 7 | 1 | 14 |
SXWriteBit | 2 | - | - | - | 1 | 0 | 0 |
SXBoolToMulti | - | - | - | - | -1000 | 1 | 0 |
SXMultiToBool | - | - | - | - | 55 | 1 | 0 |
SXMultiToBool | - | - | - | - | -55 | 2 | -1 |

Hinweis:
Zu beachten ist, dass mit Wert BACnet der PresentValue gemeint ist. Der RawPresentValue bleibt durch den Rückkopplungseffekt unbeeinträchtigt.