|
|
@ -1,32 +1,3 @@
|
|
|
|
# Install
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
|
|
|
python -m pip install pipenv
|
|
|
|
|
|
|
|
pipenv update
|
|
|
|
|
|
|
|
pipenv shell
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Run
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Within pipenv, run in two terminals:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
|
|
|
./start_server.sh
|
|
|
|
|
|
|
|
./start_client.sh
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Example commands
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Within client run:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
client.read_coils slave=1 address=0
|
|
|
|
|
|
|
|
client.write_coil slave=1 address=0 value=1
|
|
|
|
|
|
|
|
client.read_coils slave=1 address=0
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
See the first boolean was false in the first read, was written to true, and appears at true in second read.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Client commands :
|
|
|
|
# Client commands :
|
|
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
```
|
|
|
@ -45,3 +16,4 @@ client.write_registers address=0 values=845,123,0,427,4 slave=1
|
|
|
|
client.read_holding_registers address=0 count=1 slave=1
|
|
|
|
client.read_holding_registers address=0 count=1 slave=1
|
|
|
|
client.read_holding_registers address=0 count=100 slave=1
|
|
|
|
client.read_holding_registers address=0 count=100 slave=1
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|