LiZF
Hi,

 I need to connect the OpenPLC to Matlab Simulink. 
 How to operate between the virtual programmable logic controller devices and the Simulink model.
 Thank you!
Reply 0 0
thiagoralves
The program that made the connection between OpenPLC and Simulink was patented by my University, so I'm not allowed to distribute it anymore. The Simulink driver basically sends TCP messages to an intermediate program that did the link with Simulink. You can try to recreate this program by looking at the messages that OpenPLC Simulink driver sends. On the Simulink side, you can receive the messages from the intermediate program over TCP or UDP, but I think UDP works best due to the lower overhead.
Reply 1 0
thiagoralves
Edit: The University finally allowed me to publish the software. It is available here:  https://github.com/thiagoralves/OpenPLC_Simulink-Interface
Reply 0 0
rodrigo_rolle
Edit: The University finally allowed me to publish the software. It is available here:  https://github.com/thiagoralves/OpenPLC_Simulink-Interface


This is SUPER great news! Simlink is a very useful tool for integrating OpenPLC to simulation platforms. I've been using it successfully for a while, got excellent results not only with Simulink but also Labview and custom programs... Very good!
Reply 0 0
ranjini
Hi,
I am fairly new to Simulink. When I tried to open the model, I got an error stating "hello_world.slx does not contain a valid Simulink model in SLX format." I tried this on version Version 9.0 (R2017b) and
Version 10.1 (R2020a). Also, when I wasn't able to compile .cpp file. Please see the attached files. What am I missing?

Thank you,
Reply 0 0
thiagoralves
Bad download. I’m pretty sure it is having issues with line endings. Did you download it on Windows and are you trying to open it on Linux?
Reply 0 0
ranjini
I downloaded the Simulink model in Windows; but the .cpp in Linux.
Thank you.
Reply 0 0
ranjini
Hi Thiago,
I finally was able to get it to work. Thank you for creating this.

Have a great weekend.
Reply 0 0
Reply