Product Features
Digital Twins
Add an Instance
12 min
an instance represents a specific asset and is inherited from a model instances are the actual data objects that contain static and dynamic data from different sources you must create a model before creating an instance you add a digital twins instance by navigating to digital twins > instances note digital twins requires a scale or growth litmus license before you begin before you add an instance, you must create a digital twins model see docid\ zpadx1lmme0f44v7r6v6q for details step 1 add instance when you add an instance, you update placeholder values that were defined in the digital twins model associated with the instance you can also choose to flatten json hierarchies enable flatten hierarchy to convert nested json objects to single level objects that contain the objects full path, for example dynamic attribute temperature value 30 consider flattening hierarchies when sending json objects to tabular databases, such as sql and influxdb subscribe to specific static and dynamic attribute data on unique topics when you enable publish attributes , you can create unique topics that publish specific static and dynamic attributes at the frequency that you require for example, assume that you don't need full payload data for a device you can send the specific data that you do need through a unique data stream to add an instance navigate to digital twins > instances the instances pane appears c lick the add an instance tile the add an instance dialog box appears select a model to associate with the instance either search for a model or select one from the list in name , enter a name for the instance in interval , enter an interval for generating and publishing json payloads setting the value to zero disables interval based publishing in this case, use the pollonce topic to publish a payload in topic , review the default topic defined for the instance to send hierarchical data in a flat json structure, select flatten hierarchy to enable publishing specific static and dynamic attribute data on unique topics, select publish attributes click add step 2 configure instance the instance inherits configuration from the model and allows you to update details to align with the real world assets select an instance tile in grid view to view instance details after making changes to an instance, click save to update the instance static attributes the static attributes tab displays metadata values for the model the instance belongs to you can customize the attribute values for the instance action details \[1] search attributes search for static attributes configured in the model the instance is associated with \[2] refresh refresh attribute values \[3] import attributes import attributes see docid\ zpadx1lmme0f44v7r6v6q to learn more about importing static attributes \[4] save instance save changes to the instance \[5] edit customize static attribute value dynamic attributes the dynamic attributes tab displays the variable data attributes configured in the model the instance belongs to you can map one to one relationships with data topics and attributes by updating the topic field for the instance note if a dynamic attribute has a topic expression defined, the topic for instances are not editable to change the dynamic attribute topic, you must edit the model or parameter values important the topic’s data appears in the instance payload only if the topic is mapped to the dynamic attribute action details \[1] search attributes search for dynamic attributes in the model the instance is associated with \[2] edit you have the option of adding topics from different data sources in litmus edge, such as from devicehub or an integration click the edit icon and search for a devicehub tag or enter the topic name in the topic field \[3] refresh refresh attribute values \[4] import attributes import attributes see docid\ zpadx1lmme0f44v7r6v6q to learn more about importing dynamic attributes \[5] save instance save changes to the instance publish specific static and dynamic attributes enabling publish attributes for an instance allows users and data streams to subscribe to new topics for the instance with partial sections of the full payload for static attributes, all the keys and values to digitaltwins \<modelname> \<instancename> staticattributes as a single level json object the topic structure follows the same format as the data access topic with staticattributes appended the frequency at which the payload is generated and published is defined by the instance's interval { "device description" "cnc machine", "plant" "p1", "area" "a1", "manufacturer" "litmus" } for dynamic attributes, each attribute gets it own unique topic where the real time data is published the topic structure follows the same format as the data access topic with the dynamic attribute name appended digitaltwins \<modelname> \<instancename> \<dyanmicattribute> the payload is based on the input topic and transformations the publishing interval being event based on when data is available for the specific dynamic attribute this example includes a model called cnc and instance called cnc001 with the following settings interval 10 seconds static attributes "device description" "cnc machine", "plant" "p1","area" "a1", "manufacturer" "litmus" dynamic attributes temperature, current, pressure, and power to publish specific static and dynamic attributes when you add or edit an instance, select publish attributes navigate to analytics > instances and add the datahub subscribe processor to subscribe to all static attributes, use this topic digitaltwins cnc cnc001 staticattributes a payload will generate every 10 seconds to subscribe to specific dynamic attributes for temperature use topic digitaltwins cnc cnc001 temperature for current use topic digitaltwins cnc cnc001 current for pressure use topic digitaltwins cnc cnc001 pressure for power use topic digitaltwins cnc cnc001 power publishing of payload is fully event based on the input topic for the dynamic attribute note you can apply wildcards to these topics by using an asterisk ( ) to replace the model or instance or a right angle bracket ( > ) for the attribute example digitaltwins cnc power digitaltwins cnc cnc001 > data access the data access tab allows you to view real time data for the instance details \[1] review the topic name and interval configured for the instance click the copy icon to copy the topic name \[2] subscribe and unsubscribe for data access to view real time data for the instance note the digital twins instance topic syntax is digitaltwins \<model name> \<instance name> restart instance after making changes to the instance, make sure to click save instance and then restart instance to implement the updates