Tutorial: CoDeSys OPC-UA Server & Python for PLC Data

Pubblicato il: 22 maggio 2025
sul canale di: MN Automation Academy
2,121
36

Unlock the power of OPC-UA to connect your CoDeSys PLC projects with Python! In this comprehensive, beginner-friendly tutorial, we walk you through setting up an OPC-UA server in CoDeSys V3 (using Simulation Mode and a SoftMotion virtual axis) and then creating Python scripts to read and visualize PLC data.

Perfect for students, hobbyists, and engineers looking to explore industrial communication and data handling without needing physical hardware.

🔗 *GitHub Repository (CoDeSys Projects & Python Scripts):*
[https://github.com/mn-automation-acad...

🔧 *Tools & Links Mentioned:*
CoDeSys Development System: [https://store.codesys.com/codesys.html](https://store.codesys.com/codesys.html)
Python: [https://www.python.org/](https://www.python.org/)
UaExpert OPC UA Client: [https://www.unified-automation.com/do...](https://www.unified-automation.com/do...)
Python `asyncua` library (we use `opcua.sync`): [https://github.com/FreeOpcUa/python-o...](https://github.com/FreeOpcUa/python-o...)
Matplotlib: [https://matplotlib.org/](https://matplotlib.org/)

In this tutorial, you'll learn:
✅ How to configure CoDeSys as an OPC UA Server.
✅ How to define symbols for OPC UA exposure.
✅ How to use UaExpert to browse and test your OPC UA server.
✅ How to install and use the `opcua.sync` Python library (from `asyncua`).
✅ How to connect to an OPC UA server from Python.
✅ How to read single and multiple PLC variables (NodeIDs).
✅ How to use Matplotlib to plot data collected from your PLC.

This tutorial focuses on using the synchronous wrapper of `asyncua` to keep the Python code straightforward and avoid async/await for simplicity.

If you found this video helpful, please:
👍 LIKE the video
🔔 SUBSCRIBE for more tutorials
💬 COMMENT with your questions or suggestions!

Thanks for watching!

#CoDeSys #Python #OPCUA #PLC #Tutorial #Automation

// -- My PLC Programming Courses --
Master CoDeSys & Structured Text:
➡️ PLC Programming - Learn the Basics with CoDeSys: https://www.udemy.com/course/plc-prog...
// -- Connect --
🔹 Subscribe for more PLC tips:    / @mnautomationacademy  
🔹 Check out my our website: https://www.mnautomationacademy.com
🔹 Connect on our LinkedIn page:   / mn-automation-academy  
#PLCProgramming #CoDeSys #StructuredText #CaseStatement #ControlFlow #PLCTips #Automation #IndustrialAutomation #PLCTraining #IEC61131 #StateMachines #ProgrammingBestPractices


In questa pagina del sito puoi guardare il video online Tutorial: CoDeSys OPC-UA Server & Python for PLC Data della durata di ore minuti seconda in buona qualità , che l'utente ha caricato MN Automation Academy 22 maggio 2025, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 2,121 volte e gli è piaciuto 36 spettatori. Buona visione!