Forum Home › Forums › Communicating with Devices › MQTT not reading messages
Tagged: mqtt
- This topic has 24 replies, 4 voices, and was last updated 2 years, 6 months ago by
KevinVt.
-
AuthorPosts
-
March 29, 2023 at 12:47 pm #12311
MikhailModeratorHi,
Could you explain what “in the original code” means?
March 29, 2023 at 1:14 pm #12319alexmtzrmz
ParticipantOf course!
So I understand that the js file is a function that is being called from a bigger code where setValue() is defined
I’d like to know if it’s possible to have access to the main codeMarch 30, 2023 at 8:28 am #12326
MikhailModeratorsetValue is defined here. JS has a limited context, I don’t think that the main code of the driver is accessible.
April 5, 2023 at 7:08 pm #12371alexmtzrmz
ParticipantHello Mikhail
I have migrated from the v5 to v6 of rapid scada, the situation here is that in v5 I was able to edit a file called MainMaster that was located in C:\SCADA\ScadaWeb
but now I checked the same directory and I cant find the file, do you know where I can find it so I can edit it?
April 6, 2023 at 8:52 am #12379
MikhailModeratorHello,
Please ask questions in appropriate topics. This topic is about MQTT.May 17, 2023 at 1:32 pm #12633KevinVt
ParticipantHello Mikhail,
I had setup MQTT Client in v6, and I can get data from MQTT broker, but I confused 2 questions, could you please help to check?
1, all the data I got is double, can I get data in other format? for example, the sequence number is int.
Current Data
| # | Code | Name | Value | Channel |
| 1 | .saleid | MqttReport.saleid | 10,100,001.000 | |
| 2 | .gateid | MqttReport.gateid | 10,100,001,001.000 | |
| 3 | .time | MqttReport.time | — | |
| 4 | .sequence | MqttReport.sequence | 100.000 | |2, when use setValue(1,data.time) in js file for MqttReport.time, had error: “Error : Input string was
not in a correct format.”
I had try different format of timestamp, all got errors. How can I get correct time value?Thanks a lot!
May 18, 2023 at 10:40 am #12635
MikhailModeratorHello,
1. Yes, the driver converts all MQTT data to double. You can set data format to display in channel properties. It affects web interface.
2. Convert time to number of milliseconds in JavaScipt. Then it’s possible to convert it to date and time using channel formula.
-
This reply was modified 2 years, 6 months ago by
Mikhail.
May 19, 2023 at 8:15 am #12647KevinVt
ParticipantHello Mikhail
Thanks a lot for your answers, another question, for some data can not convert to double, such as name, how to get their value ?May 19, 2023 at 9:01 am #12648
MikhailModeratorHello,
Currently, the MQTT driver doesn’t support strings. It’s possible to implement in the future.
Strings are supported by OPC UA driver, for example.May 20, 2023 at 1:23 pm #12661KevinVt
ParticipantGot it, Thanks a lot!
-
This reply was modified 2 years, 6 months ago by
-
AuthorPosts
- You must be logged in to reply to this topic.