Endianess

53 views
Skip to first unread message

John Arvanitis

unread,
May 25, 2020, 4:32:38 AM5/25/20
to EIP Stack Group OpENer Developers
I want to change the endaieness from litle to big

There is selecton on file endianconv.c (line 240) but this variable does not change the output on the UDP packet


Is there any error on that? 

Martin Melik-Merkumians

unread,
May 25, 2020, 4:44:28 AM5/25/20
to EIP Stack Group OpENer Developers
I am not sure what you are trying, but regardless of endianess, the payload should stay the same, as ENIP defines endianess on its network packets

stm-at-esd

unread,
May 25, 2020, 5:04:31 AM5/25/20
to EIP Stack Group OpENer Developers
Hi,


Am Montag, 25. Mai 2020 10:32:38 UTC+2 schrieb John Arvanitis:
I want to change the endaieness from litle to big

There is selecton on file endianconv.c (line 240) but this variable does not change the output on the UDP packet
 
The endian detection and selection only serves the purpose to make the OpENer run on little and big endian machines
without change. OpENer needs to know the endianness of the machine it runs on to know how to encode some data.

Also as Martin already mentioned the EtherNet/IP protocol itself is inherently little endian and all the protocol data keeps its
endianness.

If you want to change the endianness of your IO data in the IO data assembly the easiest way it would be if you put the data
in the g_assembly_data* array the way you want it on the network. This is possible because the GetAttributeSingle() function
that is called internally to transmit the data from the g_assembly_data* array to the network uses itself EncodeData() which in
turn for a assembly would use a plain memcpy() if it is defined as array of bytes.

If you violate the EtherNet/IP spec would in part also be depending on your *.eds file where you declare the type(s) and size
of the content of your assembly object.

YMMV,
    Stefan

Martin Melik-Merkumians

unread,
May 25, 2020, 5:07:36 AM5/25/20
to EIP Stack Group OpENer Developers
Hi,

I recently removed EncodeData in favor of function pointer, but you can achieve the same effect by providing a custom function to the assembly data.
Reply all
Reply to author
Forward
0 new messages