# Getting started with UDT (MQTT Sparkplug)

**URL:** <https://forum.inductiveautomation.com/t/getting-started-with-udt-mqtt-sparkplug/85199>\
**Category:** Maker\
**Tags:** perspective, ignition81\
**Created:** [February 4, 2024, 12:13pm UTC](https://forum.inductiveautomation.com/t/getting-started-with-udt-mqtt-sparkplug/85199 "2024-02-04T12:13:11Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vidar\_Hetlelid](https://avatars.discourse-cdn.com/v4/letter/v/dfb087/32.png) [@Vidar\_Hetlelid](https://forum.inductiveautomation.com/u/Vidar_Hetlelid)\
**Post date:** [February 4, 2024, 12:13pm UTC](https://forum.inductiveautomation.com/t/getting-started-with-udt-mqtt-sparkplug/85199/1 "2024-02-04T12:13:11Z")

</div>

Hi there,

Can anyone help me get started using MQTT Sparkplug, and making UDTs in ignition? Where do I start, and what do I need to do?

---

<div class="post-metadata">

**Author:** ![Matrix\_Engineering](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matrix_engineering/32/19781_2.png) [@Matrix\_Engineering](https://forum.inductiveautomation.com/u/Matrix_Engineering)\
**Post date:** [February 4, 2024, 12:15pm UTC](https://forum.inductiveautomation.com/t/getting-started-with-udt-mqtt-sparkplug/85199/2 "2024-02-04T12:15:35Z")

</div>

UDTs are global to tags, whether you are using MQTT or not;

> **[Learn Ignition at Your Own Pace](https://www.inductiveuniversity.com/video/search/?q=udt)**
>
> Inductive University is a completely free online learning platform
> to help you learn Ignition by Inductive Automation®, the most powerful SCADA software in the world

> **[IIoT Architecture Video at Inductive University](https://www.inductiveuniversity.com/video/iiot-architecture/7.9?r=%2Fvideo%2Fsearch%2F%3Fq%3Dmqtt%26checked_topics%3D)**
>
> With the Ignition IIoT architecture you can set up a secure MQTT Message-Oriented Middleware (MOM) infrastructure in the Cloud, on a private on-premise network, or a hybrid of both.

---

<div class="post-metadata">

**Author:** ![Vidar\_Hetlelid](https://avatars.discourse-cdn.com/v4/letter/v/dfb087/32.png) [@Vidar\_Hetlelid](https://forum.inductiveautomation.com/u/Vidar_Hetlelid)\
**Post date:** [February 4, 2024, 12:26pm UTC](https://forum.inductiveautomation.com/t/getting-started-with-udt-mqtt-sparkplug/85199/3 "2024-02-04T12:26:29Z")

</div>

Thank you! I will watch those videos. I want to learn how to use unified namespace. Will this be useful using OPCUA, or should I use MQTT?

---

<div class="post-metadata">

**Author:** ![Matrix\_Engineering](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matrix_engineering/32/19781_2.png) [@Matrix\_Engineering](https://forum.inductiveautomation.com/u/Matrix_Engineering)\
**Post date:** [February 4, 2024, 12:34pm UTC](https://forum.inductiveautomation.com/t/getting-started-with-udt-mqtt-sparkplug/85199/4 "2024-02-04T12:34:31Z")

</div>

UNS would be MQTT.

At a low level, you could be polling e.g. ModbusTCP via OPC-UA into an Edge node and then streaming that back via MQTT.

---

<div class="post-metadata">

**Author:** ![Vidar\_Hetlelid](https://avatars.discourse-cdn.com/v4/letter/v/dfb087/32.png) [@Vidar\_Hetlelid](https://forum.inductiveautomation.com/u/Vidar_Hetlelid)\
**Post date:** [February 4, 2024, 12:39pm UTC](https://forum.inductiveautomation.com/t/getting-started-with-udt-mqtt-sparkplug/85199/5 "2024-02-04T12:39:00Z")

</div>

Allright, thanks!

I have multiple machines (with wago PLC). All the data from each machine, would you prefer MQTT over OPCUA to get the data into ignition (UNS) ?

---

<div class="post-metadata">

**Author:** ![Matrix\_Engineering](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matrix_engineering/32/19781_2.png) [@Matrix\_Engineering](https://forum.inductiveautomation.com/u/Matrix_Engineering)\
**Post date:** [February 4, 2024, 12:41pm UTC](https://forum.inductiveautomation.com/t/getting-started-with-udt-mqtt-sparkplug/85199/6 "2024-02-04T12:41:25Z")

</div>

> [@Matrix\_Engineering](#):
>
> UNS would be MQTT.

^

---

<div class="post-metadata">

**Author:** ![Matrix\_Engineering](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matrix_engineering/32/19781_2.png) [@Matrix\_Engineering](https://forum.inductiveautomation.com/u/Matrix_Engineering)\
**Post date:** [February 4, 2024, 12:42pm UTC](https://forum.inductiveautomation.com/t/getting-started-with-udt-mqtt-sparkplug/85199/7 "2024-02-04T12:42:35Z")

</div>

You have tagged this as Maker. Now you say machines. Is this industrial, or home use?

---

<div class="post-metadata">

**Author:** ![Vidar\_Hetlelid](https://avatars.discourse-cdn.com/v4/letter/v/dfb087/32.png) [@Vidar\_Hetlelid](https://forum.inductiveautomation.com/u/Vidar_Hetlelid)\
**Post date:** [February 4, 2024, 12:50pm UTC](https://forum.inductiveautomation.com/t/getting-started-with-udt-mqtt-sparkplug/85199/8 "2024-02-04T12:50:48Z")

</div>

Its for home use. I have automated my home brewery. And for simplicity I called it machine. I have the brewery itself with a Wago PLC, and the fermenter using another plc etc. (Different machines).

So, today I am using OPCUA between PLCs and Ignition. But because it now has become so damn many tags, it is very messy with the flat structure of OPCUA (since i dont think Igntion support "opcuastring".motor1.amps", "opcuastring".motor1.runhours" etc. Therefore im looking into UNS, and having it all more structured.

So the way to go is publishing all data from all PLCs via MQTT into a broker, then making UDTs inside ignition?

EDIT:  
Should the PLC publish to MQTT using sparkplug, or will it be okay to use Native MQTT?

---

<div class="post-metadata">

**Author:** ![Matrix\_Engineering](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matrix_engineering/32/19781_2.png) [@Matrix\_Engineering](https://forum.inductiveautomation.com/u/Matrix_Engineering)\
**Post date:** [February 4, 2024, 1:12pm UTC](https://forum.inductiveautomation.com/t/getting-started-with-udt-mqtt-sparkplug/85199/9 "2024-02-04T13:12:36Z")

</div>

It is my understanding that using SparkPlugB will make your life a whole lot easier when it comes to using UNS with Ignition.

Back to your overall structure, though - personally, I would just UDT the tags over OPC-UA.

Adding MQTT is another layer of abstraction, and it comes with some drawbacks.

I would only use MQTT if you want to do this as a learning exercise.

The major benefit of MQTT is the low latency and pub-sub. If this is all on a LAN, that doesn't matter.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [February 4, 2024, 2:32pm UTC](https://forum.inductiveautomation.com/t/getting-started-with-udt-mqtt-sparkplug/85199/10 "2024-02-04T14:32:12Z")

</div>

If the PLCs already support OPC UA I don't see why you'd do anything other than just make OPC UA connections to them.

---

<div class="post-metadata">

**Author:** ![Vidar\_Hetlelid](https://avatars.discourse-cdn.com/v4/letter/v/dfb087/32.png) [@Vidar\_Hetlelid](https://forum.inductiveautomation.com/u/Vidar_Hetlelid)\
**Post date:** [February 5, 2024, 8:48pm UTC](https://forum.inductiveautomation.com/t/getting-started-with-udt-mqtt-sparkplug/85199/11 "2024-02-05T20:48:16Z")

</div>

Well, I agree with you. But anyway I want to learn Spark plug B, so I think that I want to try it out. But earlier when I tested Native MQTT, I couldn't write back to the same topic as it was recieved on. Is that correct? Or is it possible? At least in sparkplug?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [February 5, 2024, 8:50pm UTC](https://forum.inductiveautomation.com/t/getting-started-with-udt-mqtt-sparkplug/85199/12 "2024-02-05T20:50:41Z")

</div>

Possible in Sparkplug.

With raw/native MQTT, using the "custom namespace" option, I think you need to publish via a scripting function.

---

<div class="post-metadata">

**Author:** ![Vidar\_Hetlelid](https://avatars.discourse-cdn.com/v4/letter/v/dfb087/32.png) [@Vidar\_Hetlelid](https://forum.inductiveautomation.com/u/Vidar_Hetlelid)\
**Post date:** [February 5, 2024, 8:56pm UTC](https://forum.inductiveautomation.com/t/getting-started-with-udt-mqtt-sparkplug/85199/13 "2024-02-05T20:56:50Z")

</div>

Sounds great! Then I will look more into sparkplug. If you have any tips or example projects, it would be very appreciated 🙂

---

<div class="post-metadata">

**Author:** ![Matrix\_Engineering](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matrix_engineering/32/19781_2.png) [@Matrix\_Engineering](https://forum.inductiveautomation.com/u/Matrix_Engineering)\
**Post date:** [February 5, 2024, 9:38pm UTC](https://forum.inductiveautomation.com/t/getting-started-with-udt-mqtt-sparkplug/85199/14 "2024-02-05T21:38:25Z")

</div>

Probably find more examples on the Cirrus Link forum 🙂
