Welcome, Guest
Username: Password: Remember me

TOPIC: Modbus via MQTT

Modbus via MQTT 3 months 1 week ago #1561

  • Planax
  • Planax's Avatar
  • Offline
  • New Member
  • Posts: 10
  • Karma: 0
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 1 month 4 weeks ago #1599

  • fatkhrus
  • fatkhrus's Avatar
  • Offline
  • Administrator
  • Posts: 534
  • Thank you received: 73
  • Karma: -112
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 1 month 4 weeks ago #1603

  • Planax
  • Planax's Avatar
  • Offline
  • New Member
  • Posts: 10
  • Karma: 0
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