Announcement

Collapse
No announcement yet.

ModbusTCP problems.

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

    ModbusTCP problems.

    I have problems getting this plugin to connect to ModbusTCP gateway. I cannot find any help file!
    Using this gateway: https://www.anybus.com/docs/librarie...rsn=a7a2acd6_4
    Homeseer system:
    HS3 ZEE S2 Edition 3.0.0.357
    Modbus plugin: 3.9.6431.26038: Modbus. Licensed.
    The gateway have a status page showing number of connections. When running modpoll it shows 1 connection. No connection when I stop modpoll, indicating that the plugin is not connected.
    Modpoll returns values from the gateway internal registers. I also try to set up the same register in the plugin.
    In the gateway settings the Test button returns: "Passed connectivity test to gateway".
    Setting the debug level to debug does not open the file "/usr/local/HomeSeer\Logs\HSPI_MODBUS._log".
    But there is a file mono-sgen.log that seems to be the debug file.
    Here is an excerpt from it:

    --- End of inner exception stack trace ---
    at System.Net.Sockets.NetworkStream.Write (System.Byte[] buffer, System.Int32 offset, System.Int32 size) <0x7367e388 + 0x00264> in <filename unknown>:0
    at Modbus.IO.TcpClientAdapter.Write (System.Byte[] buffer, System.Int32 offset, System.Int32 size) <0x720467e8 + 0x00047> in <filename unknown>:0
    at Modbus.IO.ModbusIpTransport.Write (Modbus.Message.IModbusMessage message) <0x72044f68 + 0x00077> in <filename unknown>:0
    at Modbus.IO.ModbusTransport.UnicastMessage[T] (Modbus.Message.IModbusMessage message) <0x72044880 + 0x000ab> in <filename unknown>:0
    2017-11-23 16:49:40.4892| ERROR|HSPI_MODBUS.Gateway.OnTimedEvent |Read error for Modbus Device 1-3
    2017-11-23 16:49:40.5079| ERROR|HSPI_MODBUS.Gateway.OnTimedEvent |I'm not going to poll any remaining registers on this gateway as it seems there is a communication issue.
    2017-11-23 16:49:41.4054| DEBUG|HSPI_MODBUS.Gateway.OnTimedEvent |Polling Modbus IP Gateway. Reading 1 registers from slaves
    2017-11-23 16:49:41.4266| DEBUG|HSPI_MODBUS.Gateway.Read |Reading Slave: 8 Address: 26 HoldingRegister:Int16
    2017-11-23 16:49:41.4454| ERROR|HSPI_MODBUS.Gateway.ReadValue |Error in ReadValue: Unable to write data to the transport connection: The socket has been shut down.
    System.IO.IOException: Unable to write data to the transport connection: The socket has been shut down. ---> System.Net.Sockets.SocketException: The socket has been shut down
    at System.Net.Sockets.Socket.Send (System.Byte[] buffer, System.Int32 offset, System.Int32 size, System.Net.Sockets.SocketFlags flags) <0x7367e8c8 + 0x000c0> in <filename unknown>:0
    at System.Net.Sockets.NetworkStream.Write (System.Byte[] buffer, System.Int32 offset, System.Int32 size) <0x7367e388 + 0x000b7> in <filename unknown>:0
    --- End of inner exception stack trace ---

    And Modpoll:
    modpoll -m tcp -a8 -t 4 -r 26 192.168.1.40
    modpoll 3.4 - FieldTalk(tm) Modbus(R) Master Simulator
    Copyright (c) 2002-2013 proconX Pty Ltd
    Visit http://www.modbusdriver.com for Modbus libraries and tools.

    Protocol configuration: MODBUS/TCP
    Slave configuration...: address = 8, start reference = 26, count = 1
    Communication.........: 192.168.1.40, port 502, t/o 1.00 s, poll rate 1000 ms
    Data type.............: 16-bit register, output (holding) register table

    -- Polling slave... (Ctrl-C to stop)
    [26]: 19200
    -- Polling slave... (Ctrl-C to stop)
    [26]: 19200

    Regards
    Einar
    Last edited by Einar; November 23, 2017, 12:06 PM.

    #2
    Solved

    This problem solved itself!? Well sort of.

    After giving up I disabled the Modbus plugin yesterday. Today I enbled it again planning to do some Wireshark snooping. Which does not seem necessary. Now it Works.

    It seems disable/enable is/might be necessary after configuration changes. But I can now change the register in config and it will poll the new register without a disable/enable sequence. So I can go on connecting my RTU servers to the RS485 port and Connect them.

    Comment


      #3
      Have same problem - I think -
      Running HS4 on a PI4 standard Linux install.

      Time FromType Message


      9/22/2020 20:35:57 Legacy-Plugin Modbus Error I'm not going to poll any remaining registers on this gateway as it seems there is a communication issue.
      9/22/2020 20:35:57 Legacy-Plugin Modbus Error Read error for Modbus Device
      9/22/2020 20:35:57 Legacy-Plugin Modbus Error Error in Read: Unable to read data from the transport connection: Operation on non-blocking socket would block.
      9/22/2020 20:35:57 Legacy-Plugin Modbus Error Error in ReadValue: Unable to read data from the transport connection: Operation on non-blocking socket would block.
      9/22/2020 20:35:53 Legacy-Plugin Modbus Start poll timer for gateeway [Modbus IP Gateway] every 300 seconds
      9/22/2020 20:35:53 Legacy-Plugin Modbus Warning Gateway [Modbus IP Gateway] status has changed to [Connected]
      9/22/2020 20:35:53 Legacy-Plugin Modbus Populating register database for gateway [Modbus IP Gateway]
      9/22/2020 20:35:53 Legacy-Plugin Modbus Initalising modbus master gateways
      9/22/2020 20:35:52 HomeSeer Plug-In Finished initializing plug-in Modbus
      9/22/2020 20:35:52 HomeSeer Starting Plug-In Modbus loaded in 1605 milliseconds
      9/22/2020 20:35:52 HomeSeer Starting Plug-In Plugin Modbus started successfully in 65 milliseconds
      9/22/2020 20:35:52 HomeSeer Starting Plug-In Initializing plugin Modbus ...

      Any idea?

      Comment

      Working...
      X