Allow Outbound Tag Writes
Implementing MQTT in Ignition: Video 93 min video / 3 minute read
< Previous Video | Next Video >
By default, when you install the MQTT Engine Module, there’s a setting that blocks the device tag writes. Travis Cox shows how to allow outbound tag writes using the MQTT Engine Module so you can write down to a tag in the PLC on the other side.
Travis: In this session, we're gonna show how to allow outbound tag writes using the MQTT Engine Module, so we could write down to the tag in the PLC on either side because by default we install the module, there's a setting that blocks these device tag writes. And we can actually see that in the Designer in the MQTT Engine area. I know these tags are writable on either side, but if I try to write to this here, it's not gonna allow me to do so. In fact, I'm gonna see an error in my console if I go and look at that.
Now, I know that these tags are writable. In fact, if I go down to Transmission, that is actually the ones publishing it, if I make this go to true down there, it's where I wrote to the PLC. In fact, I'll see that come through up here on the Engine. So, I know Engine's actually blocking it. Now, there are many layers along the chain, there's Engine, there's MQTT server, there's the Edge node, which is Transmission, of course there's a connection to the PLC. Everything has to be allowed to re-write all the way through if you want this to happen.
So, let's first check the MQTT Engine Module, and we can do that by going to the configuration that's in the gateway web page. So in the configuration section, I can go to the MQTT Engine settings, and right there under Miscellaneous is a block device commands setting. I have to uncheck that to allow these tag writes. So I'm gonna go ahead and do so. Go ahead and save my settings. Now, if we go back to Designer, I should be allowed to do that writes. I'm gonna go ahead and check it or uncheck it. And now that write went down, you could see a transmission, it is now false.
So that actually went down all the way to the PLC, but again, there's many layers in that chain. So, if you had a failure, if it still wasn't writing, we have to look at every one of those layers. So Engine is the first place to check. The second place to check would be with the MQTT server. In my case, I'm using the MQTT Distributor Module. Under settings, there are access control lists that are set up for a user. And so in this case, I'm connecting to a user called Admin and it has full read/write ability on hashtag, which is every topic that's coming through on that particular server. So I've got full privileges here with Engine when I'm connected to that MQTT server. So that part is not the bottleneck.
The next piece would be on the edge node, which in my case is the MQTT Transmission Module. And with that, the Transmission Module has transmitters that are publishing the data. And so in my case, all my tags are defined as tag provider. If I edit this transmitter I can see that there is a setting in here, that actually is blocking those commands as well. So in my case it's not, it's unchecked, so we're good to go, but that's another place to actually look. And because it's transmission as well, the last place to check, if again if it wasn't working and that setting was okay, is the actual tags themselves. So, this is writable in one tag, it has the access rights of setting to read/writes. We're good there. And of course, this is their actual writable tag within the PLC. So again, you have to check every layer of the chain, typically by default or just the MQTT Engine Module, you’ve got to uncheck that to allow those rights to occur.