Comments (1)
Shorted from: https://github.com/coassoftwaresystems/delphi-modbus/blob/develop/source/IdModbusClient.pas#L207
case AModBusFunction of
mbfReadCoils,
mbfReadInputBits:
begin
BlockLength := ABlockLength;
{ Don't exceed max length }
if (BlockLength > 2000) then
BlockLength := 2000;
end;
mbfReadHoldingRegs,
mbfReadInputRegs:
begin
BlockLength := ABlockLength;
if (BlockLength > 125) then
BlockLength := 125; { Don't exceed max length }
end;
mbfWriteCoils:
begin
BlockLength := ABlockLength;
{ Don't exceed max length }
if (BlockLength > 1968) then
BlockLength := 1968;
end;
mbfWriteRegs:
begin
BlockLength := ABlockLength;
{ Don't exceed max length }
if (BlockLength > 120) then
BlockLength := 120;
end;
end;
https://en.wikipedia.org/wiki/Modbus
Function code 1 (read coils) and function code 2 (read discrete inputs)
Because the byte count returned in the reply message is only 8 bits wide and the protocol overhead is 5 bytes, a maximum of 2008 (251 x 8) discrete inputs or coils can be read at once.
Function code 4 (read input registers) and function code 3 (read holding registers)
Because the number of bytes for register values is 8-bit wide and maximum modbus message size is 256 bytes, only 125 registers for Modbus RTU and 123 registers for Modbus TCP can be read at once.
Can you provide your code or point to the source where the error should be?
from delphi-modbus.
Related Issues (20)
- ModBusMaster Demo reads values fine but gives an error when writing values
- ModBusClient - cycle read ? HOT 1
- Modbus client for service application HOT 1
- Runtime error 216 HOT 2
- XE11 Alexandria HOT 1
- TIdModBusServer: WriteRegisters gets triggered multiple times HOT 3
- The register number to be read is inconsistent with the PLC register number actually read HOT 2
- Read and write registers 4x HOT 1
- TIdModBusClient.Connect don`t work in manual mode
- Cannot read the Shark270
- Fix issues on poor network and poor Modbus controllers
- TIdModBusServer Connection Status public property
- How to check for errors
- ALGUEM AJUDAR INSTALAR XE7 HOT 1
- Problem install with Lazarus 2.2.6 HOT 1
- Need modbus private function support
- Support for Function Code 43 - Read Device Identification
- Can support Modbus RTU over TCP? HOT 3
- Support function 17 - Report Slave ID HOT 1
- License information needs to be added HOT 3
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 delphi-modbus.