Threading allows your Python code to run autonomously in the background, without requiring an input state change to run it. Code inside a thread will run independently of all other Python code in the project – this includes code inside the same Live Python block, or inside other Live Python blocks.
Threaded Python scripts are not triggered by values received on the inputs of the Live Python device. They start running automatically, as soon as the NWare project is deployed.
Example applications for threaded scripts include:
Notes:
In this section Syntax and structure of a threaded script |
See also Controlling the execution of Python code |