Hello,
I’m building now a small MikroC program that reads (via I²C bus) data from an accelerometer --- this part is OK, works fine---, and I want to complete my program by allowing a PLC programmer to read those accelerometer data via Modbus RS-485.
My data (from accelero.) array is 7-bytes long, so I know I cannot use the standard MikroC RS-485 library.
**Would you have an example of MikroC code (or even MikroBasic) that could help me in this small application?
I suppose we have to build our array according to the Modbus protocol, but at this point, I’m quite confused (w/ CRC frame, etc.). Feel free for any help,
NOTA: I' using a Pic18F258. I already have a MAX485 driver. I certainly need to set a 485 address to this MCU, and by this address, I want the PLC user get access to the 7 data (ex: X-axis value, Y-axis-Value, Status byte …).
Thank you,
CaptDans
Modbus RS-485 - Example of code
Re: Modbus RS-485 - Example of code
Hi,
I would like to help you, but our support team is very busy trying to get to every single support request on forum, as well as on our support tickets.
I recommend you to read your chip's datasheet and see how to manage your issue and try writing the code by yourself.
Also, try searching throughout the forum topics, there may be a piece of code you are looking for.
Thank you for the understanding.
Regards,
Filip.
I would like to help you, but our support team is very busy trying to get to every single support request on forum, as well as on our support tickets.
I recommend you to read your chip's datasheet and see how to manage your issue and try writing the code by yourself.
Also, try searching throughout the forum topics, there may be a piece of code you are looking for.
Thank you for the understanding.
Regards,
Filip.
-
- Posts: 1
- Joined: 27 Feb 2014 19:23
Re: Modbus RS-485 - Example of code
Hello Captdans,
we wait you are doing well.
Please, would you send us your MikroC code for us to build a small MikroC program that reads (via I²C bus) data from the type of accelerometer that you are using ?
Many thanks for advance.
we wait you are doing well.
Please, would you send us your MikroC code for us to build a small MikroC program that reads (via I²C bus) data from the type of accelerometer that you are using ?
Many thanks for advance.
Re: Modbus RS-485 - Example of code
Any news??
My simulation cockpit and other projects: www.numca.gr
Re: Modbus RS-485 - Example of code
Visit libstock, there are a bunch of modbus implementations already, including my modbusSlave and modbusMaster implementations, which should give you a good headstart.
Kind Regards,
Sy
Sy
Re: Modbus RS-485 - Example of code
Thank you very much Sy, I will look into it immediately!Sy wrote:Visit libstock, there are a bunch of modbus implementations already, including my modbusSlave and modbusMaster implementations, which should give you a good headstart.
My simulation cockpit and other projects: www.numca.gr