Skip to content

Commit 49758fa

Browse files
authored
di is for discrete input (#2842)
1 parent fc6da3a commit 49758fa

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

examples/server_datamodel.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
def define_datamodel():
1717
"""Define register groups.
1818
19-
Coils and direct inputs are modeled as bits representing a relay in the device.
20-
There are no real difference between coils and direct inputs, but historically
21-
they have been divided. Please be aware the coils and direct inputs are addressed differently
19+
Coils and discrete inputs are modeled as bits representing a relay in the device.
20+
There are no real difference between coils and discrete inputs, but historically
21+
they have been divided. Please be aware the coils and discrete inputs are addressed differently
2222
in shared vs non-shared models.
2323
- In a non-shared model the address is the bit directly.
2424
It can be thought of as if 1 register == 1 bit.
@@ -38,9 +38,9 @@ def define_datamodel():
3838
address=5, values=17, count=10, datatype=DataType.REGISTERS
3939
)
4040

41-
# Define a group of coils/direct inputs non-shared (address=15..31 each 1 bit)
41+
# Define a group of coils/discrete inputs non-shared (address=15..31 each 1 bit)
4242
#block1 = SimData(address=15, count=16, values=True, datatype=DataType.BITS)
43-
# Define a group of coils/direct inputs shared (address=15..31 each 16 bit)
43+
# Define a group of coils/discrete inputs shared (address=15..31 each 16 bit)
4444
#block2 = SimData(address=15, count=16, values=0xFFFF, datatype=DataType.BITS)
4545

4646
# Define a group of holding/input registers (remark NO difference between shared and non-shared)
@@ -62,7 +62,7 @@ def define_datamodel():
6262
SimDevice(id=1, type_check=False, registers=[block_def, block5])
6363
#SimDevice(2, False,
6464
# block_coil=[block1],
65-
# block_direct=[block1],
65+
# block_discrete=[block1],
6666
# block_holding=[block2],
6767
# block_input=[block3, block4])
6868
# Remark: it is legal to reuse SimData, the object is only used for configuration,

pymodbus/simulator/simdevice.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class SimDevice:
2222
support these devices, define 1 large block consisting of the
2323
4 blocks and use the offset_*= parameters.
2424
25-
When using distinct blocks, coils and direct inputs are addressed differently,
25+
When using distinct blocks, coils and discrete inputs are addressed differently,
2626
each register represent 1 coil/relay.
2727
2828
**Device with shared registers**::
@@ -39,7 +39,7 @@ class SimDevice:
3939
registers=[SimData(...)],
4040
non_shared_mode=True,
4141
offset_coil=0,
42-
offset_direct=10,
42+
offset_discrete=10,
4343
offset_holding=20,
4444
offset_input=30,
4545
)
@@ -71,7 +71,7 @@ class SimDevice:
7171

7272
#: Define starting address for each of the 4 blocks.
7373
#:
74-
#: .. tip:: Content (coil, direct, holding, input) in growing order.
74+
#: .. tip:: Content (coil, discrete, holding, input) in growing order.
7575
offset_address: tuple[int, int, int, int] | None = None
7676

7777
#: Enforce type checking, if True access are controlled to be conform with datatypes.

0 commit comments

Comments
 (0)