Little endian
-
Hi All,
how to set the data format "little endian" in mango?
I must put the variable in a meta data source?
If yes, what script should I enter?thanks
-
What do you want to have be LE? Data storage, transmission, a particular comm protocol? And why?
-
Hi,
the registers are transmitted as words of 16 bits, LSByte first, followed by MSByte.
How to do the reverse in mango?thank you
-
To be clear, i assume you are talking about Modbus. The implementation currently does not have an endian flag.
-
Yes,
the protocol is Modbus.
So there is no chance?
I use the latest version of m2m mango.
If not, think that in future there will be?thanks
-
Seems unlikely at the moment. The Modbus spec - such as it is - is clear on byte ordering as i recall, and honestly, you're the first to ask for little endian. Why do you need it?
-
I use that because the slave provides the data in this format.
The specifications of the device indicate that the protocol is Modbus RTU.
Very strange.thanks
-
Yes, strange. Is this a relatively new model? I wonder if they're also swapping things like the CRC.
-
I really need to reverse the byte order of a variable.
I can do meta data source with a command like the following?unsigned short int Endian_Word_Conversion(unsigned short int word) {
return ((word>>8)&0x00FF) | ((word<<8)&0xFF00) ;
}where 'word' is, for example, p241.value or p241.other
any ideas?
thanks
-
Sure, you can do something like that.