Twin Config

The OrchestratorModule is configured by defining all custom models in the twin configuration.

Each custom model has the following properties:

  • name: Name of the custom model. Must be unique.

  • modelUrl: POST endpoint address for executing the model

  • inputNames: Tag names for the custom model inputs, ordered by index number. The input names must fit the specific implementation of the custom model. Input tags must be valid tags, that are defined in the asset hierarchy.

  • outputNames: Tag names for the custom model outputs, ordered by index number. The output names must fit the specific implementation of the custom model.

  • triggerType: Type of trigger that executes the custom model. The parameter "trigger" configures the trigger, depending on the type. See "Custom Model Triggers" section below.

  • trigger: Trigger parameter. Depends on the trigger type. See "Custom Model Triggers" section below.

  • modelInputType: Parameter that determines if the model execution needs to allocate a folder on disk for files to be stored, that can be linked to the model execution. An example of this is a computer vision application. Possible values are "Files" or "Measurements". If it is set to "Measurements", no folder is created, and the custom model is expected to be purely measurements going in and out through the API.

The module is configured by setting the "modelConfig" property to a list of models, like this:

"modelConfig": {
    "visionModel": {
        "name": "VisionModel",
        "modelUrl": "http://VisionModule:5001/execmodel",
        "triggerType": "TriggerTagChange",
        "trigger": "area.asset.sometag",
        "inputTagNames": [
            "area.asset.inputtag1",
            "area.asset.inputtag2"
        ],
        "outputTagNames": [
            "output1",
            "output2"
        ],
        "modelInputType": "Files"
    },
    "analyticalModel": {
        "name": "AnalyticalModel",
        "modelUrl": "http://AnalyticalModule:5002/execmodel",
        "triggerType": "Schedule",
        "trigger": "0 * * * *",
        "inputTagNames": [
            "area.asset.inputtag1"
        ],
        "outputTagNames": [
            "output1",
            "output2"
        ],
        "modelInputType": "Measurements"
    }
}

Custom Model Triggers

Custom models needs to be triggered on different conditions. The OrchestratorModule supports the following triggers:

  • Schedule: Custom model is triggered after a fixed schedule, according to a cron string. Set the trigger parameter to the be the CRON string, like; "trigger": "0 * * * *".

  • InputTagChange: Custom model is triggered every time one of the input tags change. The trigger parameter is not used in this case.

  • TriggerTagChange: Custom model is triggered every time a specific tag changes. Set the trigger parameter to the be the tag name of the trigger tag, like; "trigger": "area.asset.sometag".

  • OnExpressionIsTrue: Custom model tiggers every time an boolean expression evaluates to true. Expression evaluates every time an input changes. Set the trigger parameter to contain the equation that must be evaluated, like; "trigger": "a>5#a=area.asset.sometag".

  • DirectCommand: Custom model can only be triggered using a direct method. The trigger parameter is not used in this case.

Last updated

Was this helpful?