Welcome, Guest
Username: Password: Remember me

TOPIC: Modbus via MQTT

Modbus via MQTT 2 years 8 months ago #1561

  • Planax
  • Planax's Avatar
Hello, how can I change the data type of an MQTT tag?

I configured a tag as an array, the information I receive through MQTT is a modbus frame. I have tried to extract the Modbus data field using a script in ST, but I can't even copy the mqtt tag to another local variable. Anyone have any solutions?
The administrator has disabled public write access.

Modbus via MQTT 2 years 6 months ago #1599

  • fatkhrus
  • fatkhrus's Avatar
  • Online
  • Administrator
  • Posts: 826
  • Thank you received: 123
  • Karma: -107
Hello,

Sorry for the late answer. We didn't get notification about your request by E-mail.
As I understand you get answer like an array with Modbus response. You should use this tag like Array type and then work with it by scripts like this:


Best regards,
Ruslan
The administrator has disabled public write access.

Modbus via MQTT 2 years 6 months ago #1603

  • Planax
  • Planax's Avatar
Thanks Ruslan

I already solved it, since the data came in json, I used the "substring" and "hextoint" instructions to extract the information.


Best regards
Planax
The administrator has disabled public write access.
Go to top