diff --git a/docs/img/QmodMaster.jpg b/docs/img/QmodMaster.jpg new file mode 100644 index 0000000..1e3eab4 Binary files /dev/null and b/docs/img/QmodMaster.jpg differ diff --git a/docs/modbus_tcp.md b/docs/modbus_tcp.md new file mode 100644 index 0000000..5fd2507 --- /dev/null +++ b/docs/modbus_tcp.md @@ -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. + diff --git a/project/Core/Src/modbus_tcp.c b/project/Core/Src/modbus_tcp.c index 3765cfd..fd06279 100644 --- a/project/Core/Src/modbus_tcp.c +++ b/project/Core/Src/modbus_tcp.c @@ -49,6 +49,7 @@ static err_t modbus_incoming_data(void* arg, struct tcp_pcb* pcb, struct pbuf* p char text[TEXT_LENGTH]; uint32_t result_background = 0xff000000; uint32_t text_foreground_color = 0xff000000; + LWIP_UNUSED_ARG(arg); // This is used to prevent a warning // Putting underscores in the whole array