Table of Contents

Class Task

Namespace
L5Sharp.Components
Assembly
L5Sharp.dll

A logix Task component. Contains the properties that comprise the L5X Task element.

public class Task : LogixComponent<Task>, ILogixSerializable
Inheritance
Task
Implements
Inherited Members

Remarks

Observe these guidelines when defining a task:
• Tasks must be defined after programs and before controller objects.
• There is a maximum of 32 tasks.
• There is one continuous task only.
• A program can be scheduled under one task only.
• Scheduled programs must be defined (must exist).

Constructors

Task()

Creates a new Task with default values.

public Task()

Remarks

By default uses Periodic, 10ms Priority, 10ms Rate, and 500ms Watchdog.

Task(XElement)

Creates a new Task initialized with the provided XElement.

public Task(XElement element)

Parameters

element XElement

The XElement to initialize the type with.

Exceptions

ArgumentNullException

element is null.

Properties

DisableUpdateOutputs

The value indicating whether the task is set to disable updating output values.

public bool DisableUpdateOutputs { get; set; }

Property Value

bool

A bool; true if the task has disabled update outputs; otherwise false.

EnableTimeout

The value indicating whether timeouts are enabled for the event task. Only used for event tasks.

public bool? EnableTimeout { get; set; }

Property Value

bool?

If the task is an event type task, true indicating that timeouts are enabled, false to indicate they are disabled. Returns null for non-event tasks.

EventTag

The tag name that the event task consumes. Only used for event tasks.

public TagName? EventTag { get; set; }

Property Value

TagName

A TagName value indicating what tag to consume. Returns null for non-event tasks.

Remarks

Only used for event tasks with a Consumed Tag trigger or a Module Input Data State Change trigger.

EventTrigger

The trigger for the event task. Only used for event tasks.

public TaskEventTrigger? EventTrigger { get; set; }

Property Value

TaskEventTrigger

A TaskEventTrigger value indicating what triggers the task. Returns null for non-event tasks.

InhibitTask

The value indicating whether the task is inhibited.

public bool InhibitTask { get; set; }

Property Value

bool

A bool; true if the task is inhibited; otherwise false.

Priority

The scan priority of the task component. Default of 10.

public TaskPriority Priority { get; set; }

Property Value

TaskPriority

A TaskPriority value type representing the int priority of the task.

Rate

The scan rate (ms) of the task component. Default of 10.

public ScanRate? Rate { get; set; }

Property Value

ScanRate?

A ScanRate value type representing the float rate of the task.

ScheduledPrograms

The collection of program names that are scheduled to the task.

public IEnumerable<string> ScheduledPrograms { get; }

Property Value

IEnumerable<string>

A IEnumerable<T> containing the string program names.

Remarks

This member just returns the read only list of scheduled programs. To modify the list, use

Type

Gets the type of the task component (Continuous, Periodic, Event).

public TaskType? Type { get; set; }

Property Value

TaskType

A TaskType enum representing the type of the task.

Watchdog

The watchdog rate (ms) of the task component. Default of 500.

public Watchdog Watchdog { get; set; }

Property Value

Watchdog

A Watchdog value type representing the float watchdog of the task.

Methods

Cancel(string)

Removes the specified program name from the underlying list of ScheduledPrograms

public void Cancel(string program)

Parameters

program string

The name of the program to cancel.

Schedule(string)

Adds the provided program name to the underlying list of ScheduledPrograms.

public void Schedule(string program)

Parameters

program string

The name of the program to schedule.