Simulink® with PLCnext Technology

Use Case

If you already use Simulink® for modelling, you might be eager to run these models on a PLCnext Control, monitor the values online, modify block parameters, and even operate your models together with other programs created in IEC 61131‑3 or high-level languages like C++.

And of course you can do that!

From day 1 of PLCnext Technology, there is an add-on for the PLCnext Engineer and provides the Simulink® target for a range of Phoenix Contact controllers, including members of the PLCnext Control family. 

Concept

Simulink® is a software program for the graphical, model-based development of dynamic systems, developed by The MathWorks, Inc.  This company is already famous for MATLAB® which provides a text-based simulation environment containing thousands of algorithms that you can also use with Simulink®.

Models converted from Simulink® into code can be integrated into the PLCnext Engineer development environment using the PLCnext Target for Simulink (former PC Worx Target for Simulink) software add-on by Phoenix Contact.

This enables the conversion of Simulink® models into device-specific code for use with Remote Field Controllers, e. g. RFC 4072S, and Axioline F controllers, e.g. AXC F 2152.

The model-based design and versatile simulation possibilities of Simulink® can therefore also be used for automation projects within PLCnext Technology. A structured model implementation can be ensured, thanks to the automatic creation of executable code. The import and configuration options in PLCnext Engineer also enable Simulink® models to be operated together with programs that have been created in IEC 61131‑3 languages or C++.

The combination with other high-level-language programs in the same task and execution in the real-time context is therefore also possible for Simulink® models. Furthermore, you can also implement monitoring of model parameters, and optimization of the models during execution via the External Mode.

How to

As a regular user of Simulink®, you know how to set up a model.Package shot of PC Worx Target for Simulink
But how can you apply the hard work put in there to run on your PLCnext Control?

  • Download and install PLCnext Engineer if not done already (newbies: see Quick Start Guide)
  • Download and install PLCnext Target for Simulink (see manual
  • Create a Simulink® model and export it as a PLCnext Engineer library
  • Import the library into PLCnext Engineer
  • Execute the model on your PLCnext Control
  • and optionally:
    • Configure the model for use in External Mode in Simulink®
    • Set up a split view with Simulink® and PLCnext Engineer
    • Monitor the online values via a scope
    • Modify block parameters online

 


• Published/reviewed: 2024-09-24   ☀  Revision 073 •