Jump to content

Float values with modbus


Recommended Posts

Hello,

I am developping an application that uses Bronkhorst mass flow controllers with modbus communication. Some years later, I used a vision V570 with success. This time, I am using an Unistream and reading floats with modbus doesn't work properly : the 2 registers are inverted so the value is wrong. I tried to revert the register by using buffers and it works perfectly for read values but values to be written are rounded so I can't send setpoint to my controllers. Does anyone have an explanation ?

Below is a snapshot of the conversion code :

SwapFloat.thumb.jpg.d276438d661536f41c9b85ec3e759ff3.jpg

Link to comment
Share on other sites

  • 5 years later...
Hello, 
I am new to Modbus programming and would like to ask for advice on the above topic. 
In my application I should write a decimal number into a register of a Danfoss control valve. 
What is the best way to convert a REAL value to a UINT?

Below is my first draft, but I get a status error. Can someone explain to me what I did wrong?

 

Screenshot 2023-11-06 100639.png

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.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   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.

×
×
  • Create New...