Class TcoSequencerBase
Provides basic sequential control, including step mode, which allows to run the sequence step-by-step, steping forward and steping backward.
Inheritance
Inherited Members
Namespace: PlcDocu.TcoCore
Assembly: TcoCoreConnector.dll
Syntax
public abstract class TcoSequencerBase : TcoStateExtendible
Constructors
| Improve this Doc View SourceTcoSequencerBase()
Prevents creating instance of this class via public constructor
Declaration
public TcoSequencerBase()
Fields
| Improve this Doc View Source_currentStep
Holds the status information about current step.
Declaration
public StepDetails _currentStep
Field Value
Type | Description |
---|---|
StepDetails |
Remarks
See StepDetails for detailed description.
_LastCycleTime
Total time of the last sequence cycle.
Declaration
public object _LastCycleTime
Field Value
Type | Description |
---|---|
System.Object |
_modeController
Handles changing the sequencer mode (Cyclic, Step).
Declaration
public TcoSequencerModeController _modeController
Field Value
Type | Description |
---|---|
TcoSequencerModeController |
_observer
Declaration
public object _observer
Field Value
Type | Description |
---|---|
System.Object |
_SequenceElapsedTime
Elapsed time of presently running sequence cycle.
Declaration
public object _SequenceElapsedTime
Field Value
Type | Description |
---|---|
System.Object |
_sequencerErrorId
Describes cause of the sequencer error.
Declaration
public short _sequencerErrorId
Field Value
Type | Description |
---|---|
System.Int16 |
Remarks
See
_sequencerHasError
True if an error occurs in the sequence. Detailed cause of this error is described by the _sequencerErrorId.
Declaration
public object _sequencerHasError
Field Value
Type | Description |
---|---|
System.Object |
Remarks
See
_StepElapsedTime
Elapsed time of the currently executing step.
Declaration
public object _StepElapsedTime
Field Value
Type | Description |
---|---|
System.Object |
MaxStepID
Declaration
public object MaxStepID
Field Value
Type | Description |
---|---|
System.Object |
MinStepID
Declaration
public object MinStepID
Field Value
Type | Description |
---|---|
System.Object |
RESTORE_STEP_ID
Declaration
public object RESTORE_STEP_ID
Field Value
Type | Description |
---|---|
System.Object |
Properties
| Improve this Doc View SourceCurrentStep
Gets the information about the current step.
Declaration
[IgnoreReflection]
public dynamic CurrentStep { get; }
Property Value
Type | Description |
---|---|
System.Object | Plc type StepDetails; Twin type: StepDetails |
IsFreshState
Gets true
on the first entry into new state.
Declaration
[IgnoreReflection]
public dynamic IsFreshState { get; }
Property Value
Type | Description |
---|---|
System.Object | Plc type BOOL; Twin type: Vortex.Connector.ValueTypes.OnlinerBool |
ModeController
Handles changing the sequencer mode (Cyclic, Step).
Declaration
[IgnoreReflection]
public dynamic ModeController { get; }
Property Value
Type | Description |
---|---|
System.Object | Plc type ITcoSequencerModeController; Twin type: |
Observer
Get or sets the observer for this instance of the sequencer.
Declaration
[IgnoreReflection]
public dynamic Observer { get; }
Property Value
Type | Description |
---|---|
System.Object | Plc type ITcoSequencerObserver; Twin type: |
Methods
| Improve this Doc View SourceCheckStepId(Object, Object, Object)
Performs the check of the
The StepId of each step in the sequence must be unique throughout the complete sequence, and it must not be changed.
```StepId``` sould be assigned as a number literal or a constant.
StepId
of the currently executed step.
important
Declaration
[IgnoreReflection]
dynamic CheckStepId(dynamic inStepID, dynamic inStepModeActive, dynamic inStepInRunning)
Parameters
Type | Name | Description |
---|---|---|
System.Object | inStepID | Plc type : INT [VAR_INPUT]; Twin type : Vortex.Connector.ValueTypes.OnlinerInt
|
System.Object | inStepModeActive | Plc type : BOOL [VAR_INPUT]; Twin type : Vortex.Connector.ValueTypes.OnlinerBool
|
System.Object | inStepInRunning | Plc type : BOOL [VAR_INPUT]; Twin type : Vortex.Connector.ValueTypes.OnlinerBool
|
Returns
Type | Description |
---|---|
System.Object | Plc type BOOL; Twin type: Vortex.Connector.ValueTypes.OnlinerBool |
i_Close()
Implicit call of this method is ensured by calling the method Run().
It must not be called explicitely by consumer code in derived blocks.
Do not call this method explicitly.
important
Declaration
[IgnoreReflection]
void i_Close()
i_CompleteSequence()
Completes the sequencer, and return the sequencer pointer to the first step in the seuqence. Method is typically called inside the last step of the sequence.
Declaration
[IgnoreReflection]
protected void i_CompleteSequence()
i_CompleteStep()
Completes the execution of the current step and moves the sequencer pointer to the next step in order of execution.
The call returns ITcoObjectRestorer
that allows to restore object upon step completition.
Declaration
[IgnoreReflection]
protected dynamic i_CompleteStep()
Returns
Type | Description |
---|---|
System.Object |
i_Open()
Implicit calling of this method is ensured by calling the method Run().
It must not be called explicitely by consumer code in derived blocks.
Do not call this method explicitly.
important
Declaration
[IgnoreReflection]
void i_Open()
i_RequestStep(Object)
Terminates the currently executed step and set the sequencer's pointer to the step with Id that corresponds to inRequestedStepID
parameter.
When the order of the requested step is higher than the order of the currently finished step (the requested step is "after" the current one)
the requested step is started in the same context cycle.
When the order of the requested step is lower than the order of the currently finished step (the requested step is "before" the current one)
the requested step is started in the next context cycle.
If the requested step is not found even in the next context cycle, the sequencer enters error state StepWithRequestedIdDoesNotExists
.
See
Declaration
[IgnoreReflection]
protected dynamic i_RequestStep(dynamic inRequestedStepID)
Parameters
Type | Name | Description |
---|---|---|
System.Object | inRequestedStepID | Plc type : INT [VAR_INPUT]; Twin type : Vortex.Connector.ValueTypes.OnlinerInt
|
Returns
Type | Description |
---|---|
System.Object | Plc type ITcoSequencer; Twin type: |
i_Step(Object, Object, Object)
Declaration
[IgnoreReflection]
protected dynamic i_Step(dynamic inStepID, dynamic inEnabled, dynamic inStepDescription)
Parameters
Type | Name | Description |
---|---|---|
System.Object | inStepID | |
System.Object | inEnabled | |
System.Object | inStepDescription |
Returns
Type | Description |
---|---|
System.Object |
i_StepCompleteWhen(Object)
Completes the actually running step, when the inCondition
parameter is TRUE
.
Method is typically called inside a step as the transition method.
Declaration
[IgnoreReflection]
protected void i_StepCompleteWhen(dynamic inCondition)
Parameters
Type | Name | Description |
---|---|---|
System.Object | inCondition | Plc type : BOOL [VAR_INPUT]; Twin type : Vortex.Connector.ValueTypes.OnlinerBool
|
IsStepIdUnique(Object)
Performs the check of the uniqueness of
The StepId of each step in the sequence must be unique throughout the complete sequence, and it must not be changed.
inStepId
in the sequence.
important
Declaration
[IgnoreReflection]
void IsStepIdUnique(dynamic inStepID)
Parameters
Type | Name | Description |
---|---|---|
System.Object | inStepID | Plc type : INT [VAR_INPUT]; Twin type : Vortex.Connector.ValueTypes.OnlinerInt
|
Main()
Main method of the sequener. Custom code needs to be placed here. The sequencer is executed by call of Instance.Run() method. This method is abstract, and it must be overridden in derived block.
Declaration
[IgnoreReflection]
protected dynamic Main()
Returns
Type | Description |
---|---|
System.Object | Plc type BOOL; Twin type: Vortex.Connector.ValueTypes.OnlinerBool |
OnlineChange()
Ensures that after each download, StepId uniqueness check is performed.
Do not call this method explicitly.
important
Declaration
[IgnoreReflection]
void OnlineChange()
OnRestore()
This method is called on sequence restore. This method can be overridden in derived block with a custom logic.
Declaration
[IgnoreReflection]
protected void OnRestore()
OnSequenceCompleted()
This method is called on sequence completion (the sequencer's last step was completed). This method can be overridden in derived block with a custom logic.
Declaration
[IgnoreReflection]
protected void OnSequenceCompleted()
OnSequencerError(Object)
This method is called when sequence enters error state. The method is called until the error is cleared. This method can be overridden in derived block with a custom logic.
Declaration
[IgnoreReflection]
protected void OnSequencerError(dynamic inErrorId)
Parameters
Type | Name | Description |
---|---|---|
System.Object | inErrorId | Plc type : eSequencerError [VAR_INPUT]; Twin type :
|
OnStepCompleted()
This method is executed upon step completion. This method can be overridden in derived block by custom logic.
Declaration
[IgnoreReflection]
protected void OnStepCompleted()
Restore()
This method resets the sequencer. Method is typically called before starting the sequence or after error has occured in the sequence.
Declaration
[IgnoreReflection]
public dynamic Restore()
Returns
Type | Description |
---|---|
System.Object | Plc type ITcoRestorable; Twin type: |
Run()
Ensures calling the Open(), Main() and Close() methods in the desired order. This method is final, so it cannot be overloaded. The **Instance.Run()** needs to be called cyclically inside the appropriate context.
Declaration
[IgnoreReflection]
public void Run()
StepChanged(Object)
This method is called at each transition between steps.
Declaration
[IgnoreReflection]
void StepChanged(dynamic newState)
Parameters
Type | Name | Description |
---|---|---|
System.Object | newState | Plc type : INT [VAR_INPUT]; Twin type : Vortex.Connector.ValueTypes.OnlinerInt
|
StepInternal(Object, Object, Object)
Basic step of the sequence.
Declaration
[IgnoreReflection]
dynamic StepInternal(dynamic inStepID, dynamic inEnabled, dynamic inStepDescription)
Parameters
Type | Name | Description |
---|---|---|
System.Object | inStepID | Plc type : INT [VAR_INPUT]; Twin type : Vortex.Connector.ValueTypes.OnlinerInt
This number must be unique throughout the complete sequence.
It must be a constant or numerical literal and it must not change during the life-time of the sequencer.
|
System.Object | inEnabled | Plc type : BOOL [VAR_INPUT]; Twin type : Vortex.Connector.ValueTypes.OnlinerBool
|
System.Object | inStepDescription | Plc type : STRING [VAR_INPUT]; Twin type : Vortex.Connector.ValueTypes.OnlinerString
|
Returns
Type | Description |
---|---|
System.Object | True in case when step with given StepId is in order of the execution, the step is enabled and the sequencer is in the cyclic mode. True in case when step with given StepId is in order of the execution, the step is enabled, the sequencer is in the step mode and StepIn() method was triggered. |