Namespace TcoCore
Classes
_internals_TcoContext
Partial class exposes Open and Close context methods for testing purposes.
_internals_TcoSequence
_internals_TcoSequencer
ExcludeFromApiDocumentationAttribute
F_AnyToUnionValue
MAIN
MultipleRemoteCallInitializationException
NO
Plain_internals_TcoContext
This is POCO object for its respective onliner class. For documentation of this type see the onliner class.
Plain_internals_TcoSequence
This is POCO object for its respective onliner class. For documentation of this type see the onliner class.
Plain_internals_TcoSequencer
This is POCO object for its respective onliner class. For documentation of this type see the onliner class.
PlainF_AnyToUnionValue
This is POCO object for its respective onliner class. For documentation of this type see the onliner class.
PlainMAIN
This is POCO object for its respective onliner class. For documentation of this type see the onliner class.
PlainNO
This is POCO object for its respective onliner class. For documentation of this type see the onliner class.
PlainRtcPrg
This is POCO object for its respective onliner class. For documentation of this type see the onliner class.
PlainRtcSynchParams
This is POCO object for its respective onliner class. For documentation of this type see the onliner class.
PlainStepDetails
This is POCO object for its respective onliner class. For documentation of this type see the onliner class.
PlainStringBuilder
This is POCO object for its respective onliner class. For documentation of this type see the onliner class.
PlainTcoComponent
This is POCO object for its respective onliner class. For documentation of this type see the onliner class.
PlainTcoContext
This is POCO object for its respective onliner class. For documentation of this type see the onliner class.
PlainTcoContextCompatibility
This is POCO object for its respective onliner class. For documentation of this type see the onliner class.
PlainTcoContextEnvironment
This is POCO object for its respective onliner class. For documentation of this type see the onliner class.
PlainTcoContextNfCompatibility
This is POCO object for its respective onliner class. For documentation of this type see the onliner class.
PlainTcoCoreTwinController
This is POCO object for its respective onliner class. For documentation of this type see the onliner class.
PlainTcoDialog
This is POCO object for its respective onliner class. For documentation of this type see the onliner class.
PlainTcoDialogBase
This is POCO object for its respective onliner class. For documentation of this type see the onliner class.
PlainTcoLogger
This is POCO object for its respective onliner class. For documentation of this type see the onliner class.
PlainTcoLogItem
This is POCO object for its respective onliner class. For documentation of this type see the onliner class.
PlainTcoMessage
This is POCO object for its respective onliner class. For documentation of this type see the onliner class.
PlainTcoMessageDigest
This is POCO object for its respective onliner class. For documentation of this type see the onliner class.
PlainTcoMessenger
This is POCO object for its respective onliner class. For documentation of this type see the onliner class.
PlainTcoMessengerEnv
This is POCO object for its respective onliner class. For documentation of this type see the onliner class.
PlainTcoMomentaryTask
This is POCO object for its respective onliner class. For documentation of this type see the onliner class.
PlainTcoObject
This is POCO object for its respective onliner class. For documentation of this type see the onliner class.
PlainTcoParentedStructure
This is POCO object for its respective onliner class. For documentation of this type see the onliner class.
PlainTcoRemoteTask
This is POCO object for its respective onliner class. For documentation of this type see the onliner class.
PlainTcoRtc
This is POCO object for its respective onliner class. For documentation of this type see the onliner class.
PlainTcoSequence
This is POCO object for its respective onliner class. For documentation of this type see the onliner class.
PlainTcoSequencer
This is POCO object for its respective onliner class. For documentation of this type see the onliner class.
PlainTcoSequencerBase
This is POCO object for its respective onliner class. For documentation of this type see the onliner class.
PlainTcoSequencerModeController
This is POCO object for its respective onliner class. For documentation of this type see the onliner class.
PlainTcoSequencerObserver
This is POCO object for its respective onliner class. For documentation of this type see the onliner class.
PlainTcoSignalInfo
This is POCO object for its respective onliner class. For documentation of this type see the onliner class.
PlainTcoState
This is POCO object for its respective onliner class. For documentation of this type see the onliner class.
PlainTcoStateBase
This is POCO object for its respective onliner class. For documentation of this type see the onliner class.
PlainTcoStateExtendible
This is POCO object for its respective onliner class. For documentation of this type see the onliner class.
PlainTcoStruct
This is POCO object for its respective onliner class. For documentation of this type see the onliner class.
PlainTcoTask
This is POCO object for its respective onliner class. For documentation of this type see the onliner class.
PlainTcoTaskResult
This is POCO object for its respective onliner class. For documentation of this type see the onliner class.
PlainTcoTcoSequencerObserverDummy
This is POCO object for its respective onliner class. For documentation of this type see the onliner class.
PlainTcoTier
This is POCO object for its respective onliner class. For documentation of this type see the onliner class.
PlainTcoToggleTask
This is POCO object for its respective onliner class. For documentation of this type see the onliner class.
RtcPrg
RtcSynchParams
StepDetails
Describes the status of a step of the sequencer.
StringBuilder
Allows to concat strings using fluent interface. It's similar to C# StringBuilder class Usage as follows :
ErrorString := _stringBuilder
.Clear()
.Append('Error number: ')
.Append(INT_TO_STRING(ErrorNumber))
.Append('. Message: ')
.Append(ErrorMessage)
.Append('.')
.ToString();
Inspired by Gerhard Barteling blogpost at https://www.plccoder.com/fluent-code/
TcoComponent
Basic class for components.
TcoContext
Root construction container, provides context information for TcoObjects
declared within its scope.
This function block is abstract
and cannot be instantiated.
Use Run() to run this context, Run
method must be called only once per PLC Task cycle.
Several 'TcoContext' instances can be declared and called inside one TwinCAT PlcTask, but only once per PLC cycle.
The instance should not be accessed from several Twincat PlcTasks.
Default implemenation of the 'TcoContext' allows its child members access properties StartCycleCount
and EndCycleCount, messenger settings, rtc and other information related to the context of the running logic.
tip
A TcoContext
can contain objects, components and PLC logic of one independent station of the machine,
while the another one can cover the same for another station.
tip
TwinCAT PlcTask and TcoTask() refer to two different concepts.
TcoContextCompatibility
TcoContextEnvironment
TcoContextNfCompatibility
TcoCoreTwinController
TcoDialog
Provides standard dialog to interact with the user.
TcoDialogBase
Base block for interactive dialogs.
TcoLogger
Default implementation of Logger.
tip
This type is partially extended by IVF to retrieve messages from the logger in IVF application.
TcoLogItem
Logger message object contains complete message details including time stamp, message text, message category, identity of the message provider, context cycle in which the message was posted.
TcoMessage
Complete message details including time stamp, message text, message category, identity of the message provider, context cycle in which the message was posted.
TcoMessageDigest
TcoMessenger
Provides mechanism for delivering static messages to the supervising applications (SCADA/HMI).
Each messenger has a single placeholder for the message; it stores the most important message from the last context cycle.
If there are more messages in a single cycle for the same messenger then less important messages are discarded and replaced by
the message with the category of higher severity.
Messenger can send the data to context logger. There is a maximum limit of 10 different messages per messenger in 2 consecutive context cycles.
The messages that exceed this limit won't be logged when `OnEventRisen` logging is set.
Take this behaviour into account when designing your system.
important
important
TcoMessengerEnv
TcoMomentaryTask
Provides basic momentary on function.
To get the actual state of the momentary task,
TcoObject
Basic construction block from which all blocks of a TcOpen application should derive in order to take advantage of the framework.
This function block is abstract and must be implemented in a derived block.
TcoObject
, must be constructed via FB_init(ITcoObject)
method at instantiation.
TcoObjects
that belong to same TcoContext
share the same context.
This is typically achieved by constructing the object with FB_init(THIS^)
, where THIS^
is of ITcoObject
(note that ITcoContext also implements ITcoObject).
warning
Whenever it is required to pass function block parameters of a block type that derives from `TcoObject` it should be passed as **reference**. This means either via appropriate interface or as `REFERENCE TO` in VAR_INPUT and VAR_OUTPUT sections or as VAR_IN_OUT. Be aware the VAR_INPUT and VAR_OUTPUT create a copy of the variable.
All the variables _myContext, _ContextTcoObjectA, _ContextTcoObjectB, _ContextChildTcoObject should have all the same value.
All the variables _myIdentity, _TcoObjectAidentity, _TcoObjectBidentity, _ChildTcoObjectidentity should have uniques values.
The context of the myTcoContext instance is assigned to itself. As the _myTcoObjectA context is assigned to this instance of the myTcoContext, it is assigned to the same context,
and the value of the _ContextTcoObjectA will be the same as the value of the _myContext.
The context of the _myTcoObjectB instance is assigned to the _myTcoObjectA, that has already assigned context to this instance of the myTcoContext.
So the value of the _ContextTcoObjectB will be the same as the values of the _ContextTcoObjectA and _myContext.
The context of the _myTcoObjectB._myChildTcoObject instance is assigned to the _myTcoObjectB, that has already assigned context to _myTcoObjectA,
that has already assigned its context to this instance of the myTcoContext.
So the value of the _ContextChildTcoObject wile be the same as the values _ContextTcoObjectB,_ContextTcoObjectA and _myContext.
As the Identities of all objects points to the themselves, all identities will have different values, as all objects are unique.
Example
//Definition of the myTcoObject
FUNCTION_BLOCK myTcoObject EXTENDS TcoObject
VAR
_myChildTcoObject : myChildTcoObject(THIS^);
END_VAR
//Definition of the myTcoContext
FUNCTION_BLOCK myTcoContext EXTENDS TcoContext
VAR
_myTcoObjectA : myTcoObject(THIS^);
_myTcoObjectB : myTcoObject(_myTcoObjectA.Context);
_myContext : ITcoContext;
_ContextTcoObjectA : ITcoContext;
_ContextTcoObjectB : ITcoContext;
_ContextChildTcoObject : ITcoContext;
_myIdentity : ULINT;
_TcoObjectAidentity : ULINT;
_TcoObjectBidentity : ULINT;
_ChildTcoObjectidentity : ULINT;
END_VAR
//Plc code of the myTcoContext
_myContext := THIS^.Context;
_ContextTcoObjectA := _myTcoObjectA.Context;
_ContextTcoObjectB := _myTcoObjectB.Context;
_ContextChildTcoObject := _myTcoObjectB._myChildTcoObject.Context;
_myIdentity := THIS^.Identity;
_TcoObjectAidentity := _myTcoObjectA.Identity;
_TcoObjectBidentity := _myTcoObjectB.Identity;
_ChildTcoObjectidentity := _myTcoObjectB._myChildTcoObject.Identity;
Explanation
TcoObjectMessageHandler
Provides access to messages of the object and all child objects.
TcoParentedStructure
TcoRemoteTask
Remote tasks delegates its execution to C#. When this task is invoked a C# method will be called. To initiliaze
RemoteTask
with C# method use the Initiliaze
or InitializeExclusively
method.
partial void PexConstructor(IVortexObject parent, string readableTail, string symbolTail)
{
_remoteTaskInstance.InitializeExclusively(Create);
//_remoteTaskInstance.Initialize(Create);
}
private bool Create()
{
//your code.
return true;
}
TcoRtc
TcoSequence
TcoSequencer
TcoSequencerBase
Provides basic sequential control, including step mode, which allows to run the sequence step-by-step, steping forward and steping backward.
TcoSequencerModeController
Provides switching between sequencer modes so as handling stepping tasks in the step mode.
TcoSequencerObserver
TcoSignalInfo
Provides symbol information about a I/O signal.
important
`SymbolPath` can only contain string of 255 characters.
tip
This block is partially extended by IVF to provide more information about the symbol.
TcoState
TcoStateBase
Provides basic state controller. It could be implemented using IF
, IF
ELSIF
or CASE
statement. The transition to the different state needs to be perfromed by calling
OnStateChange()
could be overloaded and some custom code that needs to be executed on each change of the state could be placed here. The TcoState could be used like this:
Example 1
_myTask()
is not a member of this TcoState()
, it is restored manually to be able to trigger it in the next state.
IF State = 10 THEN
Main._myTask.Invoke();
Main._myTask.Execute();
IF Main._myTask.Done THEN
ChangeState(State + 10);
Main._myTask.Restore();
END_IF
END_IF
IF State = 20 THEN
Main._myTask.Invoke();
Main._myTask.Execute();
IF Main._myTask.Done THEN
ChangeState(State + 10);
Main._myTask.Restore();
END_IF
END_IF
Example 2
_myTask()
is a member of this TcoState()
, it is restored manually using the fluent syntax to be able to trigger it in the next state.
CASE State OF
10:
_myTask.Invoke();
_myTask.Execute();
IF _myTask.Done THEN
ChangeState(State + 10).RestoreObject(_myTask);
END_IF
20:
_myTask.Invoke();
_myTask.Execute();
IF _myTask.Done THEN
ChangeState(State + 10).RestoreObject(_myTask);
END_IF
END_CASE
See
TcoStateExtendible
TcoStruct
Basic structure block from which most of the structures in TcOpen derive. TcoStruct
provides construction mechanism to allow for access to the
parent function block and the context.
important
The derived structure must be initialized in the declaration of the function block `mystruct : MyCustomStructure := (Parent := THIS^)`, when nested in another structure `mystruct : MyCustomStructure := (Parent := THISSTRUCT)`. This will provide access to the `TcoContext` and parent `TcoObject`.
TcoTask
Provides basic task execution. Task is started by calling the Invoke() method.
The Execute() method returns true, until the task is Done
.
To get the actual state of the task, Ready, Busy, Error and Done properties are available.
TcoTaskResult
TcoTcoSequencerObserverDummy
TcoTier
TcoToggleTask
Provides basic toggling between two states. The states are triggered by calling the Toggle() method.
To get the actual state of the toggle task,
Interfaces
I_internals_TcoContext
This is onliner interface for its respective class. For documentation of this type see the onliner class.
I_internals_TcoSequence
This is onliner interface for its respective class. For documentation of this type see the onliner class.
I_internals_TcoSequencer
This is onliner interface for its respective class. For documentation of this type see the onliner class.
IF_AnyToUnionValue
This is onliner interface for its respective class. For documentation of this type see the onliner class.
IMAIN
This is onliner interface for its respective class. For documentation of this type see the onliner class.
INO
This is onliner interface for its respective class. For documentation of this type see the onliner class.
IRtcPrg
This is onliner interface for its respective class. For documentation of this type see the onliner class.
IRtcSynchParams
This is onliner interface for its respective class. For documentation of this type see the onliner class.
IShadow_internals_TcoContext
This is shadow interface for its respective class. For documentation of this type see the onliner class.
IShadow_internals_TcoSequence
This is shadow interface for its respective class. For documentation of this type see the onliner class.
IShadow_internals_TcoSequencer
This is shadow interface for its respective class. For documentation of this type see the onliner class.
IShadowF_AnyToUnionValue
This is shadow interface for its respective class. For documentation of this type see the onliner class.
IShadowMAIN
This is shadow interface for its respective class. For documentation of this type see the onliner class.
IShadowNO
This is shadow interface for its respective class. For documentation of this type see the onliner class.
IShadowRtcPrg
This is shadow interface for its respective class. For documentation of this type see the onliner class.
IShadowRtcSynchParams
This is shadow interface for its respective class. For documentation of this type see the onliner class.
IShadowStepDetails
This is shadow interface for its respective class. For documentation of this type see the onliner class.
IShadowStringBuilder
This is shadow interface for its respective class. For documentation of this type see the onliner class.
IShadowTcoComponent
This is shadow interface for its respective class. For documentation of this type see the onliner class.
IShadowTcoContext
This is shadow interface for its respective class. For documentation of this type see the onliner class.
IShadowTcoContextCompatibility
This is shadow interface for its respective class. For documentation of this type see the onliner class.
IShadowTcoContextEnvironment
This is shadow interface for its respective class. For documentation of this type see the onliner class.
IShadowTcoContextNfCompatibility
This is shadow interface for its respective class. For documentation of this type see the onliner class.
IShadowTcoCoreTwinController
IShadowTcoDialog
This is shadow interface for its respective class. For documentation of this type see the onliner class.
IShadowTcoDialogBase
This is shadow interface for its respective class. For documentation of this type see the onliner class.
IShadowTcoLogger
This is shadow interface for its respective class. For documentation of this type see the onliner class.
IShadowTcoLogItem
This is shadow interface for its respective class. For documentation of this type see the onliner class.
IShadowTcoMessage
This is shadow interface for its respective class. For documentation of this type see the onliner class.
IShadowTcoMessageDigest
This is shadow interface for its respective class. For documentation of this type see the onliner class.
IShadowTcoMessenger
This is shadow interface for its respective class. For documentation of this type see the onliner class.
IShadowTcoMessengerEnv
This is shadow interface for its respective class. For documentation of this type see the onliner class.
IShadowTcoMomentaryTask
This is shadow interface for its respective class. For documentation of this type see the onliner class.
IShadowTcoObject
This is shadow interface for its respective class. For documentation of this type see the onliner class.
IShadowTcoParentedStructure
This is shadow interface for its respective class. For documentation of this type see the onliner class.
IShadowTcoRemoteTask
This is shadow interface for its respective class. For documentation of this type see the onliner class.
IShadowTcoRtc
This is shadow interface for its respective class. For documentation of this type see the onliner class.
IShadowTcoSequence
This is shadow interface for its respective class. For documentation of this type see the onliner class.
IShadowTcoSequencer
This is shadow interface for its respective class. For documentation of this type see the onliner class.
IShadowTcoSequencerBase
This is shadow interface for its respective class. For documentation of this type see the onliner class.
IShadowTcoSequencerModeController
This is shadow interface for its respective class. For documentation of this type see the onliner class.
IShadowTcoSequencerObserver
This is shadow interface for its respective class. For documentation of this type see the onliner class.
IShadowTcoSignalInfo
This is shadow interface for its respective class. For documentation of this type see the onliner class.
IShadowTcoState
This is shadow interface for its respective class. For documentation of this type see the onliner class.
IShadowTcoStateBase
This is shadow interface for its respective class. For documentation of this type see the onliner class.
IShadowTcoStateExtendible
This is shadow interface for its respective class. For documentation of this type see the onliner class.
IShadowTcoStruct
This is shadow interface for its respective class. For documentation of this type see the onliner class.
IShadowTcoTask
This is shadow interface for its respective class. For documentation of this type see the onliner class.
IShadowTcoTaskResult
This is shadow interface for its respective class. For documentation of this type see the onliner class.
IShadowTcoTcoSequencerObserverDummy
This is shadow interface for its respective class. For documentation of this type see the onliner class.
IShadowTcoTier
This is shadow interface for its respective class. For documentation of this type see the onliner class.
IShadowTcoToggleTask
This is shadow interface for its respective class. For documentation of this type see the onliner class.
IsTcoContext
IsTcoObject
IStepDetails
This is onliner interface for its respective class. For documentation of this type see the onliner class.
IStringBuilder
This is onliner interface for its respective class. For documentation of this type see the onliner class.
ITcoComponent
This is onliner interface for its respective class. For documentation of this type see the onliner class.
ITcoContext
This is onliner interface for its respective class. For documentation of this type see the onliner class.
ITcoContextCompatibility
This is onliner interface for its respective class. For documentation of this type see the onliner class.
ITcoContextEnvironment
This is onliner interface for its respective class. For documentation of this type see the onliner class.
ITcoContextNfCompatibility
This is onliner interface for its respective class. For documentation of this type see the onliner class.
ITcoCoreTwinController
ITcoDialog
This is onliner interface for its respective class. For documentation of this type see the onliner class.
ITcoDialogBase
This is onliner interface for its respective class. For documentation of this type see the onliner class.
ITcoLogger
This is onliner interface for its respective class. For documentation of this type see the onliner class.
ITcoLogItem
This is onliner interface for its respective class. For documentation of this type see the onliner class.
ITcoMessage
This is onliner interface for its respective class. For documentation of this type see the onliner class.
ITcoMessageDigest
This is onliner interface for its respective class. For documentation of this type see the onliner class.
ITcoMessenger
This is onliner interface for its respective class. For documentation of this type see the onliner class.
ITcoMessengerEnv
This is onliner interface for its respective class. For documentation of this type see the onliner class.
ITcoMomentaryTask
This is onliner interface for its respective class. For documentation of this type see the onliner class.
ITcoObject
This is onliner interface for its respective class. For documentation of this type see the onliner class.
ITcoParentedStructure
This is onliner interface for its respective class. For documentation of this type see the onliner class.
ITcoRemoteTask
This is onliner interface for its respective class. For documentation of this type see the onliner class.
ITcoRtc
This is onliner interface for its respective class. For documentation of this type see the onliner class.
ITcoSequence
This is onliner interface for its respective class. For documentation of this type see the onliner class.
ITcoSequencer
This is onliner interface for its respective class. For documentation of this type see the onliner class.
ITcoSequencerBase
This is onliner interface for its respective class. For documentation of this type see the onliner class.
ITcoSequencerModeController
This is onliner interface for its respective class. For documentation of this type see the onliner class.
ITcoSequencerObserver
This is onliner interface for its respective class. For documentation of this type see the onliner class.
ITcoSignalInfo
This is onliner interface for its respective class. For documentation of this type see the onliner class.
ITcoState
This is onliner interface for its respective class. For documentation of this type see the onliner class.
ITcoStateBase
This is onliner interface for its respective class. For documentation of this type see the onliner class.
ITcoStateExtendible
This is onliner interface for its respective class. For documentation of this type see the onliner class.
ITcoStruct
This is onliner interface for its respective class. For documentation of this type see the onliner class.
ITcoTask
This is onliner interface for its respective class. For documentation of this type see the onliner class.
ITcoTaskResult
This is onliner interface for its respective class. For documentation of this type see the onliner class.
ITcoTcoSequencerObserverDummy
This is onliner interface for its respective class. For documentation of this type see the onliner class.
ITcoTier
This is onliner interface for its respective class. For documentation of this type see the onliner class.
ITcoToggleTask
This is onliner interface for its respective class. For documentation of this type see the onliner class.
Enums
eDialogAnswer
eDialogType
eMessageCategory
Message categories.
eMessageCondition
eMessageDigestMethod
Message digest methods used to create fingerprint of a message.
eMessengerLogMethod
Message logging method. Determines how the messages will be pushed to the log buffer.
eRestoreMode
Activates automatic restore mechanism for all immediate children (direct members).
eSequencerError
Describes cause of the sequencer error.
eSequencerMode
Modes of the sequencer.
eStepIdUniquenessControlState
eStepStatus
Describes the step status inside the sequencer.
eTaskState
Describes the state of the respective task.