Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Summary

Ignition User defined Types (UDTs) are a powerful tool for consistently modelling pieces of equipment that are replicated throughout a system. For example a pump may have multiple variables such as pressure, temperature and flow, and by creating a UDT definition for that pump we can then replicate every instance of that pump in the system.

A UDT definition also flows directly through our Cloud Injector Modules allowing for dynamic system modelling within your Bigdata platform.

In this tutorial we will explain how the data in a UDT is represented when using MQTT Transmission and MQTT Engine along with best practices for managing UDT definitions.

Prerequisites

Tutorials

Anchor
CreatingandPublishing
CreatingandPublishing
Creating and Publishing a UDT

Anchor
CreateStep1
CreateStep1
Step 1 - Open Designer sessions

Open three separate Designer sessions and connect to each of the three instances of Ignition:

  1. Edge1 running MQTT Transmission
  2. Edge2 running MQTT Transmission
  3. Ignition running MQTT Engine

In the Tag browser, set the Column selection to include Value and Data Type. Your designer views will look similar to the views below:


Tip
See the Doc: Ignition 8.1 User Manual Creating a UDT Definition and Instance and Video: Inductive University Creating UDT Definitions for instructions on how to create a definition and instance in Designer.

Anchor
CreateStep2a
CreateStep2a
Step 2a - Create a UDT definition on Edge1

From the Designer pointing to your Edge1 instance create a new UDT with the following properties:

  • Name: Pump

Add a Memory Tag member to the Pump UDT with the following properties:

  • Name: Pressure
  • Value: 123

Add a second Memory Tag to the Pump UDT with the following properties:

  • Name: Flow
  • Value: 50

Anchor
CreateStep2b
CreateStep2b
Step 2b - Create an instance of the UDT on Edge1

Under your device PLC1, create an instance of the UDT "Pump" with the following properties:

  • Name: Stream1

Your designer view connected to Edgde1 will now look like this:

Anchor
CreateStep3
CreateStep3
Step 3 - Publish the newly added UDT instance

On the Edge1 Ignition instance UI, navigate to the MQTT Transmission Transmitters settings by selecting Config > MQTT TRANSMISSION > Settings and selecting the Transmitters tab.

Edit the Example Transmitter and ensure that the Convert UDTs parameter is deselected. This will enable the UDT Definition to be included as part of the BIRTH and disable the UDT member tags from being converted to normal tags before publishing.

From the Designer pointing to your Edge1 instance force a refresh by switching the provider to MQTT Transmission and selecting the Refresh click box under Transmission Control. This Boolean control will automatically deselect once the BIRTH has been published.

From the Designer pointing to your MQTT Engine instance, you will now see the tag Stream1 with a data type of Pump published from the Edge1 device:

and can see the Pump UDT Definition in the UDT Definitions tab:

From the Designer connected to the Edge1 instance, make changes to the Stream1 tag Flow and Pressure member tags and see the data published and displayed on the MQTT engine instance of Designer. 

Now we have our UDT defined we can replicate this across our other edge devices. 

Anchor
Replicating
Replicating
Replicating a UDT across other Edge devices

Anchor
ReplicatingStep1
ReplicatingStep1
Step 1 - Export/Import the Pump UDT definition

Following the instructions Ignition: Exporting and Importing Tags, select the UDT Definition to export from the Edge1 device and import to the Edge2 device


Anchor
ReplicatingStep2
ReplicatingStep2
Step 2 - Create a new instance of the Pump UDT on Edge2 and publish

Following the instructions above in Step 2a and Step 3 from Creating and Publishing a UDT create a new instance of the Pump UDT on the Edge2 device and publish.

The name of the instance does not have to be different as the tag path of edge/group/device will fully define the data. 

Your Designer views will look similar to the ones below:

Anchor
Managing
Managing
Managing UDTs


Warning
You cannot have UDTs definitions with the same name and different tag members within the system. The MQTT Engine will ignore any new UDT definitions received that share the same name as the first recorded UDT definition.

This means that if you are updating a UDT, you cannot simply add or remove a tag member from the UDT and force the refresh to publish a birth certificate as the MQTT Engine will ignore the revised definition.

The recommended method is to create a new UDT definition on the Edge device setting the property Parent Data Type to the existing UDT definition. This will allow you to manage versioning for your UDT definitions and prevent published data being ignored by MQTT engine.

In the example below, we have created a new UDT named Pump1 with the inherited tags from Pump and added a new memory tag of Temperature.

Once the new definition is created, you can create an instance on the edge device and force the refresh. The new UDT definition will be recorded by MQTT engine and the data processed correctly without impacting the data published from other edge devices. The system can run like this indefinitely with the updated definition imported into any other locations that need to use that new definition.



Warning

Changes made to a UDT definition at an edge device , such as adding/removing a member tag or changing the properties on a member tag, are to UDT definition member tags not propagated through the system.

You will see that any tag instances of that UDT at the edge device will reflect the changes, as will the instances at the MQTT Engine from that edge device, but the recorded definition for the UDT will not change nor will tag instances for other edge devices using that definition.    

If you make any change to an existing UDT definition you will need to also:

  • Delete the UDT definition at the MQTT Engine
  • Delete all instances of tags using the UDT definition at MQTT Engine
  • Delete the current variant of the UDT definition in all edge devices through out the system
  • Export the updated UDT definition from the edge device and import into all other edge devices
  • Force a refresh at each edge device


Anchor
AdditionalActivities
AdditionalActivities
Additional Activities

  1. Add additional Edge devices to the system using the same UDT.
  2. Create nested UDTs to build local systems.