3/9/2018 3:21 PM | |
Joined: 9/27/2006 Last visit: 3/27/2023 Posts: 11997 Rating:
|
Hello sajjad; Here are some documents found on the web that could probably give you some hints for your project. Having never done a conversion from Matlab to s7-SCL myself, I can only point to work done by others:
ftp://ftp.esat.kuleuven.be/pub/stadius/ida/reports/13-161.pdf The implementation on the PAC is straightforward. An existing C implementation of qpOASES and C code generated by the CVXGEN web tool has been used to implement the QP solvers. The C-code for the Hildreth solver is translated from an existing Matlab implementation based on work by [87]. The qpOASES and Hildreth implementation on the PLC are written from scratch in S7-SCL, based on the Matlab implementation
https://www.hindawi.com/journals/mpe/2012/912603/ There exists no compiler to transform the C/C++ source code to a running binary on a Siemens PLC. Therefore, the C/C++ code has to be translated into S7-SCL (STL). Although possible, this is a time consuming step. In this project, the qpOASES and hildreth solvers are translated to S7-SCL. The qpOASES solver is translated without the hotstarting possibilities and the general constraint handling code. Instead, only the part that handles bounds is translated. CVXGEN cannot generate STL code, and a manual translation of the generated code is impossible, hence; it is not used. To calculate the appropriate inputs of the system and solve the QP, following built-in function blocks (FBs) and organization blocks (OBs) are programmed..
http://files.matlabsite.com/docs/books/matlab-docs/simulink_plc_coder_plc_st_r2015a.pdf Simulink® PLC Coder™ generates hardware-independent IEC 61131-3 Structured Text from Simulink models, Stateflow® charts, and Embedded MATLAB® functions. The Structured Text is generated in PLCopen and other file formats supported by widely used integrated development environments (IDEs). As a result, you can compile and deploy your application to numerous programmable logic controller (PLC) and programmable automation controller (PAC) devices. Supported IDE Platforms :… • Siemens SIMATIC STEP 7 Version 5.4 or 5.5 The Simulink PLC Coder software assumes that English systems use English S7.It assumes that German systems use German S7... Hope this helps, Daniel Chartier |
This contribution was helpful to
3 thankful Users |
3/9/2018 5:01 PM | |
Joined: 8/15/2017 Last visit: 3/19/2023 Posts: 147 Rating:
|
Hello Daniel. Thank you for your help and guidance.Is possible to have your email? |
Follow us on