Asynchronous task
Create asynchronous tasks to run code asynchronously.
Classes
FactoryTalk Optix Studio provides C# class specifications that exhibit the constructors that you can use for creating asynchronous tasks. The constructors are based on the .NET Framework C# System.Threading.Tasks.Task
class, which represents an asynchronous task. See Task Class.
You can use these classes to create asynchronous tasks:
PeriodicTask
- A task that runs code at regular time intervals. See Constructor: PeriodicTask(action, periodMilliseconds, excutingNode).
DelayedTask
- A task that runs code after a time delay. See Constructor: DelayedTask(action, delayMilliseconds, executingNode).
LongRunningTask
- A task that requires significant time or CPU resources. See Constructor: LongRunningTask(action, executingNode).
Tip: You can also use C# async methods to run asynchronous code. C# async methods cannot interact with the project model. For example, C# async methods should not read or write a model variable. To modify the project model asynchronously, use the
PeriodicTask
, DelayedTask
, LongRunningTask
classes to construct asynchronous tasks.