working in biotech industry from Germany, now living in Oakland, California followup to previous talks about automation, PLCs (check out all my previous talks here: https://jonasneubert.com/talks) Current Local Time: 12:55 AM why this talk
Asked Questions https: // jonasneubert.com / pyconindia2020 @jonemo / [email protected] Q: What was THE acronym “PLC” for again? A: Programmable Logic Controller slides: contact: intro: part 1: part 2:
PLC - My PLC has IP address 192.168.1.9 - My laptop is configured with IP 192.168.1.8 and subnet mask 255.255.255.0 - Connected via Ethernet through a Netgear switch
vendor software for this) I have already programmed my PLC to blink the traffic light. The programming software was a free download from the vendor’s website.
umodbus micropython-modbus ctmodbus License BSD LGPL MIT Apache 2.0 MPL 2.0 GPL GPL Latest Release Sep 2020 May 2020 Oct 2018 Aug 2019 Feb 2020 — Aug 2020 ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ TCP Serial Oldest and most popular, sparse docs Similar to pymodbus, sparse docs TCP only, simple API RTU & ASCII master only, detailed docs protocol only, Flask-like server API MicroPython port of modbus-tk security-focused REPL for pymodbus ✓ ✓ ✓ ✓ ✓ ✓ ✓ master ✓ ✓ ◑ ✓ ✓ ✓ slave Stars 1.1k 287 104 143 110 — 26 This is the one I will used in the example
Control Loops of “IIoT” Field Devices PLC Logic Python Code “Inner Loop” “Outer Loop” milliseconds per iteration interfaces to the physical world timing critical & safety critical logic release process might be regulated minutes to months per iteration interfaces to databases and APIs optimization & customization regular software release cycle
Control Loops of “IIoT” Field Devices PLC Logic Python Code “Inner Loop” “Outer Loop” milliseconds per iteration interfaces to the physical world timing critical & safety critical logic release process might be regulated minutes to months per iteration interfaces to databases and APIs optimization & customization regular software release cycle
was the first protocol developed for this purpose, and there are many others: Ethernet/IP, OPC-UA, ProfiNET, Profibus, DeviceNET, EtherCAT, ADS, DirectNet, BACnet, ... see also: “List of Automation Protocols“ on Wikipedia https://en.wikipedia.org/wiki/List_of_automation_protocols
Many problems encountered when working with PLCs are actually networking/connection problems: - Know the basics of networking: IP addresses, ports, subnet masks, etc - Firewalls and other security software - Your PLC might not be on the network at all!
slave using pymodbus - PLC Fiddle, (plcfiddle.com, free) web based playground for ladder logic - Free/trial version of a vendor software with simulator: CODESYS, Twincat, Rockwell CCW, Automation Direct DoMore - CODESYS for RaspberryPi (codesys.com, €50) Cross-platform IEC 61131-3 editor and runtime. The editor is free, the RaspberryPi runtime is €50. - OpenPLC (openplcproject.com, free) A IEC-61131-3 editor (written in Python) and runtime for various targets, including RaspberryPi. List of free software and training resources: https://www.reddit.com/r/PLC/comments/ehu2u3/read_first_how_to_learn_plcs_and_get_into_the/
asking for help, always include this info: - Brand and model of PLC - PLC Programming Software - Communication protocol - Python code snippet A sketch and/or photo of your setup really helps! * This advice probably works with asking advice from anyone. Of course, you are welcome to contact me with questions about this talk! However, for most PLC questions (and most Python questions) I am far from an expert. Make sure to check the documentation and training materials from your PLC maker first, and also check out PLC related online forums like reddit.com/r/PLC, mrplc.com, plctalk.net.