MATLAB Answers

Getting code for PLC from MPC controler

4 views (last 30 days)
Simion Goljovic
Simion Goljovic on 31 May 2016
Answered: Bill Chou on 28 Apr 2020
Hi everyone. I'm kind of rookie here.
I developed and tuned MPC controler in Simulink for a given tf of my system and it works great. Now I have to implement that MPC controler in Siemens PLC S7 1200. I don't know how to get code that I can write in TIA Portal. How can I do it, can someone help me?

  0 Comments

Sign in to comment.

Answers (2)

Raphael Agner
Raphael Agner on 4 Dec 2019
As this is still getting some views:
You can deploy it using the Simulink PLC Coder.
Here is the general Workflow:

  0 Comments

Sign in to comment.


Bill Chou
Bill Chou on 28 Apr 2020
Yes, you can generate either structured text or C/C++ code from MPC controller. Here's an example that walks through the process:

  0 Comments

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!

Translated by