Drilling Systems Modeling & Automation, Part 7: PLC Code Generation
The control of the drilling machinery, consisting of drawworks, mud pumps and top drive requires a very short response time. The control algorithms are therefore implemented in PLCs, providing a response time in the range of milliseconds. However, manually translating our validated control strategy to PLC code is an arduous task because this must be rewritten in a new language and must reflect the PLC architecture.
Hence, we use automatic code generation which is an integral part of Model-Based Design. This helps eliminate errors associated with traditional hand coding and reduces overall development and validation time. Simulink PLC Coder generates source code in structured text format from the Simulink model and Stateflow chart. In this case, we generate a Structured Text and Ladder Diagram in a format that is compatible with Rockwell Automation’s Studio 5000. Bidirectional links enable us to navigate and trace between Simulink model components and the generated code. Finally, we use Studio 5000 Logix Designer® as an IDE to compile the code and run it on the PLC.
Additional Resources:
- MATLAB for the Oil and Gas Industry: https://bit.ly/2FZqYXh
- Simulator codes on File Exchange: https://bit.ly/31uCQZO
- Simulator codes on GitHub: https://github.com/jonlesage/Drawwork...
Join us on Facebook Group:
https://www.facebook.com/groups/matlabcodes
No comments