Class Routine
- Namespace
- L5Sharp.Components
- Assembly
- L5Sharp.dll
A logix Routine
component. Contains the properties for a generic Routine element. This type does not
include content property. More specific routine types are derived from this base class.
public class Routine : LogixComponent<Routine>, ILogixSerializable
- Inheritance
-
Routine
- Implements
- Inherited Members
Constructors
Routine()
Creates a new Routine with default values.
public Routine()
Remarks
By default this will be a RLL routine type. To specify a different type, use the RoutineType constructor.
Routine(RoutineType)
Creates a new Routine of the specified RoutineType.
public Routine(RoutineType type)
Parameters
type
RoutineTypeThe RoutineType of the routine.
Exceptions
- ArgumentNullException
type
is null.
Routine(XElement)
public Routine(XElement element)
Parameters
Exceptions
- ArgumentNullException
element
is null.
Properties
OnlineEditType
The online edit type for the ST
/FBD
/SFC
Routine type.
public OnlineEditType? OnlineEditType { get; set; }
Property Value
- OnlineEditType
If the routine is a
ST
,FBD
, orSFC
type, then the OnlineEditType value; Otherwise,null
forRLL
routines.
SheetOrientation
The sheet orientation for the FBD
or SFC
Routine type.
public SheetOrientation? SheetOrientation { get; set; }
Property Value
- SheetOrientation
If the routine is a
FBD
orSFC
type, then the SheetOrientation value; Otherwise,null
forRLL
orST
routines.
SheetSize
The sheet size for the FBD
or SFC
Routine type.
public SheetSize? SheetSize { get; set; }
Property Value
- SheetSize
If the routine is a
FBD
orSFC
type, then the SheetSize value; Otherwise,null
forRLL
orST
routines.
Type
The type of the Routine component.
public RoutineType Type { get; set; }
Property Value
- RoutineType
A RoutineType enum specifying the type content the routine contains.
Methods
Content<TElement>()
Gets the routine content as a LogixContainer<TElement> containing elements of the specified type.
public LogixContainer<TElement> Content<TElement>() where TElement : LogixElement
Returns
- LogixContainer<TElement>
A LogixContainer<TElement> with access to the root content and specified element types.
Type Parameters
TElement
The content element type to return.
Remarks
This method offers a dynamic interface for accessing content of any routine type. If the underlying routine content does not match the Type specified, a L5XException will be thrown.
Exceptions
- InvalidOperationException
No content element corresponding to the specified Type exists for the underlying XElement. This can happen if the provided element is not valid.