Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


  • 0

How to send commands to Modbus Router


carlosdr02
 Share

Question

I need to send commands to a Modbus router to turn on a thermostat. I've heard that the commands need to be sent in hexadecimal format, as shown in 

Please login or register to see this link.

I found online:

Please login or register to see this code.

But how can I know how to encript the commands I want in this format, I mean, how many characters it needs to be, in what order, etc. I can't find any info online so any help is appreciated.

Thx.

Edited by carlosdr02
Added tags
Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 1
1 minute ago, carlosdr02 said:

hex characters are before valueHex on this line:

Those are static value for particular register to which I write

 

That 0x00, 0x02 is message ID, that with one Modbus TCP device is not important, so I kept it static.

 

that first 0x06 is info, that you are sending data to one holding register.

 

0x01, 0x06, 0xD0 is actual register and probably something else.

 

I would suggest atleast trial version of Simply Modbus TCP client, that can give you that Modbus commads and you can see there what you can keep static and what dynamic in Fibaro.

Please login or register to see this link.

 

Also, Trial ends after several TCP commands and just by restarting the app it will renew the trial :-D

 

Or you can use CAS Modbus scanner from

Please login or register to see this link.

. That one however has bug, that you cannot edit write commands to test them and always create new write command. But it is free.

Link to comment
Share on other sites

  • 1
2 hours ago, carlosdr02 said:

But how can I know how to encript the commands I want in this format

You need to convert decimal or string to hex. See variable valueHex in my example below

 

My example (setting setpoint for thermostat):

Please login or register to see this code.

 

Link to comment
Share on other sites

  • 1
3 minutes ago, carlosdr02 said:

Only site I found is 

Please login or register to see this link.

.

This is actually a good one.

 

We use:

  • Please login or register to see this link.

  • Please login or register to see this link.

And if you want to test Modbus connection before you attempt to use it with device, you can use Modbus simulator.

Please login or register to see this link.

Link to comment
Share on other sites

  • 0
  • Inquirer
  • 17 hours ago, jakub.jezek said:

    You need to convert decimal or string to hex. See variable valueHex in my example below

     

    My example (setting setpoint for thermostat):

    Please login or register to see this code.

     

    Well that definitely helped, but I still don't understand what those hex characters are before valueHex on this line:

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • 2 hours ago, jakub.jezek said:

    Those are static value for particular register to which I write

     

    That 0x00, 0x02 is message ID, that with one Modbus TCP device is not important, so I kept it static.

     

    that first 0x06 is info, that you are sending data to one holding register.

     

    0x01, 0x06, 0xD0 is actual register and probably something else.

     

    I would suggest atleast trial version of Simply Modbus TCP client, that can give you that Modbus commads and you can see there what you can keep static and what dynamic in Fibaro.

    Please login or register to see this link.

     

    Also, Trial ends after several TCP commands and just by restarting the app it will renew the trial :-D

     

    Or you can use CAS Modbus scanner from

    Please login or register to see this link.

    . That one however has bug, that you cannot edit write commands to test them and always create new write command. But it is free.

    Any documentation you could recommend me to learn about this? Because I tried a bunch of different commands with different formats and none of them seems to work. Only site I found is 

    Please login or register to see this link.

    .

    Link to comment
    Share on other sites

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Answer this question...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

     Share

    ×
    ×
    • Create New...