ScriptTaskConfigObject

class ScriptTaskConfigObject.KindOfTask(value)

Bases: Enum

An enumeration.

Cyclic = (1,)
Freewheeling = (2,)
Event = (3,)
ExternalEvent = (4,)
Status = (5,)
ParentSynchron = 6
class ScriptTaskConfigObject.ScriptTaskConfigObjectMarker

Bases: object

Every ScriptObject instance will be extended with this method.

Version added:

3.5.10.0

property is_task_configuration

Gets a value indicating whether this instance is a task configuration object.

Return type:

bool

Returns:

True if this instance is task config object; otherwise, False.

class ScriptTaskConfigObject.ScriptTaskObjectMarker

Bases: object

Every ScriptObject instance will be extended with this method.

Version added:

3.5.10.0

property is_task

Gets a value indicating whether this instance is a task object.

Return type:

bool

Returns:

True if this instance is task object; otherwise, False

class ScriptTaskConfigObject.ScriptTaskConfigObject

Bases: ScriptTaskConfigObjectMarker

Functionality for manipulating task configuration objects.

Version added:

3.5.10.0

create_task(name)

Add a task object to a task configuration.

Return type:

ScriptTaskObject

class ScriptTaskConfigObject.ScriptTaskObject

Bases: ScriptTaskObjectMarker

Functionality for manipulating task objects.

Version added:

3.5.10.0

property name

Name of the task.

Return type:

str

property kind_of_task

Kind of task.

Return type:

KindOfTask

property event_pou_guid

Guid of POU for event.

Return type:

Guid

property priority

Priority of the task.

Return type:

str

property interval

Interval of the task.

Requires the property kind_of_task to be set to KindOfTask.Cyclic or KindOfTask.ExternalEvent if the device supports it.

Return type:

str

property interval_unit

Unit used for the interval.

Requires the property kind_of_task to be set to KindOfTask.Cyclic or KindOfTask.ExternalEvent if the device supports it.

Return type:

str

property watchdog

Settings for the watchdog of the task.

Return type:

ScriptWatchdog

property event

Use event to trigger the task.

Requires the property kind_of_task to be set to KindOfTask.Event or KindOfTask.Status.

Return type:

str

property external_event

Use external event to trigger the task.

Requires the property kind_of_task to be set to KindOfTask.ExternalEvent.

Return type:

str

property core_binding

Core binding. On multicore deivce each task can have an optional core binding.

Return type:

int

property parent_synchron_task

Task of the device application which allows synchronous calls to child application in bus cycle.

Requires the property kind_of_task to be set to KindOfTask.ParentSynchron.

Return type:

str

property pous

Collection of POUs which are executed by the task.

Return type:

ScriptPouObjectCollection

class ScriptTaskConfigObject.ScriptWatchdog

Bases: object

A configuration for a watchdog.

Version added:

3.5.10.0

property enabled

Enable the watchdog for a task.

Return type:

bool

property time

Time monitoring for a task.

Return type:

str

property time_unit

Unit user for the time.

Return type:

str

property sensitivity

Sensitivity of the watchdog.

Return type:

str

class ScriptTaskConfigObject.ScriptPouObjectCollection(iterable=(), /)

Bases: list

A collection of POUs which are executed by a task.

Version added:

3.5.10.0

add(pou_name, comment=None)

Add a POU to the list.

Parameters:
  • pou_name (str) – Name of the POU.

  • comment (str) – Optional comment about this entry

insert(index, pou_name, comment)

Insert a POU to the list at the specified index.

Parameters:
  • index (int) – Index of a POU at which a new POU should be inserted.

  • pou_name (str) – Name of the POU.

  • comment (str) – Optional comment about this entry

replace(index, pou_name, comment)

Replace the POU in the list at the specified index.

Parameters:
  • index (int) – Index of a POU which should be replaced.

  • pou_name (str) – Name of the POU.

  • comment (str) – Optional comment about this entry

remove(index_or_name)

Remove a POU from the list at the specified index OR: Remove the first POU with the specified name from the list.

Parameters:

index_or_name (int or str) – Index or name of a POU which should be removed.