Skip to main content

Dynamic Attributes

Dynamic Attributes track changing or dynamic properties for an asset. Dynamic attribute data is stored as events with timestamps, and you can save and retrieve dynamic attribute data for a given point-in-time. For example: the number of workers badging in and out of a line could be a dynamic attribute called 'Crew Size', allowing you to report on the crew size for a given time period. Dynamic attributes are always linked to assets.

Defining and Linking Dynamic Attributes

Dynamic Attributes are defined and linked to assets in the Dynamic Attributes Configuration page (Configuration > Asset Management > Dynamic Attributes by default). Dynamic attributes are defined in the left-hand 'Attributes' list.

assets

Use the assets button to open the Attribute editor. Here you can create or delete dynamic attributes and folders.

assets

To link an asset with a dynamic attribute, select the dynamic attribute in the Attribute Settings pane and click the assets button. Use the assets button to add a data source, pick the asset and enable.

Attributes can be deleted by selecting an attribute and clicking the assets button. Confirm deletion by clicking OK when prompted.

If the value for the dynamic attribute can be pulled directly from an asset, configure the Data Source settings. To add a new data source, click the assets button on the left.

Use the Asset Selector and Tag Browser to select the tag. Scale Factor and Ignore zero values parameters are specific to tag collector values, scaling the PLC value and preventing the storage of zero values if not required. Use the Enabled checkbox to enable or disable a data source.

assets


Viewing, Creating, and Editing Dynamic Attribute Events

Dynamic Attribute Events are used to establish the dynamic attribute value at a given time for a specific asset. Attribute events can be viewed and edited through the Attribute Events page (Ops > Operations > Attribute Events by default).

assets

Use the provided filters to select an asset and a dynamic attribute associated with that asset, and a time-range for which you want to see Attribute Events. Qualified users can then change the values and timestamps of previously recorded attribute events, add new attribute events, or delete attribute events.

Note that this is often considered an 'Administrative' screen where qualified, trained users are manually updating or adding data. For ease of use, consider integrating dynamic attributes into custom manual entry screens, as described in the sections below.

Dynamic Attributes in the Ignition Designer

Designing Manual Entry Screens using Kanoa Views

Dynamic attributes are commonly used to design custom manual entry screens. Kanoa has provided pre-made Views designed to be used as Ignition embedded views for users to quickly create their own manual entry screens using dynamic attributes. These screens can be found in the kanoa/mes/asset/attributes view folder.

assets

There are two Views designed to support Dynamic Attribute data entry:

kanoa/mes/asset/attributes/dropdownSelector

Provides a drop-down menu which creates a dynamic attribute event for the provided attribute and asset. The timestamp for this event will be the time the value is changed.

View Parameters: { "value": { "assetId": 614, "attributeLabel": "Crew Size", "attributeName": "Crew Size", "dropdownList": [ { "label": 1, "value": 1 }, { "label": 2, "value": 2 }, { "label": 3, "value": 3 }, { "label": 4, "value": 4 } ], "userId": custom.security.userId } }

kanoa/mes/asset/attributes/textEntry

Provides a text field which creates a Dynamic attribute event for the provided attribute and asset. The timestamp for this event will be the time the value is changed.

View Parameters: { "assetId": 614, "attributeName": "Crew Size", "userId": custom.security.userId }

Accessing Dynamic Attribute data via the Kanoa API

Kanoa's dynamic attribute functions are found via the path system.kanoa.attribute.*.

Common use-cases include: Get the most recent dynamic attribute value for a given asset: attributeId = system.kanoa.utilities.getFieldValue('attributeId', system.kanoa.attribute.getAttributes({'attributeName': value['attributeName']}))

return system.kanoa.utilities.getFieldValue('value', system.kanoa.attribute.getPreviousAttributeEvent(value['assetId'], attributeId, system.date.now()))

Setting the value of a dynamic attribute for a given asset:

linkId = system.kanoa.attribute.getAttributeAssetLinks({'assetId': self.view.params.value.assetId, 'attributeName': self.view.params.value.attributeName})
if linkId is not None:
linkId = linkId[0]['attributeAssetLinkId']
system.kanoa.attribute.addAttributeEvent({'attributeAssetLinkId': linkId, 'value': 'Jane Doe', 'tStamp': system.date.now()}, userId)