Getting started with UDT (MQTT Sparkplug)

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?

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

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?

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.

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) ?

^

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

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?

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.

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.

2 Likes

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?

Possible in Sparkplug.

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

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

Probably find more examples on the Cirrus Link forum :slight_smile: