Skip to content

Help me

edited January 2021 in PLCnext Engineer

Hello. I use the MB_TCP_FC3, but when i conduct convert data of 'arrRegister' terminal (word" to "real) with BUF TO REAL block, the data is incorrect ??. 

Comments

  • Can you please post a screen-shot of the incorrect behaviour, and describe what you expect to see?

    Also, I can highly recommend contacting your local Phoenix Contact office, who will have technical people who can offer personal support for your application.

    ~ Martin.

  • This is my screen shot.

  • Hello,

    The screen shot shows the correct behaviour.

    It looks like you have declared the array arrRegisterValue as an array of INTs. The values of the array elements, from the screen shot are:

    arrRegisterValue[0] = 0x4365

    arrRegisterValue[1] = 0x0C4A

    You do not show the value of arrRegisterValue[2], but this is also relevant, since you are using one of the bytes from this array element in the conversion.

    Here are the values of the array elements, in bytes:

    Byte 0 : 0x43

    Byte 1 : 0x65

    Byte 2 : 0x0C

    Byte 3 : 0x4A

    Byte 4 : 0x43   <= (I am guessing this value based on the result of the conversion).</p>

    Here are the other parameters you have set:

    BUF_FORMAT = TRUE : the buffer data are in Big-Endian format.

    BUFF_OFFS = 1 : Start at Byte 1 of the array, not at Byte 0.

    BUF_CNT = 4 : Convert 4 bytes from the array, i.e. Bytes 1,2,3 and 4 (but not Byte 0).

    Based on these parameters, the number you are converting to REAL is 0x434A0C65, and this converts to 202.048416138 :

    2021 01 31 11 33 51

    ... which (after rounding) is the number we can see in the screen shot.

    You did not tell us what REAL value you expect to see, but I hope this helps to find the problem.

    Finally, since you are using PC WORX - which is not part of the PLCnext Technology family - these types of problems are not likely to be relevant to any other forum users. It would be best if you could contact your local Phoenix Contact office for help with any further questions related to PC WORX or ILC controllers.

    ~ Martin.

     

Sign In or Register to comment.