Case study 03
Industrial Automation and Communication
Selected laboratory work from TPK4128 at NTNU, showing a progression from Linux and C programming to PLC control, device communication and industrial middleware.
- Discipline
- INDUSTRIAL AUTOMATION / PLC / INDUSTRIAL COMMUNICATION
- Course
- TPK4128 — Industrial Mechatronics
- Project type
- academic
- Period
- Spring 2026
- Evidence
- Source code + PLC evidence
- My role
- Individual laboratory work in industrial mechatronics
Computing & networking foundations
Development environment, low-level programming and communication between computers.
- 01
Linux & C
UTM, Ubuntu and GCC
- 02
Systems programming
Processes, threads, mutexes and memory
- 03
TCP/IP sockets
Client/server communication with Raspberry Pi
PLC control
Machine behaviour expressed through discrete logic and sequential control.
- 01
Ladder Diagram
Inputs, contacts, coils and Boolean control
- 02
Sequential Function Chart
Steps, transitions, timers and production sequences
Industrial connectivity & middleware
Higher-level access, telemetry and modular communication around automated equipment.
- 01
OPC UA
Browsing, methods, subscriptions and logging
- 02
MQTT
Publishing and subscribing to sensor data
- 03
ROS2
Nodes, topics, services and actions
01 / Engineering challenge
How the coursework was structured
The course used separate laboratory assignments to build an industrial-mechatronics foundation step by step. Linux and C established the development environment, TCP/IP connected computers, PLC languages described machine behaviour, and OPC UA, MQTT and ROS2 introduced higher-level communication patterns.
02 / My responsibility
What I personally worked on
Completed laboratory assignments across Linux and C, TCP/IP sockets, Ladder Diagram, SFC, OPC UA, MQTT and ROS2. I later organised the relevant material into a focused repository, retaining original PLC evidence and clearly identifying code reconstructed from my submission records.
Engineering focus
- — PLC logic using Ladder Diagram and SFC
- — TCP/IP communication with Raspberry Pi
- — OPC UA browsing, control and subscriptions
- — MQTT publish/subscribe messaging
- — ROS2 topics, services and actions
Tools and methods
03 / Design and implementation
From concept to working system
- 01
Set up Ubuntu in UTM on macOS and use the Linux terminal, GCC and C for exercises involving processes, threads, mutexes, pointers and memory handling.
- 02
Implement and test TCP/IP socket communication locally and between an Ubuntu virtual machine and a Raspberry Pi.
- 03
Develop Ladder Diagram and Sequential Function Chart logic for conveyors, milling, drilling and transfer mechanisms in a small production-line model.
- 04
Use Python OPC UA clients for connection testing, node browsing, method calls, sensor subscriptions and timestamped CSV logging.
- 05
Publish DS18B20 temperature data from a Raspberry Pi through MQTT and receive the stream with a separate subscriber.
- 06
Explore ROS2 nodes, topics, services, actions, launch files and graph visualisation using course laboratory systems.
04 / Testing and outcome
What the work demonstrated
The work demonstrates practical familiarity with the software and communication layers commonly found around automated equipment: Linux-based development, C systems programming, PLC control languages, network sockets, structured industrial data, publish/subscribe messaging and modular ROS2 communication.
05 / Next iteration
How I would develop it further
- 1Connect selected PLC and communication components in a small integrated demonstrator without presenting the original laboratories as one deployed system
- 2Add repeatable measurements of communication latency, message loss and recovery from connection failures