Coder Social home page Coder Social logo

Polling modbus TCP about modbus HOT 4 CLOSED

goburrow avatar goburrow commented on July 21, 2024
Polling modbus TCP

from modbus.

Comments (4)

mhemeryck avatar mhemeryck commented on July 21, 2024

From looking the code (e.g. https://github.com/goburrow/modbus/blob/606c02f4eef527a1d4cf7d8733d5fd7ba34f91d8/tcpclient.go), the connection only closes after a time-out of 60s, so I assume it's not really required to manage the TCP connection any other way for my purpose, right?

from modbus.

nguyenthenguyen avatar nguyenthenguyen commented on July 21, 2024

@mhemeryck You no need manage TCP connection. Connection closed when Close method called or after timeout when not have any activity by flag mb.lastActivity

from modbus.

mhemeryck avatar mhemeryck commented on July 21, 2024

Thanks for the quick feedback, this confirms what I found there 👍

That's actually nice, since it means I don't need to do any management on the TCP connection level. I would only need to make sure I would re-use the same client -- which I am already doing. I could perhaps find some speed-up in having multiple clients each doing their own polling (but then the server would need to be able to keep with that as well).

For the rest I guess I will need to do a more proper time profiling in my own package to see how I can further increase the reaction time.

from modbus.

mhemeryck avatar mhemeryck commented on July 21, 2024

Just noticed this ticket was still open; my question was pretty much answered by now.

For my setup, I did end up having each of my groups of coils to be polled have their own client instance. I still think it's probably not that "pretty", but as the client manages the connection itself, it makes sense I suppose.

from modbus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.