Free RTOS+TCP/IP modbus and FTP

Hello,i want to use free RTOS TCP for TCP/IP modbus as well as FTP.how can i do it?

Do you have a modbus library in mind?
FTP server or FTP client?

Yes I have modbus library. I want to use FTP server for file transfer and tcpip modbus for machine data transfer

What platform will you be using?

You will find all necessary software in these directories:

FreeRTOS-Kernel
FreeRTOS-Plus-TCP
FreeRTOS-Plus-FAT
FTP-server

You can find an example project that uses an FTP server here.

If you have any questions, feel free to ask them here.

I already using FTP server using free RTOS + TCP +FAT.my ftp server working ok.means my FTP protocol working.now i want also modbus protocol for data xfer.i have modbus master and slave library.now i think I have to change in freeRTOS_TCP_Server.c file.bcoz in this file it’s checking for server. It’s HTTP or FTP.so i m confuse where I change in tcp server code for modbus implementation.

I think I have to one more server details in it for modbus

The files that you are showing all have to do with the FTP and HTTP servers.

For programming a modbus, you will only need either TCP or UDP, depending on the protocol used.
But you wrote that you have a library for the modbus? Do you need help to connect that with FreeRTOS+TCP ?
What are the constraint of the modbus in terms of response times, packets per second?

Yes u r right for modbus i need only tcp.means i created one common TCP server.for that server i create ftp.now i want to add one more modbus.we normally use FreeRTOS_CreateTCPServer() and FreeRTOS_TCPServerWork().these both functions are common for http and FTP.now can I add one more modbus.

we normally use FreeRTOS_CreateTCPServer() and FreeRTOS_TCPServerWork(). these both functions are common for http and FTP.

That is correct, it is the common part of the HTTP/FTP servers. Have you already teste the FTP server?
PS. in the for(;;) loop, you do not need to call vTaskDelay(), because FreeRTOS_TCPServerWork() will block on receiving a message:

FreeRTOS_TCPServerWork( &( xServer ), pdMS_TO_TICKS( 10U ) );

The function here above will block for at most 10 msec.

now can I add one more modbus.

Yes you can add it now. Note that the modbus will call the TCP/UDP API’s directly, it would be hard to integrate it with mentioned TCPServer.

Do you have any public description of the modbus that you will use?
Can you tell what platform you will be using?

1 Like

Thanks.



.i m happy i tried with this and it works.my modbus protocol working successfully.