Hello, my name is Jarek Jaryszew. I'm a head of an embedded department at Liki. We work mostly with the Internet of Things and industrial applications. Today I will tell you how do we develop in Python and QT to build an industrial application, which does measurements and integrates many different systems for many vendors.
Transcription
Q: What was the project about?
A customer was looking to build a measurement station, used for quality control of produced details. They provided all the hardware but they needed a system to integrate a few different devices, collect, process and store measurement data.
Q: What devices were you integrating with?
First the Mitsubishi industrial robot. We had to implement a client library for the protocol directly on sockets.
Second was linear gauge sensors from a Japanese company called Mitutoyo. This was much simpler and was based on serial port communication.
And the last one - our customer needed also an array of temperature sensors so they could run compensation calculations. We recommended Modbus sensors based on a popular SHT20 integrated circuit.
Q: What technology stack did you use?
This was supposed to be a desktop application with access to a database. The budget was also a consideration so I have picked Python with Qt Framework. Also, we have used SQLAlchemy and pandas to process all the data management.
Q: Was Python’s performance an issue?
Python's performance turned out to be a non-issue. We did tests with table views containing really large datasets by which I mean a few thousand records and the desktop app did not even choke.
Q: But Python in Industry? isn’t it a .NET area?
Python is a much more popular technology than .NET for many years now. It is a language chosen by organizations like CERN or NASA. It is the most popular language for embedded Linux platforms like Raspberry Pi and has libraries to connect to anything. And if it does not have, it is easy to bind a native library written in C, C++ or Rust.
Q: Is it true that developing in Python is quick?
The development speed is amazing. There are some things that you can only do in dynamic languages and together with amazing frameworks like QT and SQLAlchemy it feels really powerful. We did deliver with very low MD compared to other technologies and in the end, this is something our customers are looking for.
Q: How development speed of Python/Qt compares to Microsoft Technologies?
We had our .NET team estimate the same projects and they always ended up with more than twice manhours
Q: Was it difficult to connect to the Mitsubishi industrial robot?
The main difficulty was the very limited documentation for the R3 protocol that is used for 3rd party integration. Other than that Python is a great language for network and web integrations and in the end that’s what it was
Q: Why use Modbus for a sensor array?
Although old and simple this is still a very popular network type in industrial and home automation systems. You can connect tens or even hundreds of devices up to a kilometre away and not worry about interference. You can turn every computer into a Modbus client just by plugging in a USB key for 3 Euros. That makes it also a relatively cheap solution.
Q: Is Qt ok for fancy User Interfaces designs?
Yes, with Qt you can either use Qt Designer for UI designs and quickly design windows that look like native Windows, or other OS. Or you can use QML language to implement whatever UI designers want just like in HTML.
Q: What about integration with other industrial systems?
Python has libraries for any popular protocol, is it industrial or not. And if it does not we can always bind to native C or C++ libraries very easily.
Q: What if I need advanced mathematical processing for my data models?
Then Python is a perfect language. This is a language of choice for data scientists and institutions like NASA or CERN.
Q: Can you send data to our database management system from a Python application?
Python has libraries for every popular database management system.
Q: Can I run a Python/QT application on Raspberry Pi or another single-board computer?
Yes, but we recommend Raspberry Pi 4 or faster SBC.
So that's it for today. Thank you very much. See you next time. Check our web development, team extensions, and embedded services here. If you are looking for Python developers, contact us via contact form.