MQTT Embedded Broker

Home / FactoryTalk Optix / Optix for Edge

Description
The latest release of FactoryTalk Optix, v1.5, brings native support for MQTT with an embedded broker and a client that has publisher and subscriber capabilities enhancing connectivity to cloud applications. This video provides a brief look at how to configure the embedded MQTT broker and publish a variable in the Optix application to the embedded broker.

Software used for the demonstration:
FactoryTalk Optix v1.5
Studio 5000 v37 FactoryTalk
Logix Echo v3.01
MQTT Explorer 0.4.0-beta.6


Transcript
(00:01) this video I want to show real quick some of the new mqtt or native mqtt features that have been added to version 1.5 of Optics so um just to show that I am using the latest version which is uh the version 1.5 release which just came out towards the end of October in 2024 and if we look at the um release notes which again if you want to find the release notes you go to the question mark and just choose release notes and under the system and system features it does show that in the 1.
(00:35) 5 release one of the uh the new uh things that came into the under the data connectivity um section here is native mqtt support um with an embedded broker and the client uh that has publisher and subscriber capabilities so at a real high level I’m just going to show how we can create that broker and how I can publish uh a tag from from my Optics application to that embedded broker and then just you know read it through a mqtt client um also if you go to the help file you know under you know question mark help there is a section on this on the
(01:15) mqtt uh the new features here including you know the uh the client and the broker uh setups so to do this um in version 1.5 we have uh a new kind of uh you know item here in the project view for mqtt so if we just right click on this we can see that we get a couple options either create a client or a broker so I’m going to go with broker first um and then under broker basically we have our main properties over here to choose from um such as the listen rep report um and uh you know I’m going to go ahead and change the
(02:02) listener report to the uh to the uh 1883 get this correct here and uh so the one limitation at least in this initial release is that there will be 25 Max connections allowed so um so that is a bit of a limit for the embedded again this is an embedded broker inside of Optics itself uh you can you can choose your quality of service uh you know settings you know the standard mqtt settings here of either zero one or two Thea of two I’m going to leave it at that um and you can also set up some um some other limits
(02:48) and retain uh you know you want to retain uh the value and there’s also some security settings here I’m going to leave this false just for this demonstration and that’s pretty much all we got to do to to set up the broker right just kind of tweak the security settings and tweak any of these General configuration settings um now to go ahead and create a client I’m going to right click again and I’m going to say mqtt client and it comes up with this client one uh in the at so at the root level of the client we have some
(03:23) properties here such as the broker address and I’m going to leave this as a local host because we are going to be using the embedded broker so that one it will be a local host I will change the um port to match the 1883 that I uh set my broker to client ID you know basically what what do you want your uh client ID name to be we can change that but I’m going to leave it default to Ft Optics one and uh do you want to enable Security in this case I’m going to go ahead and say false um but if we did you know keep that true we
(04:00) could set up um some of our uh security settings here next I need to basically right click on this client and say am I going to be a subscriber or a publisher and in this case I’m going to publish I want to publish a a tag or a variable that’s inside of my Optics application and send it to the broker so I’m going to use publish so under publish we basically have just a few few options here uh sampling mode do you want to be periodic none or on change um I’m going to go and say change in value just for this example um then we have a
(04:42) folder which is basically going to be where is the tag in in the uh application coming from so the folder that I’m going to use is the model folder um is what I’ve done is I’ve uh I’ve added a a tag or a variable underneath the model folder called tank one level and we will basically publish this this variable uh to the broker and for the topic I am going to call this tank one um just for you know just for uh something to give it here real quick and uh we could we could set our our qfs um you know values again to
(05:35) either 0 one2 and if you want to have a retained setting to be true or false and that’s kind of actually all I got to do um to do this now this is the same application I was using in my um some of the Logics videos I recently made with the 1.5 you know updates for embedded tag uh or extended tag properties as well as reading the uh tag based alarms so I already have a little bit of a screen setup here um that’ll basically allow me to to change a tank level so I’m going to go ahead and start the the emulator which will fire up
(06:18) here all right so we have a uh just a simple tank that I can control the level on now to be able to see that we’re you know getting mq TT data I’m going to use my uh this mqtt Explorer um application which is a separate little uh tool that we can just you know ACC as a client and uh I’ve already got a Optics um connection configured here and all the all I have here is a name called Optics um and then I have the local host and the port 1883 that I used and I’m going to go ahead and say connect and when I do that if I were to actually
(07:03) move some data here you see that I get tank one and I get a tank one and I get a value of 24 which is exactly what the value is right now in the project um then if I were to come down here to uh to change this again say change it again you can see that we’re getting um you know in in my historical little window here um or in history window here I’m getting you know changes again I’m only going to I’m only sending on on change so um I am getting a little bit of a uh historical trend line going here but if I keep changing the value
(07:47) every so often we’ll see that I am getting data passing from this application to my mqtt um client which is kind of acting as a subscriber here the moment so just showing how quickly and easy that was for me to get a uh you know to publish an mqtt value uh to my local embedded uh broker and then be able to kind of see that data in in a different uh client application so pretty quick pretty easy um you know this is again new in version 1.
(08:25) 5 um you know there are some limitations to it of course the number of uh connections for the broker and and some of things that will kind of continue to get developed further in future releases but um but native mqtt um capability uh now in Optics version 1.5