- Jun 6, 2020
- 11,559
- 4,422
Hello everyone,
Given the difficulties in finding a "ready-made" library for Modbus TCP communication.
I have decided to create a library, adapted for my needs, i decide to publish because maybe useful to someone, maybe someone want to improve on it in this forum.
I attach the library, the library project and a test project.
The available functions:
How it works:
From code you create Query to indicate the function you want to execute cyclically.
Before recording it in a list, it analyses the "Count" parameter (this is because I have noticed that I can request data up to a maximum of 125)
Adapts the query and eventually creates as many queries as necessary to satisfy the initial request.
The list of "Queries" proceed cyclically and it advances only if the server responds to that Query
(My idea was: "No need to continue, if...
Given the difficulties in finding a "ready-made" library for Modbus TCP communication.
I have decided to create a library, adapted for my needs, i decide to publish because maybe useful to someone, maybe someone want to improve on it in this forum.
I attach the library, the library project and a test project.
The available functions:
- FC01 - Read Coil
- FC03 - Read Holding
- FC05 - Write Single Coil
- FC06 - Write Single Holding
- FC16 - Write Multiple Holding
How it works:
From code you create Query to indicate the function you want to execute cyclically.
Before recording it in a list, it analyses the "Count" parameter (this is because I have noticed that I can request data up to a maximum of 125)
Adapts the query and eventually creates as many queries as necessary to satisfy the initial request.
The list of "Queries" proceed cyclically and it advances only if the server responds to that Query
(My idea was: "No need to continue, if...
برای دیدن لینک ها باید ثبت نام کنید
برای دیدن لینک ها باید ثبت نام کنید