PFC300 Docker, Machine Learning Python Scripts and IEC61131-3 Integration

Good morning, Community.

I asked this question before but didn’t clarify my application and questions.

I got some material on installing Python in Docker and running a simple Python program to display “Hello World.” Tech Note: Dockerizing your Python Application on a Wago Controller

Also, I found an advanced Docker container for Python and Modbus, but there is no documentation that explains how to use it: https://hub.docker.com/layers/wagoautomation/python/3.8-pysnmp-pymodbus-alpine-14/images/sha256-c174e404802d8f8c61381f06bb25d6f93060d97c650cf08c2809f24faaa7c7ff?context=explore

Here are my application details:

I have a few Machine Learning time series transformer-trained models that use the Numpy and PyTorch libraries to make target predictions based on input features.
The input features are process variables of a natural gas compressor acquired by the PFC300 via Modbus TCP/IP using the Modbus configurator in Codesys 3.5. The PFC300 acquires the real-time process variables and feeds them to the Python ML model. The ML model estimates the target value and stores the values along the input features used to calculate it in a CSV file on the PLC SD card.

According to the Linux command “uname—m” and its manual, the PFC300 has an aarch64 architecture, which is the 64-bit Arm-v8 instruction set, also called arm64.

Question 1: Does the PFC300 support PyTorch and Numpy libraries?
**Question 2: Which Linux image should I use? AI recommended to use Python:3.11-slim-bookworm due to the use of PyTorch, Pandas, and Numpy.

Thank you so much for your attention and participation.

Hello,

I’m not familiar with those libraries but as a general rule the Python docker image is widely supported nevermind the architecture. I’m not sure those libraries have specific cpu requirements but since it involves machine learning it may requires GPU which is not available on the PFC300.
I would try the slim version then maybe the standard version in case of missing dependencies.
But the image size difference is huge : 45 Mb (slim) vs > 3Gb (standard) .

The python image is well documented. https://hub.docker.com/_/python
You’ll have a to create a Dockerfile, a requirements.txt file (with name and version of libraries you need) and of course your Python script, and you will build your image.
Once you’ve build your image you can call it using the docker run command.

Carlos,

Here’s post I wrote a while back that may help:

In this application I’ve used Pandas, Numpy, and Flask all in my Python application on the PFC300.

Let me know if this helps.

Thanks,
Joe

3 Likes