Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a minimal MODBUS-RTU Client #44

Open
TG9541 opened this issue Jun 27, 2022 · 3 comments
Open

Implement a minimal MODBUS-RTU Client #44

TG9541 opened this issue Jun 27, 2022 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@TG9541
Copy link
Owner

TG9541 commented Jun 27, 2022

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:

Layer Source file Description
6 clientapp.fs or {BOARD}/board.fs configuration and application layer
5 clientfc.fs MODBUS Client FC encoders and decoders
4 CLPROTO MODBUS Client protocol base
3 UARTISR buffered UART communication
2 BUSCTRL bus access (i.e. RS485 direction control)
1 STM8 eForth lightweight interactive multi-tasking OS
@TG9541
Copy link
Owner Author

TG9541 commented Jul 3, 2022

Update: basic MODBUS client communication works (that's how #45 was found and fixed).

TG9541 added a commit that referenced this issue Jul 9, 2022
#44 refactor for MODBUS-RTU client features
@niuyingxian
Copy link

Hello, I am from China, how can I use eforth for transplantation? What do I need to prepare if I start studying? Thanks

@TG9541
Copy link
Owner Author

TG9541 commented Nov 11, 2023

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...).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants