Skip to main content
Version: 4.2

Entity Model Example

This section uses the example of Furnace in the plant to demonstrate the creation of entity model.

TemplateTemplate AttributeInstanceInstance Attribute
FurnaceTemperatureFurnace AHumidity, pressure

Creating Entity Template

  1. Log in to supOS, and then click to go to the design center.
  2. Select Object Model Management > Object Template > Entity Template.
  3. Click next to Entity Template, and then enter the basic information of the template.
ParameterDescription
Template NameFurnace.
AliasThe unique ID of the template. Generated by default and can be customized.
APPIndicates the template is created on supOS or applications. system means the template is created on supOS.
info

Select Visible to Other Apps to display the current template on all applications.

Parent TemplateSelect an entity template to be the parent template of the current one.
Main Display FieldsUsed as keywords when searching for instances under the template during instance attribute binding.
TagsAdd tags to the template from Tag Management for easy search and categorization.
Function SetsSelect a function set to endow its features to the template.
  1. Click Attributes, add Temperature as an attribute.
    1. Set the basic information of the template attribute.
      General parameter description
      ParameterDescription
      NameTemperature
      TypeDouble or Float. Attribute data type.
      Data SourcesLeave it as empty.
      why

      Template attributes are general attributes, which will be inherited by specific instances. It is recommended to add specific data sources to corresponding instance.

      Read And Write StatusSelect whether the attribute value can be changed by writing back data.
      Storage Policy
      • Persistence: Whether to synchronize the value changes to supOS.
      • History: Whether to keep all change records of the value for future analysis.
      Compression ParametersCompress data with SDT (Spining Door Transformation) to reduce the space that history records take up.
      • Compression Value: Set a percentage of the value range, or an absolute value as the input parameter of SDT.
      • Maximum Upload Cycle: The maximum time interval between 2 collecting records. When reaching the set value, and data has no changes, the last recorded value will be uploaded.
      info
      • The higher the Compression Parameters, the heavier the data is compressed.
      • No matter how high the Compression Parameters is, the time interval of collecting data cannot exceed Maximum Upload Cycle.
      info

      Different types of data corresponds to different parameters.

      Specific data type parameter description
      ParameterData TypeDescription
      DefaultsAll types except Object.The default data value.
      LengthStringString length.
      Upper Range Limit/Lower Range Limit/UnitInteger/Long/Float/Double/DecimalAttributes of different types of data. Click Configure to customize units.
      Effective PrecisionDecimalThe number of significant figures of the data value.
      Decimal PrecisionDecimalThe number of digits after the decimal point of the data value.
      DecimalDouble/FloatDecimal precision of the data value.
      Template NameObjectClick Select template, and select an entity template to be bound with the current template to form a relation between them.
      Storage FieldObject
      Field DisplayObject
      tip

      Click Binding Relationship on the Attributes page, drag attributes from the right side to the left to bind them.

    2. Under Alarm rules, click New to add an alarm that will be triggered when the temperature is higher than 85°C.
      • Set Condition to > and Limit to 85.
      • Set a buffer temperature of 5 by selecting Value to be Dead Zone Type and entering 5 under Dead Zone Value. An alarm will go off when the temperature hits 80°C.
      info

      Alarm rules are only available for numeric and boolean type of data.

  1. (Optional) Click Services, and create a new service.
ParameterDescription
Timeout(s)Set the timeout period for running the service.
Information InputAdd fields to be the input information of the service.
Information OutputSet the output data type.
info

Only JSON can be parsed by supOS automatically.

Object SelectorClick to select attributes or embedded services from templates and instances in supOS, and then change the script based on specific requirements.
info

For details of embedded services, see Embedded Service.

  1. (Optional) Click Events, and create a new event.
info

Presently, only two embedded data sets are available. You can write scripts to define new events.

  1. (Optional) Click Subscriptions, and create a new subscription.
ParameterDescription
Subscription Method
  • Event Trigger: Click Add Source, select an instance event and attribute as the event triggering source.
  • Timing Trigger: Enable Timed Subscription, and set the start, end time and time interval to trigger the subscription at the set time.
ScriptWrite a script to realize the custom subscription.