• Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Analogue Input Type not correct?

    Neuron Series
    2
    3
    963
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      knebb last edited by knebb

      Hi,

      on my M103 (old model) I have attached to my analogue input a sensor which delivers 0-10V.
      I can read this voltage through modbus. So far, everything is fine.

      I am just wondering why it works ;)

      Register 1024 is supposed to configure the type of measurement:
      bb649ed8-cbbc-43e7-8ff2-bbb3fe1cab79-grafik.png

      However, register 1024 always shows "0" for me, while the input rating shows the right voltage.
      My code:

      union   {
              uint16_t word[2];
              uint32_t dword;
              float flt;
      } wert = 0;
      err =  modbus_read_registers(connection, 1024 , 1, &wert.word[0]);
      printf("[read_ai] Wert: %d",wert.dword);
      
      // Now read the voltage:
      err =  modbus_read_registers(connection, 3002 , 2, &wert.word[0]);
      printf("[read_ai] wert.flt: %5.2f",wert.flt);
      

      Output is:

      [read_ai] Wert: 0
      [read_ai] wert.flt: 3.00
      

      So value 0 mean "disabled". But it still reads the voltage. Shouldn't it be at "1" for the default mode of measuring voltage?

      /KNEBB

      C 1 Reply Last reply Reply Quote 0
      • C
        cleve administrators @knebb last edited by

        Hello @knebb,
        what is your OS and firmware version?

        Best regards,
        Kryštof Černý - Unipi engineer

        K 1 Reply Last reply Reply Quote 0
        • K
          knebb @cleve last edited by

          @cleve

          Neuron M103 (the old one, not the current) which is still running with Raspbian 10/ buster.

          How do I get the information about the firmware?

          (BTW: I tried to upgrade to latest Raspbian, but failed)

          1 Reply Last reply Reply Quote 0
          • First post
            Last post