Siemens TM NPU MicroPython programming manual covering API2 changes, TM NPU-specific modules, shaves, hardware accelerators and supported MicroPython modules.
This document is the TM NPU MicroPython Programming Manual from Siemens, dated 06/2025 and numbered A5E52728839-AB. It describes the additional modules added to the TM NPU port of MicroPython, including PLC_WITHOUT_PROTOCOL, NPUFS, CAMERA, VID_PIPELINE and NEURAL_NETWORK, and how they are used for classification or object detection applications.
The manual also covers the use of shaves and hardware accelerators, the MicroPython modules supported on the TM NPU, general notes and troubleshooting, and a changelog of log-relevant API changes from V2.0.1 to V2.0.2.
| MicroPython version | 1.12 |
|---|---|
| CPython version | 3.9.6 |
| API release | V2.0.2 |
| Camera resolution | up to 2MP |
| Document number | A5E52728839-AB |
It gives access to the process image of the PLC. The first two bytes of the entire process image of inputs and outputs are reserved as status, error and control bytes and cannot be accessed through the MicroPython API; the remaining bytes are user-defined message bytes accessed with plc.read() and plc.write().
The neural_network module is used to initialize a neural network (blob file) from the SD Card or an FTP Server, provide it with a frame and execute it. The neural network makes use of the hardware accelerator automatically and returns results.
The camera module's supported resolutions for GigE vision and external image were extended up to 2MP and can be set freely within the defined range. The start_streaming(), read_raw() and read_processed() functions of the vid_pipeline module also gained a timeout parameter.
No. There is no prepared protocol implemented for message handling between the TM NPU and PLC, for example indicating whether the module is in a ready, busy or done state or whether information was updated. If required, this would have to be realized by the application.