StartBGTask Method
Description
Start one SPEL+ task as a background task.
Syntax
Sub StartBGTask (FuncName As String)
Parameters
- FuncName
The name of the function to be executed.
Remarks
Use StartBGTask to start a Spel+ background task in the Controller. Background tasks must be enabled in the Controller.
Note that BGMain automatically starts when the Controller switches to auto mode, so normally StartBGTask is not required.
StartBGTask is provided in case you need to stop all tasks, then start background tasks again.
See Also
Call Method, Start Method, Stop Method, Xqt Method
StartBGTask Example
VB Example:
' Stop all tasks, including background tasks
m_spel.Stop(SpelStopType.StopAllTasks)
…
m_spel.RebuildProject()
’ Restart the main background task
m_spel.StartBGTask("BGMain")
C# Example:
// Stop all tasks, including background tasks
m_spel.Stop(SpelStopType.StopAllTasks);
…
m_spel.RebuildProject();
// Restart the main background task
m_spel.StartBGTask("BGMain");