Showing results 1 to 4 of 4

Thread: Modbus read input status

  1. #1
    Join Date
    15.07.2008
    Posts
    6

    Ausrufezeichen Modbus read input status

    We are trying to read 8 discrete inputs from a modbus device.
    Input are connected to 8 BOOL zenon variables, using INPUT STATUS driver type and BOOL data type.

    We have noticed that if we define an array of 16 BOOL associated to the first 16 input register communication is ok and data is displayed correctly.

    If we define a single variable associated with input register n. 1 communication is ok but data displayed is always 0.

    Where is the problem?

  2. #2
    Join Date
    30.05.2007
    Posts
    105

    Default Re: Modbus read input status

    Quote Originally Posted by maurodx View Post
    We have noticed that if we define an array of 16 BOOL associated to the first 16 input register communication is ok and data is displayed correctly.

    If we define a single variable associated with input register n. 1 communication is ok but data displayed is always 0.

    Where is the problem?
    Do you also use INPUT STATUS as object type for this array of 16 BOOL?

    Have you also tried Holding Register or Coil?

  3. #3
    Join Date
    15.07.2008
    Posts
    6

    Default Re: Modbus read input status

    Quote Originally Posted by markusw View Post
    Do you also use INPUT STATUS as object type for this array of 16 BOOL?

    Have you also tried Holding Register or Coil?
    yes array of 16 is configured the same way with INPUT REGISTER.

    Coil works... but it's another area in the controller... 0x instead of 1x (for input status)

    Holding register obviously doesn't work because zenOn use the function dedicated to Holding register that point to another area in the controller (4x)

  4. #4

    Default Re: Modbus read input status

    You mentioned, that an array was working correctly. With an array, you can have the option "automatic addressing" set, and define whether each datatype starts with a new offset or not. If this option is active, the first variable is offset 1, the second variable in the array is offset 2, and so on.

    If this option is inactive, the first variable is offset 0, bitnumber 0, the second variable is offset 0, bitnumber 1 and so on.

    You can see under "addressing" in the properties window, how the offsets for your array are set. You should then set the offset / bitnumber for your single boolean variables accordingly.

    how did you configure the variable offset and the bitnumber for your single boolean variables?

    note, that offset 0 are the first 16 inputs. (bit 0 to 15)

    At the bitnumber in the properties window of the variable, you define which bit of these 16 inputs this boolean variable refers to.

    offset 1 are the next 16 inputs. (bit 16 to 31)

Similar Threads

  1. digital input from field devices
    By nahala in forum straton / zenon Logic
    Replies: 6
    Last Post: 21st April 2009, 07:59
  2. Replies: 1
    Last Post: 1st April 2009, 14:31
  3. Read Real variables in VBA
    By joulz in forum VBA
    Replies: 4
    Last Post: 5th February 2009, 13:29
  4. Read dBase does not work
    By bjoerndavid in forum zenon Supervisor
    Replies: 3
    Last Post: 26th November 2007, 13:15

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •