Announcement

Collapse
No announcement yet.

HomeSeer as a Modbus Master

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #91
    Originally posted by YoYo View Post
    Hi couchounou,
    Thanks for reporting this. I *think* what may be happening is I added some code to check for a duplicate name, since this is the first interface you've added the check is coming back empty; which I should be checking for.

    For the moment, would you be willing to add the interface manually?

    Shutdown HomeSeer and locate the file hspi_ModbusMaster.config.xml in the HomeSeer Config folder and open it in a text editor.

    Paste in the following after the </Settings> tag:
    Code:
      <Interface SysId="4" Name="HS" Interval="50" Type="tcp" Port="502" Host="192.168.0.11" RunStatus="0"  />
    Relaunch, then you should be able to continue with the quick start directions...

    Ok perfect, working with this manual config !
    i will follow testing
    thx

    Comment


      #92
      Originally posted by couchounou View Post
      Ok perfect, working with this manual config !
      i will follow testing
      thx
      Glad to hear it! I should have the next beta release out in a few days that adds formulas, number formatting, and the ability to enable/disable individual points.

      Comment


        #93
        Originally posted by YoYo View Post
        Glad to hear it! I should have the next beta release out in a few days that adds formulas, number formatting, and the ability to enable/disable individual points.
        Playing with modbus power clamp can't wait next release !
        let me know if you need some specific tests or ..

        Comment


          #94
          I start Beta testing and obtained the following error:

          ModbusMaster.Connect(test): Unable to open port: Invalid COM port specified.

          I entered COM 6. Other software is able to poll using this port.

          Comment


            #95
            Originally posted by John245 View Post
            I start Beta testing and obtained the following error:

            ModbusMaster.Connect(test): Unable to open port: Invalid COM port specified.

            I entered COM 6. Other software is able to poll using this port.
            Hi John,
            I just uploaded a new version of the plugin which I think will resolve the com port error you were getting. Give it a try and let me know if you have any issues.
            Last edited by YoYo; January 25, 2014, 05:47 PM.

            Comment


              #96
              Hi YoYo,

              The new version did fix the problem of the COM port. New issues occured, I will give it a try.




              Originally posted by YoYo View Post
              Hi John,
              I just uploaded a new version of the plugin which I think will resolve the com port error you were getting. Give it a try and let me know if you have any issues.

              Comment


                #97
                Self-replicating Modbus points

                Hi YoYo,

                Great work you are doing. The new version also solved my COM problem.

                Found some new issues:
                -additional Modbus points on the same Slave ID seem to self-replicate (see screenshots)
                -the status remains "Unknown" although the physical output do change when I press On or Off (but very slow, see next point)
                -the bus becomes very unresponsive and slow when more points are added (although still only have a few)
                -there is a shift in the input registers: after I added "Modbus ID2 I2", the "Modbus ID2 I1" started to show the ID2 physical input

                Good luck with the debugging. Happy to test more.

                Regards,
                Jan
                Attached Files

                Comment


                  #98
                  That's very strange Jan.
                  I've never seen anything like that in my test environment... Can you remember what steps you took when the duplicate devices showed up?
                  We'll get that nailed down and then we'll see about the addressing issues, etc. I've tested it with literally 100s of devices spread across multiple interfaces and the performance has always been very good, albeit the tests have been at much higher speeds like 57600 bps.

                  You may have noticed the interface request time device is now providing a round-trip time and I see the one above is showing 1.4 seconds which seems like a long time to me...

                  Thanks for helping with this.

                  Comment


                    #99
                    Hi YoYo,

                    I will get the following error:
                    Server Error in '/' Application.

                    Configuration Error

                    Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

                    Parser Error Message: Could not load file or assembly 'HSPI_MODBUSMASTER' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

                    Source Error:

                    Line 57: <add assembly="System.EnterpriseServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/> Line 58: <add assembly="System.Web.Mobile, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/> Line 59: <add assembly="*"/> Line 60: <add assembly="System.Runtime.Serialization, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"/> Line 61: <add assembly="System.IdentityModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"/>
                    Source File: C:\Windows\Microsoft.NET\Framework\v2.0.50727\Config\web.con fig Line: 59

                    Assembly Load Trace: The following information can be helpful to determine why the assembly 'HSPI_MODBUSMASTER' could not be loaded.

                    WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

                    Comment


                      Hi John,

                      I suspect this means you do not have .net 3.5 installed on your computer which is required for this plug-in to run as it makes extensive use of LINQ.

                      Could you download Microsoft .net 3.5, install it and let us know if that solves it?
                      Last edited by YoYo; January 26, 2014, 07:29 PM.

                      Comment


                        Hi YoYO,

                        I did a new install of my HS 2 test environment and that solved the problem

                        An other small "bug" on the device properties page you have to enter the offset address. For e.g. I want to read register 40013. When I enter 13 I will get the error below. Entering 40013 solves the problem and reads the correct value. So it seems that the offsett function is not working propperly.

                        ModMaster Error Interface test read error: Device '' defined at modbus address '13' is indicating that the modbus address is invalid. The details of the error follow: Exception of type 'Modbus.SlaveException' was thrown.Function Code: 131Exception Code: 2 - The data address received in the query is not an allowable address for the server (or slave). More specifically, the combination of reference number and transfer length is invalid. For a controller with 100 registers, the PDU addresses the first register as 0, and the last one as 99. If a request is submitted with a starting register address of 96 and a quantity of registers of 4, then this request will successfully operate (address-wise at least) on registers 96, 97, 98, 99. If a request is submitted with a starting register address of 96 and a quantity of registers of 5, then this request will fail with Exception Code 0x02 “Illegal Data Address” since it attempts to operate on registers 96, 97, 98, 99 and 100, and there is no register with address 100.




                        Originally posted by YoYo View Post
                        Hi John,

                        I suspect this means you do not have .net 3.5 installed on your computer which is required for this plug-in to run as it makes extensive use of LINQ.

                        Could you download Microsoft .net 3.5, install it and let us know if that solves it?
                        Last edited by John245; January 27, 2014, 05:09 AM.

                        Comment


                          Hi YoYo,

                          Just another issue to fix.

                          Some of the holding registers will contain negative or positive values. In case the value of the holding register is positive the register will be read correctly. However in case of a negative value in the holding register the value displayed is not correct. In case of negative values a value > 65000 will be reported (I recorded values of 65342, 65502).

                          Regards,

                          John
                          Last edited by John245; January 27, 2014, 02:47 PM.

                          Comment


                            Hi YoYo,

                            It seems to happen when I press "On" on the second device I created, but it does not happen consistently.

                            Also, when I only have one Modbus point the performance is very good (press the button and hear the relay switching immediately). When I add one more point then the performance goes down a lot (have to wait at least one second).

                            Any thoughts?

                            Jan

                            Comment


                              Originally posted by John245 View Post
                              Hi YoYO,

                              I did a new install of my HS 2 test environment and that solved the problem

                              An other small "bug" on the device properties page you have to enter the offset address. For e.g. I want to read register 40013. When I enter 13 I will get the error below. Entering 40013 solves the problem and reads the correct value. So it seems that the offsett function is not working propperly.
                              Hi John,
                              It seems that different modbus slaves handle the addressing differently. I'm not sure if this is a bug, or just something that's going to vary depending upon the slave device being talked to. For now, I'd like to study it a bit more before making any changes... perhaps see how it works on a larger number of slaves.

                              Thanks for reporting it.

                              Comment


                                Originally posted by John245 View Post
                                Hi YoYo,

                                Just another issue to fix.

                                Some of the holding registers will contain negative or positive values. In case the value of the holding register is positive the register will be read correctly. However in case of a negative value in the holding register the value displayed is not correct. In case of negative values a value > 65000 will be reported (I recorded values of 65342, 65502).

                                Regards,

                                John
                                Hi John,
                                Negative numbers can be a thorny issue, but I'm glad you have a slave where this is needed so I can get it tested. Technically, there are no negative numbers in modbus, just a 16-bit value. To handle negative numbers, some devices use 1's complement or even 2's complement. Is there anything in your documentation that mentions how negative numbers are stored? Maybe you could give me an example of what the plug-in is reporting for a known negative number and I should be able to figure it out from there. I think I may need to add a checkbox or something to the device properties so that the plug-in knows when to perform the calculation.

                                Comment

                                Working...
                                X