cMT-G01 MQTT JSON and Tags

You were right about their customer support they are top notch. What I got back was that it is not currently possible to directly transmit AB string tags over MQTT, but you can store it in a local register (user just needs to know how to do this:ROFLMAO:) The way they came up with was to use a global transfer object. I have not tested this yet but seems pretty straight forward and should work fine for my application. I will try and drop in and post some screens of the setup and comment on the results once I get it setup.

So the local register will hold my AB string and I will use it to populate my MQTT message fields.
 
After spending a little more time on this, I think the issue is how Allen Bradley handles "STRING DATA".(Now I'm working with a Micro850 as I don't have a Compact or control logix PLC)

When you setup a Tag as a string AB actually breaks it down into an "ARRAY" and then uses the ASCII(Decimal value) as the "VALUE".

Thats how come the Maple System can't see that data. The maple system stores ASCII into "WORD".

So with that in mind I have wrote a "MACRO" that will transfer the AB Tag value-array in the local LW memory of the maple system and now the maple will treat this data as "STRING".

This way you can send your value OUT with MQTT.

The only thing I need to know is what will be the MAXIMUM CHARACTERS in your string value. I can plug this into the macro and then you can edit the macro for your needs and I think it will work for you.

Just let me know.
 
Just in case anyone else may want or need this. I have attached the MACRO.

This would be used to read "STRING" data from AB and put into a variable in a Maple System HMI to be sent out with MQTT protocol.

This is NOT complete because of the amount of coding needed, but it shows how it could be done.

I think there is enough of a sample that anyone should be able to build upon to make it complete.

Good Luck.
 
Thanks Damica.

Here is a run down on how we ended up handling this.


On the Objects tab use Data Transfer (Global) only option available for cMT-G01. The transfer you can setup to be bit triggered or time-based, I went with Time-Based. (Thought this would be problematic with my messages getting updated every time the transfer takes place but it does not seem to trigger a message every time possibly because the values of the STRING never change. Either way this worked out well for me because it ensures the values are populated when power is lost vs trying to use a bit to trigger.)

After you setup the data transfer, you will be able to go into the MQTT publish and set the address for the local word up as a string and give it a word count notice there is a word count for the data transfer portion as well that should be set to match.

1.PNG 2.PNG 3.PNG 4.PNG
 
I did not realize that the maple would "Automatically" convert the SINT values into STRING.

But as long as it works the way you want it to that is what counts.
 

Similar Topics

Hello friends!! I am going through a issue... I have comissioned a cmt-svr102 on a site it works fine but after some time like two or three days...
Replies
8
Views
1,763
I have a TI 505 Program .V5P sent to me with no comments. I was then sent the .CMT file and I am wondering how to have the program update with...
Replies
2
Views
1,345
Help! I am using CMT, Common Migration Tool to migrate users from Exchange Server to Notes Server. It worked perfect until a couple weeks ago...
Replies
0
Views
5,200
Hi, I'm looking for standart function blocs SIEMENS S5 6ES5 840-7SG01 for IP262 and standart function blocs SIEMENS S5 6ES5 840-4BC21 for PID CPU 103
Replies
2
Views
1,196
Hi Guys, I am facing problem in connecting “Siemens PLC” with MQTT-broker. 1. In node-red, MQTT-node status remains connecting. 2. In...
Replies
2
Views
124
Back
Top Bottom