Matlab#Simulink Siemens PLCSIMAdv S-Function

In this Tutorial I will show you how to use PLCSim Advance with Simulink. This is a configuration that  – Run the PLCSIM Advance in your PC and  Start-up the “S-Function ” that was provided from Siemens to Run the models. The in/output of the model is linked to this “S-Function”.


S-Function Download

Please access the following link to download the files.

https://support.industry.siemens.com/cs/document/109749187/digitalization-with-tia-portal%3A-virtual-commissioning-with-simatic-and-simulink?dti=0&lc=en-JP

You can find the documents and sample project by following this link..


What is PLCSIM ADV S-Function?

S-function “PLCSIM Advanced”  is made by C++ and allows the simulink to access the PLCSIM Advance instances that are running in your PC.You can run the .mex files and also integrate in your Simulink model.

Please be careful that Before you insert the PLCSIM Advance S-Function into your Simulink Model, It is better to run the PLCSIM Advance and download the TIA Project first.

If not, a PLCSIM Advance instance is auto created while your model is compiled.


Implementation

Open the source Code that downloaded from Siemens website and drop it into your Simulink model.

You can see the PLCSIM ADV icon if the S-Function is imported.

Let’s define 3 inputs and outputs tags and download the project to PLCSIM Advance.

Double Click the PLCSIM ADV icon in the Simulink.

Enter the Instance name of PLCSIM Advance that runs on your PC.

Good!3 Inputs and outputs are shown now.

Use Ctrl+D to compile your model, the tags that you created in the TIA project are shown in the compile log.

Let’s create some Flow and Change the Sine Wave Output Value(64 bit) to Single(32 bit) that matches the PLC tag.

You can see that the input tags are receiving the data from Simulink.

Let’s check the PLC Output also.

Done!

Footer_Basic

Please Support some devices for my blog

Amazon Gift List

Find ME

Twitter:@3threes2
Email:soup01threes*gmail.com (* to @)
YoutubeChannel:https://www.youtube.com/channel/UCQ3CHGAIXZAbeOC_9mjQiWQ

シェアする

  • このエントリーをはてなブックマークに追加

フォローする