Using Micropython - Siemens SIMATIC S7-1500 Manual

Hide thumbs Also See for SIMATIC S7-1500:
Table of Contents

Advertisement

Programming
6.1 MicroPython functionality
6.1.2

Using MicroPython

Use the MicroPython libraries in the "main.py" script to allow flexibility for adaption of the
pre-processing and post-processing in the application.
Supported libraries
The TM NPU has a MicroPython interpreter integrated as an application interface.
The MicroPython interpreter enables the following functionalities:
• Access to the subordinate module functions, e.g. control of the camera, access to the
SIMATIC Memory Card, communication via the process image, etc.
• Flexible adaption of the application:
– Pre-processing of the (image) data for the neural network
– Post-processing of the inference results before passing them on to the CPU
These functionalities are made available via the MicroPython libraries included in the module:
• The MicroPython standard library provides the basic commands and functionalities of
MicroPython.
• The TM NPU-specific library enables the use of TM NPU-specific interfaces and features
such as the camera and the video pipeline, loading of a neural network, read/write access
to the SIMATIC Memory Card or an external FTP server (via the FTP client integrated in the
TM NPU) and more
Non-supported libraries are not available in the "main.py". Calling a non-supported library
results in a MicroPython exception, e.g. "Method not available".
MicroPython in the TM NPU
The script can contain the following functionalities and tasks:
• Reading and writing data on the SIMATIC Memory Card or FTP server
• Loading the neural network into the Neural Compute Engine
• Accessing data supplied by the camera
• Configuring the video pipeline (pre-processing - flow for image data processing)
• Executing the neural networks
• Communicating with the CPU
NOTE
You can find examples in the "main.py" script which is offered as part of the application
example.
The application example is available for download on the Internet
(https://support.industry.siemens.com/cs/ww/en/view/109781466).
NOTE
The documentation of the implemented MicroPython is provided with the latest firmware
version. Note that future versions may contain additional changes.
You can find a full list of supported functions and their description as well as information
regarding changes here (https://support.industry.siemens.com/cs/ww/en/view/109812049).
32
Technology Module TM NPU
Equipment Manual, 07/2023, A5E46384784-AC

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic et 200mp

Table of Contents