Merge pull request #30 from Sani7/Modbus_TCP_Obe

Modbus tcp obe
This commit is contained in:
2023-12-05 21:42:58 +01:00
3 changed files with 34 additions and 0 deletions

BIN
docs/img/QmodMaster.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB

33
docs/modbus_tcp.md Normal file
View File

@@ -0,0 +1,33 @@
# Modbus-TCP
This is the documentation of the Modbus-TCP task
## Table of contents
- [Table of contents](#table-of-contents)
- [Initialization](#initialization)
- [Usage](#usage)
- [Guide](#Guide)
- [Extra](#Extra)
## Initialization
The Modbus task is initialized in the main function.
```c
// Initialize Modbus task
modbus_init();
```
## Usage
![QmodMaster.exe](./img/QmodMaster.jpg)
## Guide
- Set qmodmaster to tcp mode
- Set IP of device
- Set the device in multiple register mode
- Connect with the board
- Fill in the data as in the example
- Send the data
## Extra
The start addres is ignored and the timeout warnings arne normal because there is no response from my code back to QModMaster.

View File

@@ -49,6 +49,7 @@ static err_t modbus_incoming_data(void* arg, struct tcp_pcb* pcb, struct pbuf* p
char text[TEXT_LENGTH]; char text[TEXT_LENGTH];
uint32_t result_background = 0xff000000; uint32_t result_background = 0xff000000;
uint32_t text_foreground_color = 0xff000000; uint32_t text_foreground_color = 0xff000000;
LWIP_UNUSED_ARG(arg); // This is used to prevent a warning LWIP_UNUSED_ARG(arg); // This is used to prevent a warning
// Putting underscores in the whole array // Putting underscores in the whole array