ABB Ability™ History UI SDK - Client API Reference
    Preparing search index...

    Server API Interface

    interface IMiaServerAPI {
        CommitClassData(
            classname: string,
            properties: string[],
            ids: unknown[],
            newvalues: unknown[],
            oldvalues: unknown[],
            callback?: TCallback<TCommitClassDataResult>,
            exceptionhandler?: TException,
        ): Promise<TCommitClassDataResult>;
        CommitGraphData(
            xvalues: unknown[],
            yvalues: unknown[],
            statuses: string[],
            classname: string,
            xproperty: string,
            yproperty: string,
            comment: string,
            wherestring: string,
            whereargs: unknown[],
            callback?: TCallback<boolean>,
            exceptionhandler?: TException,
        ): Promise<boolean>;
        EventBarrier(
            callback?: TCallback<boolean>,
            exceptionhandler?: TException,
        ): Promise<boolean>;
        ExecuteClassBoundCommand(
            classname: string,
            commandname: string,
            parameters: string,
            instanceids: unknown[],
            callback?: TCallback<unknown>,
            exceptionhandler?: TException,
        ): Promise<unknown>;
        FetchClassData(
            classname: string,
            properties: string[],
            fetchmax: number,
            wherestring: string,
            whereargs: unknown[],
            callback?: TCallback<TFetchClassDataResult>,
            exceptionhandler?: TException,
        ): Promise<TFetchClassDataResult>;
        FetchClassInstances(
            classname: string,
            fetchmax: number,
            wherestring: string,
            whereargs: unknown[],
            callback?: TCallback<TFetchClassInstancesResult>,
            exceptionhandler?: TException,
        ): Promise<TFetchClassInstancesResult>;
        FetchEquipmentInfo(
            equipmenttype: string,
            callback?: TCallback<TFetchEquipmentInfoResult>,
            exceptionhandler?: TException,
        ): Promise<TFetchEquipmentInfoResult>;
        FetchGraphData(
            classname: string,
            xproperty: string,
            yproperty: string,
            filter: string,
            xpixels: number,
            ypixels: number,
            fetchmax: number,
            wherestring: string,
            whereargs: unknown[],
            callback?: TCallback<TGraphData>,
            exceptionhandler?: TException,
        ): Promise<TGraphData>;
        FetchGraphDataEx(
            classname: string,
            xproperty: string,
            yproperty: string,
            fetchmax: number,
            filter: string,
            filterbasetime: unknown,
            wherestring: string,
            whereargs: unknown[],
            callback?: TCallback<TGraphData>,
            exceptionhandler?: TException,
        ): Promise<TGraphData>;
        FetchLanguageStrings(
            section: string,
            key: string,
            subkey: string,
            stoptoenglish: boolean,
            includestandard: boolean,
            langid: number,
            callback?: TCallback<TFetchLanguageStringsResult>,
            exceptionhandler?: TException,
        ): Promise<TFetchLanguageStringsResult>;
        GetFormattedValues(
            classname: string,
            properties: string[],
            rawvalues: unknown[],
            callback?: TCallback<TGetFormattedValuesResult>,
            exceptionhandler?: TException,
        ): Promise<TGetFormattedValuesResult>;
        GetSessionTransferKey(
            callback?: TCallback<string>,
            exceptionhandler?: TException,
        ): Promise<string>;
        GetStandardValues(
            classname: string,
            propertyname: string,
            userinput: string,
            context: Record<string, unknown>,
            fetchmax: number,
            callback?: TCallback<TGetStandardValuesResult>,
            exceptionhandler?: TException,
        ): Promise<TGetStandardValuesResult>;
        Impersonate(
            username: string,
            groups: string[],
            callback?: TCallback<boolean>,
            exceptionhandler?: TException,
        ): Promise<boolean>;
        ReadProperties(
            bagid: string,
            userid: unknown,
            versiontime: string,
            callback?: TCallback<IPropertyBag>,
            exceptionhandler?: TException,
        ): Promise<IPropertyBag>;
        SetCallCredentials(
            aai: unknown,
            persist: boolean,
            callback?: TCallback<boolean>,
            exceptionhandler?: TException,
        ): Promise<boolean>;
        SubscribeChanges(
            classname: string,
            properties: string[],
            wherestring: string,
            whereargs: unknown[],
            callback?: TCallback<TSubscribeChangesResult>,
            exceptionhandler?: TException,
        ): string;
        SubscribeConnectionHealthEvents(
            callback?: TCallback<TSubscribeConnectionHealthEventsResult>,
            exceptionhandler?: TException,
        ): string;
        SubscribeEquipmentSession(
            equipmentdefs: Record<string, unknown>,
            callback?: TCallback<unknown>,
            exceptionhandler?: TException,
        ): string;
        SubscribeHistoryValue(
            classname: string,
            timepropertyname: string,
            valuepropertyname: string,
            filter: string,
            wherestring: string,
            whereargs: unknown[],
            pollinterval: unknown,
            timeshift: unknown,
            basetime: unknown,
            callback?: TCallback<TSubscribeHistoryValueResult>,
            exceptionhandler?: TException,
        ): string;
        SubscribePushReceiver(
            classname: string,
            instanceid: unknown,
            properties: string[],
            pushtype: number,
            callback?: TCallback<number>,
            exceptionhandler?: TException,
        ): string;
        Unsubscribe(
            subscribecallid: string,
            callback?: TCallback<boolean>,
            exceptionhandler?: TException,
        ): Promise<boolean>;
        WriteProperties(
            commonbag: IPropertyBag,
            userbag: IPropertyBag,
            bagid: unknown,
            userid: unknown,
            callback?: TCallback<boolean>,
            exceptionhandler?: TException,
        ): Promise<boolean>;
    }

    Hierarchy (View Summary)

    Index

    Methods

    • Commits modified values to database. NOTES: 1. Data commit is allowed only for authorized and authenticated users using a secure connection. 2. When Windows Authentication is used as the web authentication method, users that belong to the BUILTIN/Administrators group are not treated as members of the group unless they are running the browser with elevation (Run as administrator).3. Class instance specific permissions for the current user can be fetched using the '$ACR' special property with FetchClassData.

      Parameters

      • classname: string

        Name of class, which data to update.

      • properties: string[]

        List of properties to update, prefix with RAW: to update raw values.

      • ids: unknown[]

        (System.Object[]) List of instance id's to be updated (to get them, get RAW:Id when fetching class data).

      • newvalues: unknown[]

        (System.Object[]) List of new values. If committing multiple instances, the list size should be multiple of properties.length. When given as null the instances are deleted.

      • oldvalues: unknown[]

        (System.Object[]) List of old values or null. If committing multiple instances, the list size should be multiple of properties.length. Old values are used to check prevent conflicting changes (occuring for example when two users want to increase value by one at the same time).

      • Optionalcallback: TCallback<TCommitClassDataResult>

        Function called when the requested operation is completed.

      • Optionalexceptionhandler: TException

        Function called in case the requested operation causes an error.

      Returns Promise<TCommitClassDataResult>

      FetchClassData

      //Example callback handlers
      const commitcallback=(ret)=>
      {//return callback for the commit - exceptions for individual instances returned as string, committed values returned in an array
      for(let i=0;i<ret.length;i++)
      {
      if(typeof ret[i]==="string") console.log("Commit for instance "+(i+1)+" failed:", ret[i]);
      else if(typeof ret[i]==="array") console.log("Commit for instance "+(i+1)+" succeeded:", ret[i]);
      else if(ret[i]= is null) console.log("Commit for instance "+(i+1)+" succeeded, Class does not support return values.");
      }
      };
      const commitexception=(ex)=>
      {//general commit failure exception handler (NOTE: commit exceptions for individual instances returned in the normal callback!)
      console.log("Commit operation failed: ", ex);
      };
      const c=GetConnection();
      //Insert 2 new class instances
      c.CommitClassData(
      "MyClass", //class name
      ["Property1", "Property2"], //properties to commit
      [null, null], //class instance ids (should be null when inserting new instances)
      [
      [inst1p1value, inst1p2value], //Property values for the first instance
      [inst2p1value, inst2p2value] //Property values for the second instance
      ],
      null, //old values (should be null when inserting new instances)
      commitcallback,
      commitexception
      );
      //Update 2 class instances
      c.CommitClassData(
      "MyClass", //class name
      ["Property1", "Property2"], //properties to update
      [id1, id2], //class instance ids
      [
      [inst1p1newvalue, inst1p2newvalue], //New property values for the first instance
      [inst2p1newvalue, inst2p2newvalue] //New property values for the second instance
      ],
      [//Old values - (if not null) checked so that commit for the instance fails if the existing values differ from these
      [inst1p1value, inst1p2value], //Old property values for the first instance
      [inst2p1value, inst2p2value] //Old property values for the second instance
      ],
      commitcallback,
      commitexception
      );
      //Delete 2 class instances
      c.CommitClassData(
      "MyClass", //class name
      [], //properties array should be empty
      [id1, id2], //class instance ids
      null, //New values as null - means that the instances are deleted
      [//Old values - (if not null) checked so that delete for the instance fails if the existing values differ from these
      [inst1p1value, inst1p2value], //Old property values for the first instance
      [inst2p1value, inst2p2value] //Old property values for the second instance
      ],
      commitcallback,
      commitexception
      );
    • Inserts/Modifies/Removes rows into a history table.

      Parameters

      • xvalues: unknown[]

        (System.Object[]) The timestamps of updates values.

      • yvalues: unknown[]

        (System.Object[]) Updates values; Set to null for rows that need to be removed.

      • statuses: string[]

        (System.UInt64[]) Statuses of updates values.

      • classname: string

        Class to fetch data from, for example use "ProcessHistory" to access normal RTDB histories.

      • xproperty: string

        Property to provide values for X-axis, for example use "Time" together with "ProcessHistory".

      • yproperty: string

        Property to provide values for Y-axis, for example use "Value" together with "ProcessHistory".

      • comment: string

        Message that will be written to the HistoryUpdateLog, leave empty if not required.

      • wherestring: string

        The filtering mask for the fetch; If some rows are to be deleted, the time range must be specified.

      • whereargs: unknown[]

        (System.Object[]) Arguments to be used in place of possible ?-chars within the wherestring.

      • Optionalcallback: TCallback<boolean>

        Function called when the requested operation is completed.

      • Optionalexceptionhandler: TException

        Function called in case the requested operation causes an error.

      Returns Promise<boolean>

    • Returns only when client has received all the events that have been triggered so far. Do not use unless you are sure you know what you are doing.

      Parameters

      • Optionalcallback: TCallback<boolean>

        Function called when the requested operation is completed.

      • Optionalexceptionhandler: TException

        Function called in case the requested operation causes an error.

      Returns Promise<boolean>

    • Executes a class bound command by name if driver defines one with security checking. The ExecuteClassBoundCommand call should be redirected to this routine by wrapper drivers that want to apply security checking.

      Parameters

      • classname: string

        Class name to perform the command on.

      • commandname: string

        Name of the command to execute.

      • parameters: string

        Command parameters.

      • instanceids: unknown[]

        (System.Object[]) Array of instance ids targetted by the command.

      • Optionalcallback: TCallback<unknown>

        Function called when the requested operation is completed.

      • Optionalexceptionhandler: TException

        Function called in case the requested operation causes an error.

      Returns Promise<unknown>

      (Server type: System.Object)

    • Fetches values for selected properties of class instances filtered by wherestr -argument. For list of classes, try querying with classname "Class", for list of class properties, try querying with classname "ClassProperty".

      Parameters

      • classname: string

        Name of the class, which values should be fetched.

      • properties: string[]

        List of properties to be fetched. Prefix property name with RAW: to get raw value instead of a pre-formatted value. Use null to get raw values of all properties as objects. Use $ACR to get permissions for accessing the instance. Use $REF to get an object reference string representing the instance. Prefix property name with VISIBLE: to get current visibility as boolean (true/false) determined by VisibilityRequirement property attribute.

      • fetchmax: number

        (System.Int32) Maximum number of rows to fetch, use -1 for unlimited.

      • wherestring: string

        The where mask for the fetch.

        A where mask is a clause specifying a criteria for the fetch. Only instances that meet the criteria are included in the result set. The criteria consists of predicates using class properties (defined in ClassProperty class), operators and comparison values.

        An example: "Name LIKE 'SYS*' AND (Type = 1 OR Type = 3)"
        (Include instances whose Name starts with the string 'SYS' and whose Type is either 1 or 3.)

        The syntax resembles SQL, but is not SQL. The supported operators are =, !=, >, >=, < and <=. AND, OR, LIKE, IN, IS and ORDER BY are supported however IS is used for type checking, not for null checks (eg. Unit IS System.Int32) - null checks are done by just using null like any other value (eg. Unit=null). Wildcards for LIKE are * and ?. SQL injection attacks will not work as this is not SQL.

      • whereargs: unknown[]

        (System.Object[]) Arguments to be used in place of possible ?-chars within where string.

      • Optionalcallback: TCallback<TFetchClassDataResult>

        Function called when the requested operation is completed.

      • Optionalexceptionhandler: TException

        Function called in case the requested operation causes an error.

      Returns Promise<TFetchClassDataResult>

      connection.FetchClassData(
      "ClassProperty",
      ["Name", "Type"],
      -1,
      "ClassName LIKE ? AND IsNullable=? ORDER BY Name",
      ["Class", false],
      (r)=>
      {
      for(let i=0;i<r.Data.length;i+=2)
      {// Loop through the rows
      console.log(i/2 + ": " + r.Data[i] + ", " + r.Data[i+1]);
      }
      },
      (msg)=>{window.alert(msg);}
      );
    • Fetches class instances filtered by wherestring -argument.

      Parameters

      • classname: string

        Name of the class, which instances should be fetched.

      • fetchmax: number

        (System.Int32) Maximum number of instances to fetch, use -1 for unlimited.

      • wherestring: string

        The where mask for the fetch.

        A where mask is a clause specifying a criteria for the fetch. Only instances that meet the criteria are included in the result set. The criteria consists of predicates using class properties (defined in ClassProperty class), operators and comparison values.

        An example: "Name LIKE 'SYS*' AND (Type = 1 OR Type = 3)"
        (Include instances whose Name starts with the string 'SYS' and whose Type is either 1 or 3.)

        The syntax resembles SQL, but is not SQL. The supported operators are =, !=, >, >=, < and <=. AND, OR, LIKE, IN, IS and ORDER BY are supported however IS is used for type checking, not for null checks (eg. Unit IS System.Int32) - null checks are done by just using null like any other value (eg. Unit=null). Wildcards for LIKE are * and ?. SQL injection attacks will not work as this is not SQL.

      • whereargs: unknown[]

        (System.Object[]) Arguments to be used in place of possible ?-chars within where string.

      • Optionalcallback: TCallback<TFetchClassInstancesResult>

        Function called when the requested operation is completed.

      • Optionalexceptionhandler: TException

        Function called in case the requested operation causes an error.

      Returns Promise<TFetchClassInstancesResult>

      connection.FetchClassInstances(
      "ClassProperty",
      -1,
      "ClassName LIKE ? AND IsNullable=? ORDER BY Name",
      ["Class", false],
      function(data)
      {
      for(let i=0;i<data.length;i++)
      {// Loop through the instances
      const inst=data[i];
      console.log(i + ": " + inst.Name + ", " + inst.Type);
      }
      },
      function(msg) {window.alert(msg);}
      );
    • Parameters

      • classname: string

        Class to fetch data from, use "ProcessHistory" to access normal RTDB histories. Three special classes $MERGE, $STACK and $CALC allow combining the results of previous FetchGraphData queries into one result. Prepending class name with ! tells the server not to send response to this query (userful with $MERGE, $STACK and $CALC).

      • xproperty: string

        Property to provide values for X-axis, use "Time" together with "ProcessHistory".

      • yproperty: string

        Property to provide values for Y-axis, use "Value" together with "ProcessHistory".

      • filter: string

        Optional filter to apply on data, eg. AVG1MIN to get one minute averages, see Vtrin documentation for further info on filters.

      • xpixels: number

        (System.Int32) Pixels on plot area in X-direction, only used with PLOT/PLOTM filters, otherwise ignored.

      • ypixels: number

        (System.Int32) Pixels on plot area in Y-direction, only used with PLOT/PLOTM filters, otherwise ignored.

      • fetchmax: number

        (System.Int32) Maximum number of values to fetch.

      • wherestring: string

        The where mask for the fetch.

        A where mask is a clause specifying a criteria for the fetch. Only instances that meet the criteria are included in the result set. The criteria consists of predicates using class properties (defined in ClassProperty class), operators and comparison values.

        An example: "Name LIKE 'SYS*' AND (Type = 1 OR Type = 3)"
        (Include instances whose Name starts with the string 'SYS' and whose Type is either 1 or 3.)

        The syntax resembles SQL, but is not SQL. The supported operators are =, !=, >, >=, < and <=. AND, OR, LIKE, IN, IS and ORDER BY are supported however IS is used for type checking, not for null checks (eg. Unit IS System.Int32) - null checks are done by just using null like any other value (eg. Unit=null). Wildcards for LIKE are * and ?. SQL injection attacks will not work as this is not SQL.

        Ignored if class is $MERGE or $STACK. The expression to be evaluated if class is $CALC.

      • whereargs: unknown[]

        (System.Object[]) Arguments to be used in place of possible ?-chars within where string. List of previous call ids to be merged or stacked if class is $MERGE or $STACK. List of variable names and previous calls ids if class is $CALC.

      • Optionalcallback: TCallback<TGraphData>

        Function called when the requested operation is completed.

      • Optionalexceptionhandler: TException

        Function called in case the requested operation causes an error.

      Returns Promise<TGraphData>

      OBSOLETE - Use FetchGraphDataEx instead! (Change to FetchGraphDataEx: xpixels and ypixels parameters have been removed. In case you had used PLOT/PLOTM filters give the xpixels/ypixels as parameters to them eg. PLOT(xpixels,ypixels). The new parameter BaseTime aceepts null value.)

    • Fetches data for trend plotting or similar use. This function might change in future releases as there are plans to change graph fetching to subscription based model.

      $MERGE class allows merging multiple histories into one structure with interpolation. Useful for histories combining multiple sources, e.g. position combining both latitude and longitude.

      $STACK class allows stacking multiple histories on top of each others, i.e. calculating sum of histories at all points. This is useful when rendering stacked graphs on low-powered devices.

      $CALC class allows executing arbitrary mathematical expressions on histories on the server side. This is useful for offloading some heavy computation from client side to server.

      All sources for $MERGE, $STACK and $CALC calls must precede the call in same multicall. They must also be either unconsumed (i.e. not returned by prepending class name with !) or restartable. Same source can not be included multiple times, even recursively.

      Example of $MERGE:
      [[11, 'FetchGraphDataEx', ['ProcessHistory', 'Time', 'Value', '', null, 100, 'Variable=? AND Time>=? AND Time<?', ['Sine Integer8', '2001-01-01 00:00:00', '2001-01-01 00:20:00']]],[12, 'FetchGraphDataEx', ['ProcessHistory', 'Time', 'Value', '', null, 100, 'Variable=? AND Time>=? AND Time<?', ['Sawtooth Integer8', '2001-01-01 00:00:00', '2001-01-01 00:20:00']]], [13, 'FetchGraphDataEx', ['$MERGE', 'Time', 'Value', '', null, 100, '', [11, 12]]]]
      $STACK works in similar way.

      Example of $CALC:
      [[11, 'FetchGraphDataEx', ['ProcessHistory', 'Time', 'Value', '', null, 100, 'Variable=? AND Time>=? AND Time<?', ['Sine Integer8', '2001-01-01 00:00:00', '2001-01-01 00:20:00']]],[12, 'FetchGraphDataEx', ['ProcessHistory', 'Time', 'Value', '', null, 100, 'Variable=? AND Time>=? AND Time<?', ['Sawtooth Integer8', '2001-01-01 00:00:00', '2001-01-01 00:20:00']]], [13, 'FetchGraphDataEx', ['$CALC', 'Time', 'Value', '', 0, 0, 100, 'A+B*A', ['A', 11, 'B', 12]]]]

      Parameters

      • classname: string

        Class to fetch data from, use "ProcessHistory" to access normal RTDB histories. Three special classes $MERGE, $STACK and $CALC allow combining the results of previous FetchGraphData queries into one result. Prepending class name with ! tells the server not to send response to this query (userful with $MERGE, $STACK and $CALC).

      • xproperty: string

        Property to provide values for X-axis, use "Time" together with "ProcessHistory".

      • yproperty: string

        Property to provide values for Y-axis, use "Value" together with "ProcessHistory".

      • fetchmax: number

        (System.Int32) Maximum number of values to fetch.

      • filter: string

        Optional filter to apply on data, eg. AVG1MIN to get one minute averages, see Vtrin documentation for further info on filters.

      • filterbasetime: unknown

        (System.Nullable`1[[System.DateTime, System.Private.CoreLib, Version=10.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]) Base time for aligning filter time periods - ignored when no filter specified or the filter does not produce periodical values

      • wherestring: string

        The where mask for the fetch.

        A where mask is a clause specifying a criteria for the fetch. Only instances that meet the criteria are included in the result set. The criteria consists of predicates using class properties (defined in ClassProperty class), operators and comparison values.

        An example: "Name LIKE 'SYS*' AND (Type = 1 OR Type = 3)"
        (Include instances whose Name starts with the string 'SYS' and whose Type is either 1 or 3.)

        The syntax resembles SQL, but is not SQL. The supported operators are =, !=, >, >=, < and <=. AND, OR, LIKE, IN, IS and ORDER BY are supported however IS is used for type checking, not for null checks (eg. Unit IS System.Int32) - null checks are done by just using null like any other value (eg. Unit=null). Wildcards for LIKE are * and ?. SQL injection attacks will not work as this is not SQL.

        Ignored if class is $MERGE or $STACK. The expression to be evaluated if class is $CALC.

      • whereargs: unknown[]

        (System.Object[]) Arguments to be used in place of possible ?-chars within where string. List of previous call ids to be merged or stacked if class is $MERGE or $STACK. List of variable names and previous calls ids if class is $CALC.

      • Optionalcallback: TCallback<TGraphData>

        Function called when the requested operation is completed.

      • Optionalexceptionhandler: TException

        Function called in case the requested operation causes an error.

      Returns Promise<TGraphData>

    • Fetches NLS translations

      Parameters

      • section: string

        Section to fetch language strings from.

      • key: string

        Key within section or NULL.

      • subkey: string

        SubKey within section/key or NULL.

      • stoptoenglish: boolean

        Specifies what to do if translation is not found in desired language - should the fallback mechanism stop to english or return translation in any language.

      • includestandard: boolean

        Set true to include 'Standard' -section translations (containing strings like Ok, Cancel, Apply, Properties, ...).

      • langid: number

        (System.Int32) LanguageId to fetch language strings for or NULL to fetch for the strings for the currently active language. 32bit field, upper 16bits contains primary langid and lower 16bits sublangid.

      • Optionalcallback: TCallback<TFetchLanguageStringsResult>

        Function called when the requested operation is completed.

      • Optionalexceptionhandler: TException

        Function called in case the requested operation causes an error.

      Returns Promise<TFetchLanguageStringsResult>

      connection.FetchLanguageStrings(
      "Binary Texts",
      null,
      null,
      null,
      null,
      null,
      (r)=>
      {
      for(let i=0;i<r.length;i++)
      {// Loop through the results
      console.log(r[i]);
      }
      },
      (msg)=>{window.alert(msg);}
      );
    • Gets a list of formatted class property values from given raw values.

      Parameters

      • classname: string

        Name of the class

      • properties: string[]

        Names of the properties

      • rawvalues: unknown[]

        (System.Object[]) RAW values of the properties

      • Optionalcallback: TCallback<TGetFormattedValuesResult>

        Function called when the requested operation is completed.

      • Optionalexceptionhandler: TException

        Function called in case the requested operation causes an error.

      Returns Promise<TGetFormattedValuesResult>

    • Gets a key that can be used to pass the session to another application.

      Parameters

      • Optionalcallback: TCallback<string>

        Function called when the requested operation is completed.

      • Optionalexceptionhandler: TException

        Function called in case the requested operation causes an error.

      Returns Promise<string>

    • Gets a list of values that can be used to fill a drop down or similar control when editing a value on a property of an instance.

      Parameters

      • classname: string

        Name of the class, which instance is being modified

      • propertyname: string

        Name of the property, which is being modified

      • userinput: string

        What user has typed so far, or null. Can contain wildcards * and ?.

      • context: Record<string, unknown>

        Values of other modified properties in the instance.

      • fetchmax: number

        (System.Int32) Maximum number of values to fetch, -1 for unlimited. If the result set is truncated due to this limit, the 'Truncated' value of the result structure is set to true.

      • Optionalcallback: TCallback<TGetStandardValuesResult>

        Function called when the requested operation is completed.

      • Optionalexceptionhandler: TException

        Function called in case the requested operation causes an error.

      Returns Promise<TGetStandardValuesResult>

    • Allows admin user to impersonate some other user. The session is turned to be authenticated to given user irreversibly.

      Parameters

      • username: string
      • groups: string[]
      • Optionalcallback: TCallback<boolean>

        Function called when the requested operation is completed.

      • Optionalexceptionhandler: TException

        Function called in case the requested operation causes an error.

      Returns Promise<boolean>

    • Fetches stored set of properties from underlying database. The callback gets an object containing the properties read from the database.

      Parameters

      • bagid: string

        (System.Guid) Bag Id - Unique id for the property bag to fetch.

      • userid: unknown

        (System.Nullable`1[[System.Guid, System.Private.CoreLib, Version=10.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]) User Id, whose properties are to be fetched. Use null for current user.

      • versiontime: string

        (System.DateTime) Time of the property bag version to fetch.

      • Optionalcallback: TCallback<IPropertyBag>

        Function called when the requested operation is completed.

      • Optionalexceptionhandler: TException

        Function called in case the requested operation causes an error.

      Returns Promise<IPropertyBag>

      (Server type: ABB.Vtrin.cPropertyBag)

    • Sets the credentials that should be used when performing security checks for this frame. Only useful if passing multiple calls in the same frame. Supplying additional credentials may never give more access rights, only take some away.

      Parameters

      • aai: unknown

        (ABB.Vtrin.Drivers.cDriverSkeleton+cAccessInfo) Extra credentials to use when executing the consequtive calls in the same frame

      • persist: boolean

        Set true to persist the extra credentials until cleared with a second call to this function

      • Optionalcallback: TCallback<boolean>

        Function called when the requested operation is completed.

      • Optionalexceptionhandler: TException

        Function called in case the requested operation causes an error.

      Returns Promise<boolean>

    • Subscribes to listening changes of one or more instances. Returns ABB.Mia.cSubscribeChangesResult as the callback parameter whenever change to subscribed instances is detected until unsubscribe is called. The callback function for this call will be called multiple times as long as unsubscribe is called.

      Parameters

      • classname: string

        Name of the class, which changes should be sent. Set to null to get changes of all non-expiration based classes. When null, the properties parameter is ignored.

      • properties: string[]

        List of properties to be sent for changed instances, prefix with RAW: to get raw value instead of a pre-formatted value. Set to null to get full instances instead of the values of selected properties. Using $ACR or RAW:$ACR will fetch the access control rights for the instance. Using $REF will return the object reference string representing the instance. Prefix property name with VISIBLE: to get current visibility as boolean (true/false) determined by VisibilityRequirement property attribute.

      • wherestring: string

        The where mask for the subscription.

        A where mask is a clause specifying a criteria for the fetch. Only instances that meet the criteria are included in the result set. The criteria consists of predicates using class properties (defined in ClassProperty class), operators and comparison values.

        An example: "Name LIKE 'SYS*' AND (Type = 1 OR Type = 3)"
        (Include instances whose Name starts with the string 'SYS' and whose Type is either 1 or 3.)

        The syntax resembles SQL, but is not SQL. The supported operators are =, !=, >, >=, < and <=. AND, OR, LIKE, IN, IS and ORDER BY are supported however IS is used for type checking, not for null checks (eg. Unit IS System.Int32) - null checks are done by just using null like any other value (eg. Unit=null). Wildcards for LIKE are * and ?. SQL injection attacks will not work as this is not SQL.

      • whereargs: unknown[]

        (System.Object[]) Arguments to be used in place of possible ?-chars within where string.

      • Optionalcallback: TCallback<TSubscribeChangesResult>

        Function called when the requested operation is completed.

      • Optionalexceptionhandler: TException

        Function called in case the requested operation causes an error.

      Returns string

      cSubscribeChangesResult

    • Subscribes to listening of connection health events. This is meaningful only if the server operates in 'gateway mode', meaning it is connected to another server, in which case these events provide information on that connection's (and any subconnections) health.

      Parameters

      Returns string

    • Subscribes an equipment session. All the equipment and their properties are processed by the server and wanted property subscriptions are returned to the client by the server.

      Parameters

      • equipmentdefs: Record<string, unknown>

        The definition of equipment(s) to use in the equipment session. See documentation for a detailed description of a equipment definition.

      • Optionalcallback: TCallback<unknown>

        Function called when the requested operation is completed.

      • Optionalexceptionhandler: TException

        Function called in case the requested operation causes an error.

      Returns string

    • Subscribes to polling of a history value. Returns {NYI} whenever change to target value is detected until unsubscribe is called. Note that unlike with other calls, the callback function for this call will be called multiple times as long as unsubscribe is called.

      Parameters

      • classname: string

        Name of the class, which the fetch is to be executed on.

      • timepropertyname: string

        Name of the time property in the class defined by the classname.

      • valuepropertyname: string

        Name of the value property in the class defined by the classname.

      • filter: string

        Optional filter to apply on data, eg. AVG1MIN to get one minute averages, see Vtrin documentation for further info on filters.

      • wherestring: string

        The where mask for the subsciption.

        A where mask is a clause specifying a criteria for the fetch. Only instances that meet the criteria are included in the result set. The criteria consists of predicates using class properties (defined in ClassProperty class), operators and comparison values.

        An example: "Name LIKE 'SYS*' AND (Type = 1 OR Type = 3)"
        (Include instances whose Name starts with the string 'SYS' and whose Type is either 1 or 3.)

        The syntax resembles SQL, but is not SQL. The supported operators are =, !=, >, >=, < and <=. AND, OR, LIKE, IN, IS and ORDER BY are supported however IS is used for type checking, not for null checks (eg. Unit IS System.Int32) - null checks are done by just using null like any other value (eg. Unit=null). Wildcards for LIKE are * and ?. SQL injection attacks will not work as this is not SQL.

      • whereargs: unknown[]

        (System.Object[]) Arguments to be used in place of possible ?-chars within where string.

      • pollinterval: unknown

        (System.Nullable1[[System.TimeSpan, System.Private.CoreLib, Version=10.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]) Interval to poll for new values. Default one minute. @param {unknown} timeshift (System.Nullable1[[ABB.Vtrin.cAdvancedTimeSpan, VtrinLib, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null]]) TimeShift when fetching the values, relative to current time. Default 0.

      • timeshift: unknown
      • basetime: unknown

        (System.Nullable`1[[System.DateTime, System.Private.CoreLib, Version=10.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]) Basetime when fetching periodical data using filters. Default 2300-01-01.

      • Optionalcallback: TCallback<TSubscribeHistoryValueResult>

        Function called when the requested operation is completed.

      • Optionalexceptionhandler: TException

        Function called in case the requested operation causes an error.

      Returns string

    • Subscribes a data push ability. Once subscribed, you can utilize web socket connection for pushing the values using the returned subscription id so that you only pass the data values in further calls.

      Parameters

      • classname: string

        Name of the target class, which will receive the data.

      • instanceid: unknown

        (System.Object) Id of target instance if updating (see pushtype) or null.

      • properties: string[]

        List of properties to set.

      • pushtype: number

        (System.Int32) Type of push operation 0=Insert, 1=Update, 2=ForceUpdate, 3=ProcessValue.

      • Optionalcallback: TCallback<number>

        Function called when the requested operation is completed.

      • Optionalexceptionhandler: TException

        Function called in case the requested operation causes an error.

      Returns string

      (Server type: System.Double)

    • Unsubscribes listening to changes that have been previously subscribed with Subscribe -call.

      Parameters

      • subscribecallid: string

        (System.Int64) Call id of subscription to cancel.

      • Optionalcallback: TCallback<boolean>

        Function called when the requested operation is completed.

      • Optionalexceptionhandler: TException

        Function called in case the requested operation causes an error.

      Returns Promise<boolean>

      const subid=connection.SubscribeChanges("Variable", ["Unit"])]);
      // ...some code...
      connection.Unsubscribe(subid);
    • Writes a set of properties to underlying database. The call back gets boolean true on successful commit (there is no need to check the value as the exception callback will be fired on failure).

      Parameters

      • commonbag: IPropertyBag

        (ABB.Vtrin.cPropertyBag) PropertyBag containing the common properties to write.

      • userbag: IPropertyBag

        (ABB.Vtrin.cPropertyBag) PropertyBag containing the user specific properties to write.

      • bagid: unknown

        (System.Object) Bag Id - Unique id for the property bag.

      • userid: unknown

        (System.Nullable`1[[System.Guid, System.Private.CoreLib, Version=10.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]) User Id, whose properties are to be saved. Use null for current user.

      • Optionalcallback: TCallback<boolean>

        Function called when the requested operation is completed.

      • Optionalexceptionhandler: TException

        Function called in case the requested operation causes an error.

      Returns Promise<boolean>