Python Threading in Ignition


I’d like to ask if there’s an equivalent Ignition module for python threading?
What i want to do is to run a checker for idle time while the application is connected to the actual tool.

I know this is possible to do in python threading. But i need the thread to keep running while the application is up. Should i fire up the thread on the start up script? will the thread or function be able to run until i close the application?

Any idea guys?

Thank you!
PS : I’ve researched about invokeasnychronous. Am i right that i creates a new thread for the function being called?

Hi Ella,

Yes, invokeasnychronous creates a new thread for the function that is called.


Thanks for confirming Nick.

So is invokeasynchronous same with threading in python?

They both use Java threads, so they are similar.

But is it possible to do multi threading in ignition?

Yes, you are doing multi-threaded programming when you use system.util.invokeAsynchronous and system.util.invokeLater functions.

Each time you call system.util.invokeAsynchronous you are creating a new Java thread to execute the function argument in.

The PA Power Scripting Module has more multi-threading tools, specifically the pa.thread.multiTask function and @run.