Impact-Site-Verification: dbe48ff9-4514-40fe-8cc0-70131430799e

Search This Blog

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: - Simulator codes on File Exchange: - Simulator codes on GitHub:

Join us on Telegram:

No comments

Popular Posts