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

Understanding Modbus adressing in e!COCKPIT

somlioy
2018-06-14
2018-06-18
  • somlioy - 2018-06-14

    Hello

    Going to set up some generic modbus registers in Wagos e!COCKPIT. The device I'm connecting to has a table that specifies data with "function code 4h" and a table with addresses from 500, 501, 502 and onwards.

    In e!COCKPIT when I create a new generic modbus variable I can set function code "ReadInputRegisters (FC 4)", and also a number in "Register" and "Offset".
    What do I put in Register and Offset in this case?

    I dont have the equipment so I can't do any testing yet.

    IMG: Skjermbilde (4).png

     
  • JAPIB

    JAPIB - 2018-06-15

    Hello,

    I have never worked with Wagos e!COCKPIT, but usually when we define a Modbus communication we define the address of the first variable (in your exemple 500) to read and the number of variables to read.

    Generally, the address of the first variable can be:
    - the number of the variable, for example for% MW100, the address will be 100. This is the case with some PLC.
    - User-defined in slave configuration (example with Raspberry Pi).

    Hoping this helps you

    Best regard.

     
  • somlioy - 2018-06-18

    Yeah, seems to work fine when I'm not using the offset field. Checking array-box enables me to define length after defined address.

    But how do you do it when writing to control words with function code 16? I mean do you have to reset the bits manually?

     

Log in to post a comment.