Skip to content

Commit

Permalink
Minor documentatio fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rossmann-engineering committed Jan 1, 2023
1 parent 117e410 commit da3db89
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2016-2020 Stefan Roßmann
Copyright (c) 2016-2022 Stefan Roßmann

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pip install EasyModbus

### Requirements:

Python 3.7
>Python 3.8
pyserial (only for Modbus RTU)

Expand Down Expand Up @@ -211,7 +211,7 @@ Connects to a Modbus-TCP Server or a Modbus-RTU Slave with the given Parameters

Closes Serial port, or TCP-Socket connection

**def read_discreteinputs(self, starting_address, quantity)**
**def read_discrete_inputs(self, starting_address, quantity)**

Read Discrete Inputs from Server device (Function code 2)
starting_address: First discrete input to read
Expand All @@ -225,14 +225,14 @@ starting_address: First coil to read
quantity: Number of coils to read
returns: List of bool values [0..quantity-1] which contains the coils

**def read_holdingregisters(self, starting_address, quantity)**
**def read_holding_registers(self, starting_address, quantity)**

Read Holding Registers from Server device (Function code 3)
starting_address: First Holding Register to read
quantity: Number of Holding Registers to read
returns: List of int values [0..quantity-1] which contains the registers

**def read_inputregisters(self, starting_address, quantity)**
**def read_input_registers(self, starting_address, quantity)**

Read Input Registers from Server device (Function code 4)
starting_address: First Input Register to read
Expand Down Expand Up @@ -263,6 +263,18 @@ Write multiple Holding Registers to Server device (Function code 16)
starting_address: First Holding Register to write
value: List of int values to write

**def read_discreteinputs(self, starting_address, quantity)**

deprecated - Use "read_discrete_inputs" instead

**def read_holdingregisters(self, starting_address, quantity)**

deprecated - Use "read_holding_registers" instead

**def read_inputregisters(self, starting_address, quantity)**

deprecated - Use "read_input_registers" instead

<div id="properties"/>

#### 5.2 Properties
Expand Down
3 changes: 2 additions & 1 deletion easymodbus/modbusClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import struct
import threading
import logging
from datetime import time
from logging.handlers import RotatingFileHandler
import math
from modbus_protocol import *
Expand Down Expand Up @@ -305,7 +306,7 @@ def execute_read_order(self, starting_address, quantity=0, function_code: Functi
self.__receivedata = bytearray()
try:
while len(self.__receivedata) == 0:
pass
time.sleep(0.001)
except Exception:
raise Exception('Read Timeout')
self.__adu.decode(ModbusType.TCP, bytearray(self.__receivedata))
Expand Down

0 comments on commit da3db89

Please sign in to comment.