cMT-G01 MQTT JSON and Tags

Snyd1

Member
Join Date
Jun 2018
Location
there
Posts
225
Guys, I am trying to get a MQTT message out of the Maplesystems/Weintek cMT-G01 that is connected to a control logix PLC. Everything seems pretty straightforward and the scope of the project is pretty simple. Just sending status of discrete's. The customer would like other identifying information in the JSON message though and that is giving me a hard time. All the identifying information they would like is alpha numeric and for the life of me I cannot seem to get an address format of ASCII when setting up the publishing address in the cMT-G01. My ideal end result message in JSON would look something like below. The "Active" is my discrete, the other two fields are what I need to fill with ascii values.


{
"d" : {
"UniqueCode" : [ 123ABC ],
"Direction" : [ Left ],
"Active" : [ false ]
},
"ts" : "2018-11-06T00:05:10.932017"
}

Any suggestions? I also have at my disposal a Red Lion CR3000 but have had even less luck using the generic MQTT option that is new to crimson 3.1.
 
Your not going to be able to change the MQTT(JSON) format that maple uses to publish the information.

How even, you say the customer wants additional information, if that information they want can be as a TAG Value then all you have to do is create a new topic for those tags.

When selecting the tags if you are selection ASCII your will probably have to select an array of 16 bit addresses.
 
When selecting the tags if you are selection ASCII your will probably have to select an array of 16 bit addresses.

I guess this is where I am getting stuck. I realize it needs to be associated with a tag but have not had any luck getting one to output what I needs like [123ABC].
 
OK, so you have to create a ASCII Object as shown in picture. (Now depending on how large you need this object to be will determine on how many 16 bit words will be involved.

So if I create an ASCII object at address LW-100 and it is 4(16 bit words Long)

Then when you assign the address to the MQTT topic it will be LW-100 and 4 words long.

This way the topic knows to read 4 (16 bit words starting at address LW-100).

Does this make sense to you.

Let me know,

ASCII Sample.jpg
 
P.S.
ASCII is much harder to deal with, if it was me I would try to develop some type of "Numeric" values that I could use.

Example: LEFT = 1, RIGHT = 2.
Active = 0(False) or 1(True)
Unique Code = "Try to figure out a code that you could use and be represented by a "16 Bit WORD"

Example: How many different "Unique Values" will you have? A 16 bit word could equate to 65535 different codes.

So 1 could = Blue
2 would = Red
3 = Black
20 = Small - Black
30 = Large - Red
40 = Medium - Blue.

Several ways, as I said just some ideas.
 
Unfortunately the cMT-G01 gateway does not have any of the HMI functions unless I am missing something. So I am unable to create any objects. A virtual HMI would be a nice addition to the gateway which is probably a different unit.

I was considering something similar to a code or converting to binary. Luckily the customer made it easy for me and I am just going to put the data I need in the "Name" field for the address and just associate a bool to it.


All in all even though the functions are a little limited, the gateway and software was pretty easy to setup. I like how they handle the MQTT messaging.

Wish I could get results from the CR3000, think Red Lion has some work to do on the MQTT side of things.
 
Is the only reason your using the cMT-G01 is to publish MQTT Data?

If so, you may want to look at using one of the small HMI's, because all of maple systems hmi's will publish MQTT Data.

So as another example the HMI5043LB could be used just as the "Edge" gateway.
Something to think about, with an HMI you won't have any of the limitations that the cMT-G01 will have.

It retails for $295.00 USD.
 
Yeah basically just to publish MQTT. Just something to remember when/if I ever do another project like this.
 
OK, so you have to create a ASCII Object as shown in picture. (Now depending on how large you need this object to be will determine on how many 16 bit words will be involved.

So if I create an ASCII object at address LW-100 and it is 4(16 bit words Long)

Then when you assign the address to the MQTT topic it will be LW-100 and 4 words long.

This way the topic knows to read 4 (16 bit words starting at address LW-100).

Does this make sense to you.

Let me know,


@damica1

Thought I had this taken care of but IT didn't like the message so I am back to trying to find a way to format like this.

I do not have an HMI model available to test but I have one selected in EBpro and am trying to figure out how it will get the value. Would I make a string in the PLC with my identifying information like "Left" and have the ASCII object read that or is there a way to have a static value in the ASCII object without it reading from something or getting input from a user on the HMI?

I was hoping I could make the object and input a static value (one that would not change during power down or one it would revert to if power is lost and restored) that I could address to the MQTT tag, but it looks like you would have to key it in from the HMI, or read from the PLC.
 
I do think you could store a "String" in the plc and have an ASCII object read out that TAG. I also think you could make your ASCII Object Static (But that would have to be done with a "MACRO".) This may actually be the easiest way.

Can you explain again exactly what you need? I have forgotten all about this post and I have not studied anything more about the cMT-G01.

I will help all I can, but I do want to say that Maple Support is some of the BEST I have ever worked with.
 
I do think you could store a "String" in the plc and have an ASCII object read out that TAG. I also think you could make your ASCII Object Static (But that would have to be done with a "MACRO".) This may actually be the easiest way.

Can you explain again exactly what you need? I have forgotten all about this post and I have not studied anything more about the cMT-G01.

I will help all I can, but I do want to say that Maple Support is some of the BEST I have ever worked with.

That's interesting because I have not been able to get a hold of them for three days now via phone or email response. Basically I need some static identification information along with the status of my discrete inputs. Sections are broke down like "ABC123". I created a string in the PLC and when I try to use the address in the cMT-G01 all I can select is the DATA portion of the string which it pulls in as SINT then I am able to give it an element count for ABC123 of 6 it does not recognize that this should be ASCII and what I end up with is decimal representation of my STRING.

ABC123 = [65, 66, 67, 49, 50, 51]

I do not have the cMT-SRV model but when I create a project with one and an ASCII object using the same string it seems to pull it in the same way as a SINT with element count so I am assuming I would end up with the same results.

Quite possible I am missing something here, they claim you can bring in all tags controller, program user defined etc but I always get errors when trying.
 
Snyd1, I have emailed you the MQTTmanual for (EBPro/cMT-g01) I think this should clear some things up.

I have not worked with the cMT-g01 unit, so there is probably some things I am not aware of, and I try to avoid ASCII just because it is very confusing to work with. But let me try to explain a few points.


Each (2) letters will be a (16bit word) (Example DA= (1)-16bit word. so if you know you are going to be working with 8 letters you will need to set aside 4 words.

Also if you are working with 4 tags each a 8 letter ascii value you will have to create an array of 32 words, now they have to be consecutive in order (This means if you start your array at LW-100 address then the next 32 addresses is what the ASCII object will read for the 4 tags.

Am I making any sense?
 
Page 14 of the manual I just sent you. Notice 4 elements which will equal 2(16 bit words) and since the address starts at LW-30 the HMI knows to read from 30 through 31.

MQTT_String_Data.jpg
 
Yes I have noticed that, and is why I am a little frustrated for the life of me I cannot get STRING as an option and have yet to find a way to even make a local tag address type as string
 

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,705
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,338
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,194
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,190
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
117
Back
Top Bottom