Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Reading REAL values; PROFINET communication

2019-04-23
2019-04-24
  • Vijolica555 - 2019-04-23

    Hello!

    I read some REAL values with profinet communication. Controller is SIEMENS PLC and Device is Beckhoff. I have 10 Float32 REAL values. My problem is that they are not the same values as at sender side.
    First one is OK, others are really too big or really to small and jumpy. What i can change and what i tried but did not help is to swap LO and HI WORD. there is also possibility Display Mode: where we can pick between Auto, Fixes, Scientific and Both. At the beginning was Auto, then i changed to Scientific. did not help.

    Any ides that needs to be done at TwinCAT?

    Thank you.

     
  • dkugler - 2019-04-23

    Originally created by: D. Kugler

    first in your case, I would check, if the byte and word order is correct.
    If I send UDINT (32bit) from Codesys to Siemens via Profinet i figured out it has to be:
    Output byte0: Highbyte of highword
    Output byte1: Lowbyte of highword
    Output byte2: Highbyte of lowword
    Output byte3: Lowbyte of lowword

    I have often this problems with Siemens PLC's (and they'r programers ) as Master.
    If I'm not shure, what they are sending or recieving, I try to transfer a UDINT with the hex value 16#FF00A5 or 16711845 in decimal in both directions. If you have a look at the binary value (0000 0000 1111 1111 0000 0000 1010 0101) at both sides and compare them, you can find out very fast, whats wrong with the bits between the master and the slave and to which place the bytes are written!
    If this UDINT transfer is matching, then I try with the REALs.
    Good luck!

     
  • Vijolica555 - 2019-04-24

    Hello,

    Thank you for help. So i was experimenting with swaping LO and HI BYTEs and WORDs and then i got infor that i needed. Its the same for all values and i needed to swap LOBYTE and HIBYTE and LOWORd and HIWORD for whole Subterm and once again for whole value.

     

Log in to post a comment.