Open TG9541 opened 2 years ago
Update: basic MODBUS client communication works (that's how #45 was found and fixed).
Hello, I am from China, how can I use eforth for transplantation? What do I need to prepare if I start studying? Thanks
Hello, I am from China, how can I use eforth for transplantation? What do I need to prepare if I start studying? Thanks
@niuyingxian I'm not sure if I understand what you mean (I guess that you use machine translation like many of my Chinese colleagues - maybe you should rephrase it?).
I have worked a bit on the MODBUS client - if that's what you want to do I can share my (incomplete) source code!
You can use the code here in any way you like. You can start with downloading a binary from the Releases. A binary for the 4-Relay-Board is in stm8ef-bin.zip (/out/C0135/C0135-forth.ihx). You need to flash it to the board with an STM8 programmer.
If you want to build you own binary you need a Linux system (e.g., a Raspberry-Pi, Windows WSL...).
A review showed that implementing a very basic "MODBUS Client" based on UARTISR. The use case is application programming oriented and is thus very similar to writing application oriented MODBUS Servers (e.g., as described in the like in the
README.md
and sketched in the test folder).The software architecture shall re-use the hardware layers and add just the minimum necessary for sending FC requests to a MODBUS server and receive and error-check the response. The application is responsible for implementing the required MODBUS Client FC encoders and decoders. An example application implementing reading and writing "Holding Registers" shall be provided.
The Architecture shall be as follows:
clientapp.fs
or{BOARD}/board.fs
clientfc.fs
CLPROTO
UARTISR
BUSCTRL