Modbus TCP/IP for Raspberry PI

I've been trying to build a Modbus TCP communication link between a Raspberry PI and my Victron CCGX system. As a result, Raspberry Pi should work as a Master in order to read data from the Victron system.
As such, I want to use Raspberry PI "Modbus TCP/IP Master Read" block in Simulink and automatically generate the code. It turns out that this block does not allow user to specify Unit_ID parameter of the Modbus TCP/IP protocol which is required by Victron devices.
Does anyone know if this parameter can be specified within the extarnal code of Modbus TCP/IP block in one of the Raspberry PI libraries? Is it possible to assign it according to my requirements?
Best Regards,
Bartosz

3 Comments

Hi Bartosz,
I am also facing a similar issue whereby there is no Unit_ID parameter specified in the Modbus TCP/IP blocks in Simulink. Have you been able to resolve your issue? I'd appreciate your assistance,
Best regards,
Akshay
Hi Akshay,
You can use Python Modbus libraries to specify this paramter on RAspberry Pi instead of using MATLAB Simulink blocks. You can later link your simulink model with the Python script running in the background, if needed.
Good luck,
Bartosz
Hi Bartosz,
THanks for the response. Would you mind sharing an example or resources?
Kind regards,
Akshay

Sign in to comment.

Answers (0)

Categories

Find more on MATLAB Support Package for Raspberry Pi Hardware in Help Center and File Exchange

Products

Release

R2021b

Asked:

on 22 Nov 2021

Commented:

on 2 Feb 2023

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!