MQTT not reading messages

Forum Home Forums Communicating with Devices MQTT not reading messages

Tagged: 

Viewing 10 posts - 16 through 25 (of 25 total)
  • Author
    Posts
  • #12311
    Mikhail
    Moderator

    Hi,

    Could you explain what “in the original code” means?

    #12319
    alexmtzrmz
    Participant

    Of 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 code

    #12326
    Mikhail
    Moderator

    setValue is defined here. JS has a limited context, I don’t think that the main code of the driver is accessible.

    #12371
    alexmtzrmz
    Participant

    Hello 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?

    #12379
    Mikhail
    Moderator

    Hello,
    Please ask questions in appropriate topics. This topic is about MQTT.

    #12633
    KevinVt
    Participant

    Hello 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!

    #12635
    Mikhail
    Moderator

    Hello,

    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 11 months, 1 week ago by Mikhail.
    #12647
    KevinVt
    Participant

    Hello 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 ?

    #12648
    Mikhail
    Moderator

    Hello,

    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.

    #12661
    KevinVt
    Participant

    Got it, Thanks a lot!

Viewing 10 posts - 16 through 25 (of 25 total)
  • You must be logged in to reply to this topic.