Comments (10)
Please read the documentation, that call will not return until the server terminates.
from pymodbus.
Hi yes, I have updated my code to this, but how can I get the actual ModbusTCPServer object in my "server" variable, this currently returns a coroutine object:
async def run_servr(port):
try:
print(f"Starting server for device...")
store = ModbusSlaveContext(
di=ModbusSequentialDataBlock.create(),
co=ModbusSequentialDataBlock.create(),
hr=ModbusSequentialDataBlock.create(),
ir=ModbusSequentialDataBlock.create())
context = ModbusServerContext(slaves=store, single=True)
server = StartAsyncTcpServer(context, address=("127.0.0.1", port))
print(f"Server for device {udt['name']} is online")
while server.isServing():
...
from pymodbus.
But the call still do not return until the server terminates! Did you read the documentation, there is a part about how to use the API without the blocking start call.
from pymodbus.
please read the documentation, that helps to understand how the library works, you are calling a blocking function.
from pymodbus.
I tried to look in the documentation, but couldn't find much. Could you point me in the right direction?
from pymodbus.
please read the documentation, that helps to understand how the library works, you are calling a blocking function.
Can you point in the right direction? Also, just for more insight into what I am trying to accomplish. I want to be able to start an async server, stop the server, and update the server with 3 different functions asynchronously.
from pymodbus.
there are several ways to do that, Start* is one way but it needs to run in a separate task.
I already pointed you at our documentation, where it is explained, did you look ?
from pymodbus.
We also provide examples showing different ways to use the server objects.
from pymodbus.
I don't see where you pointed to your documentation. There is no link or anything in any of your responses. Am I looking in the wrong place?
from pymodbus.
I did not, you can find the links to the source, documentation etc in the package info.
from pymodbus.
Related Issues (20)
- Retrieve server timestamp HOT 4
- Build Proper Payload and write into register using Pymodbus HOT 10
- TCP client frame mismatch under heavy load HOT 3
- Can add back kwarg 'reset_socket' to disable closing sockets on error HOT 4
- ModbusProtocol throws AttributeError : 'Serial' object has no attribute 'startswith' HOT 3
- incorrect register reading HOT 5
- Plans for 3.6.8 to be packaged in Debian / Ubuntu HOT 1
- ssl.SSLWantReadError: The operation did not complete (read) when using ModbusTlsClient HOT 19
- Server not returning data expected in data block HOT 7
- consider changing the github default landing branch to "master" ? HOT 3
- Intermittent Incomplete Modbus Messages When Polling a Slave Device HOT 34
- target machine actively refused connection HOT 13
- FramerType module not available with pymodbus 3.6.8. HOT 4
- TLS implementation seems broken? HOT 9
- Use pyserial RS485 - not serial_from_url HOT 3
- Serial Communication Drops After Few Messages on Ubuntu HOT 2
- How to get tag name with address HOT 2
- 2 ip address for 1 server HOT 2
- Register data missing HOT 1
- Bug when converting pymodbus.DATATYPE.FLOAT32 to float HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pymodbus.