TMDS64EVM: PROFINET device demo data endianess

Part Number: TMDS64EVM


Hello.

I'm using the PROFINET device demo from Industrial communication SDK 11.00.00.13, and I'm wondering, that the process output data in the demo application callback function

PN_APP_IOD_cbDataRead(PN_API_IOD_Handle_t *const pnHandle, PN_API_IOD_DevAddr_t *const addr, const uint32_t bufLen, uint8_t *const buffer, const PN_API_IOD_IOXS remoteIops)

after the buffer pointer are provided in big endian format. I expected littel endian format.

With the process input data copied to the buffer pointer within function PN_APP_IOD_cbDataWrite(PN_API_IOD_Handle_t *const pnHandle, PN_API_IOD_DevAddr_t *const addr, const uint32_t bufLen, uint8_t *const buffer, const PN_API_IOD_IOXS remoteIocs)

it is the same. I have to copy the process input data also in big endian format.

I didn't read something about big/little endian format, thus I expected little endian format. This is also the configuration within the project properties for the ARM compiler ("-mlittle-endian").

Do you have an explanation?

  • Hello,

    I'm not sure I understand your question. Would you please clarify more? is your problem about the way we store data? or the data format on the network?

    You give the data in big-endian format and it is stored in little-endian format as per compiler configuration.

    Kind regards,
    Kamil

  • Hello.

    I'm just wondering, that the data stored behind the buffer pointer of functions PN_APP_IOD_cbDataRead() is big endian format respectively of function PN_APP_IOD_cbDataWrite() must be provided after the buffer pointer in big endian format.

    Thus, the way the process data is stored by the PROFINET device stack.

    My expectation was, that the PROFINET device stack will provide the process data in little endian format, so that I can use memcpy() to handle the process data in my application also in little endian format.

    Regards,

    Sebastian

  • Hello Sebastian,

    I just checked on my side and it seems that the data provided to the buffer inside PN_APP_IOD_cbDataWrite() is stored in Little-Endian format.



    isn't this what you actually want?

    Thanks.
    Kind regards,
    Kamil

  • Hello again.

    Thank you for your support until now.

    Excuse me, I've narrowed the focus a little.
    We need to consider the entire data transfer from the PROFINET I/O controller to the TMDS64EVM development board.
    When I use the GSDML file, I have a 2 byte and a 4 byte standard data point in the PROFINET I/O Controller (Siemens S7-1500). Look at the picture.

    If I now send a constant value (0x12345678) from the PROFINET I/O controller to the 4-byte data point via slot 1, subslot 2, it arrives in big endian format in the PROFINET device stack.

    Constant data within PROFINET I/O controller:

    Big endian format of constant data "0x12345678" after the buffer pointer to be copied to the demoOutData[] array within function PN_APP_IOD_cbDataRead().

    Content of demoOutData[] array after the memcpy() of the constant data after the buffer pointer.

    Of course, this is just the way of the output process data. But things are going in a similar way in the opposite direction.

    I simply do not understand where the byte order is rotated.

    Thank you for your continued support,

    Sebastian

  • Hello Sebastian,

    thanks for the clarification. I will check your concern and get back to you ASAP.

    Kind regards,
    Kamil