From 77402a29105f7015d6964a70d8941e02df00945b Mon Sep 17 00:00:00 2001
From: Stefan 'hr' Berder
Date: Thu, 16 Apr 2020 13:56:51 +0800
Subject: [PATCH] README: fix function_codes for example tcp server
the function codes used in `write_data_store` are to write registers but
the example code for server/client deals with coils everywhere else. The
example scripts are correct but the README got it wrong.
---
README.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.rst b/README.rst
index 01ae9e5..4c39b45 100644
--- a/README.rst
+++ b/README.rst
@@ -60,7 +60,7 @@ Creating a Modbus TCP server is easy:
return data_store[address]
- @app.route(slave_ids=[1], function_codes=[6, 16], addresses=list(range(0, 10)))
+ @app.route(slave_ids=[1], function_codes=[5, 15], addresses=list(range(0, 10)))
def write_data_store(slave_id, function_code, address, value):
"""" Set value for address. """
data_store[address] = value