Re: Using get_float_dcba

16 views
Skip to first unread message
Message has been deleted

Olivier Barthelemy

unread,
Oct 10, 2016, 2:57:24 PM10/10/16
to libmodbus
From what i understand, it just determines the order in which the bytes are read from the receive buffer to be put in the output 4 consecutive bytes of the output float. It's up to you to chose the order based on in which order your slave sends data and the endinness of your master, both of which don't always respect a norm

Envoyé: 10 octobre 2016 8:35 PM
Objet: Using get_float_dcba

Hello,

I have some confusion regarding get_float_dcba.  I understand that it reverses the byte order.  Given that the slaves are supposed to be big-endian and using IEEE754, does having to use _dcba imply that the slave is not to spec?  Or is it because my PC is not big-endian, or have I miss-understood?

Thank you for your assistance.

Dave

--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes "libmodbus".
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse libmodbus+...@googlegroups.com.
Pour obtenir davantage d'options, consultez la page https://groups.google.com/d/optout.

David Barnard

unread,
Oct 10, 2016, 3:16:48 PM10/10/16
to libm...@googlegroups.com
OK thank you.  Is it normal to try one, fail, then try the other?  Or is there a more scientific approach?

btw I somehow managed to delete the thread on google groups when I was looking through the menus - sorry about that!

Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse libmodbus+unsubscribe@googlegroups.com.

Pour obtenir davantage d'options, consultez la page https://groups.google.com/d/optout.

--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes "libmodbus".
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse libmodbus+unsubscribe@googlegroups.com.

Olivier Barthelemy

unread,
Oct 10, 2016, 3:27:43 PM10/10/16
to libmodbus
You could try setting a slave register to 0xaaBbccdd, reading it, and looking in which order you receive your bytes in the output float of the master, then deduce if you need the other float reading method?

Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse libmodbus+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages