Programming
6.2 Sequence and procedures
6.2.1.2
Initialization
Requirement
The SIMATIC Memory Card contains the neural network(s) and the script.
Starting the TM NPU
Follow the steps below to start the TM NPU:
1. Insert the SIMATIC Memory Card into the intended slot.
2. Select the TM NPU.
Result
The hardware interfaces are initialized.
The MicroPython script is loaded into the RAM.
6.2.2
main.py - structure and setup
6.2.2.1
Application start / execution of the Python script
The application starts after the MicroPython interpreter has been initialized.
Example for the application
• The "main.py" script is loaded into the RAM.
• Libraries referenced in the script are loaded.
• The connected camera is initialized.
• The video pipeline is initialized.
• The neural networks are initialized.
6.2.2.2
Working with MicroPython
The user creates his application in the "main.py" script.
A script can be created and edited with any text editor without special tools.
The user has write and read access to the SIMATIC Memory Card.
Access to the libraries stored in the flash memory of the SIMATIC Memory Card is read-only.
36
Technology Module TM NPU
Equipment Manual, 07/2023, A5E46384784-AC