Class 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
Inheritance
Inherited Members
Namespace: PlcDocu.TcoCore
Assembly: TcoCoreConnector.dll
Syntax
public abstract class TcoMessenger
Constructors
| Improve this Doc View SourceTcoMessenger()
Prevents creating instance of this class via public constructor
Declaration
public TcoMessenger()
Fields
| Improve this Doc View Source_contextIdentity
Declaration
public object _contextIdentity
Field Value
Type | Description |
---|---|
System.Object |
_mime
Most important message of this instance of messenger; 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.
Declaration
public TcoMessage _mime
Field Value
Type | Description |
---|---|
TcoMessage |
_Parent
Declaration
public object _Parent
Field Value
Type | Description |
---|---|
System.Object |
MDS_MAX_INDEX
Declaration
public object MDS_MAX_INDEX
Field Value
Type | Description |
---|---|
System.Object |
Properties
| Improve this Doc View SourcePinned
Gets true
when this messanger is pinned (awaiting acknowledgement in diagnostics view).
Declaration
[IgnoreReflection]
public dynamic Pinned { get; }
Property Value
Type | Description |
---|---|
System.Object | Plc type BOOL; Twin type: Vortex.Connector.ValueTypes.OnlinerBool |
Methods
| Improve this Doc View SourceAppend(Object)
Appends string to the message text.
Declaration
[IgnoreReflection]
public dynamic Append(dynamic Text)
Parameters
Type | Name | Description |
---|---|---|
System.Object | Text | Plc type : STRING [VAR_INPUT]; Twin type : Vortex.Connector.ValueTypes.OnlinerString
|
Returns
Type | Description |
---|---|
System.Object | Plc type ITcoMessageTextBuilder; Twin type: |
Remarks
warning
The size of the resulting string should not be more than '160' characters. The characters exceeding this size will be truncated.
AppendAny(Object)
Appends any value to the message text.
Declaration
[IgnoreReflection]
public dynamic AppendAny(dynamic Data)
Parameters
Type | Name | Description |
---|---|---|
System.Object | Data | Plc type : ANY [VAR_INPUT]; Twin type :
|
Returns
Type | Description |
---|---|
System.Object | Plc type ITcoMessageTextBuilder; Twin type: |
Remarks
warning
The size of the resulting string should not be more than '160' characters. The characters exceeding this size will be truncated.
As()
Gets categorization methods for fluent message builder.
Declaration
[IgnoreReflection]
public dynamic As()
Returns
Type | Description |
---|---|
System.Object | Plc type ITcoMessageCategorize; Twin type: |
AsDebug()
Categotizes and creates the message as 'debug'.
Declaration
[IgnoreReflection]
public dynamic AsDebug()
Returns
Type | Description |
---|---|
System.Object | Plc type ITcoMessageProperties; Twin type: |
AsError()
Categotizes and creates the message as 'error'.
Declaration
[IgnoreReflection]
public dynamic AsError()
Returns
Type | Description |
---|---|
System.Object | Plc type ITcoMessageProperties; Twin type: |
AsFatal()
Categotizes and creates the message as 'fatal'.
Declaration
[IgnoreReflection]
public dynamic AsFatal()
Returns
Type | Description |
---|---|
System.Object | Plc type ITcoMessageProperties; Twin type: |
AsInfo()
Categotizes and creates the message as 'information'.
Declaration
[IgnoreReflection]
public dynamic AsInfo()
Returns
Type | Description |
---|---|
System.Object | Plc type ITcoMessageProperties; Twin type: |
AsTrace()
Categotizes and creates the message as 'trace'.
Declaration
[IgnoreReflection]
public dynamic AsTrace()
Returns
Type | Description |
---|---|
System.Object | Plc type ITcoMessageProperties; Twin type: |
AsWarning()
Categotizes and creates the message as 'warning'.
Declaration
[IgnoreReflection]
public dynamic AsWarning()
Returns
Type | Description |
---|---|
System.Object | Plc type ITcoMessageProperties; Twin type: |
Build()
Initiates new message text building for this messenger in fluent-like fashion.
Declaration
[IgnoreReflection]
public dynamic Build()
Returns
Type | Description |
---|---|
System.Object | Plc type ITcoMessageTextBuilder; Twin type: |
Catastrophic(Object)
Adds message of 'catastrophic' category to the message queue. Use this category when there is a situation when the device cannot continue operations due to irrecoverable failure.
Declaration
[IgnoreReflection]
public dynamic Catastrophic(dynamic Message)
Parameters
Type | Name | Description |
---|---|---|
System.Object | Message | Plc type : STRING [VAR_INPUT]; Twin type : Vortex.Connector.ValueTypes.OnlinerString
|
Returns
Type | Description |
---|---|
System.Object | Plc type ITcoMessageProperties; Twin type: |
Clear()
Clears the message content.
This method is exposed for Rpc calls, for testing purposes. Rpc calls of this method must not be used in production code
important
Declaration
[IgnoreReflection]
public void Clear()
Critical(Object)
Adds message of 'critical' category to the message queue. Use this category when a critical error occured, that is not recoverable by the means of software (reset/restore) and a detailed inspection is required.
Declaration
[IgnoreReflection]
public dynamic Critical(dynamic Message)
Parameters
Type | Name | Description |
---|---|---|
System.Object | Message | Plc type : STRING [VAR_INPUT]; Twin type : Vortex.Connector.ValueTypes.OnlinerString
|
Returns
Type | Description |
---|---|
System.Object | Plc type ITcoMessageProperties; Twin type: |
Debug(Object)
Adds message of 'debug' category to the message queue. Use when you need to report debug information for you as programmer.
Declaration
[IgnoreReflection]
public dynamic Debug(dynamic Message)
Parameters
Type | Name | Description |
---|---|---|
System.Object | Message | Plc type : STRING [VAR_INPUT]; Twin type : Vortex.Connector.ValueTypes.OnlinerString
|
Returns
Type | Description |
---|---|
System.Object | Plc type ITcoMessageProperties; Twin type: |
Error(Object)
Adds message of 'error' category to the message queue. Use this categoty when there is a failure that cannot be immediately recovered and an intervention is needed. This is typically a situation when a device fails to deliver expected result. Do not use this category to report information about failed process like measurement or detection.
Declaration
[IgnoreReflection]
public dynamic Error(dynamic Message)
Parameters
Type | Name | Description |
---|---|---|
System.Object | Message | Plc type : STRING [VAR_INPUT]; Twin type : Vortex.Connector.ValueTypes.OnlinerString
|
Returns
Type | Description |
---|---|
System.Object | Plc type ITcoMessageProperties; Twin type: |
Info(Object)
Adds message of 'information' category to the message queue. Use when you want to deliver information to the user, that has only informative character and does not adversely affect a process.
Declaration
[IgnoreReflection]
public dynamic Info(dynamic Message)
Parameters
Type | Name | Description |
---|---|---|
System.Object | Message | Plc type : STRING [VAR_INPUT]; Twin type : Vortex.Connector.ValueTypes.OnlinerString
|
Returns
Type | Description |
---|---|
System.Object | Plc type ITcoMessageProperties; Twin type: |
Notify(Object)
Adds message of 'notification' category to the message queue. Use this category when you want to report a notification that may be of interest to the user, but does not adveresly affect a process.
Declaration
[IgnoreReflection]
public dynamic Notify(dynamic Message)
Parameters
Type | Name | Description |
---|---|---|
System.Object | Message | Plc type : STRING [VAR_INPUT]; Twin type : Vortex.Connector.ValueTypes.OnlinerString
|
Returns
Type | Description |
---|---|
System.Object | Plc type ITcoMessageProperties; Twin type: |
Pin()
Pins this message that no other message will override it.
The messenger won't accept new messages until acknowledged in diagnostics view by user, unipenned by Unpin()
methods or cleared by Clear()
method
of this messenger.
Declaration
[IgnoreReflection]
public dynamic Pin()
Returns
Type | Description |
---|---|
System.Object | Plc type ITcoMessageProperties; Twin type: |
Post(Object, Object)
Creates message of given category for this messenger.
Declaration
[IgnoreReflection]
public dynamic Post(dynamic Message, dynamic Category)
Parameters
Type | Name | Description |
---|---|---|
System.Object | Message | Plc type : STRING [VAR_INPUT]; Twin type : Vortex.Connector.ValueTypes.OnlinerString
|
System.Object | Category | Plc type : eMessageCategory [VAR_INPUT]; Twin type :
|
Returns
Type | Description |
---|---|
System.Object | Plc type ITcoMessageProperties; Twin type: |
Programming(Object)
Adds message of 'programming error' category to the message queue. Use this category to inform about a possible programming error, defect in settings or missing information at a level of programming or system or process settings.
Declaration
[IgnoreReflection]
public dynamic Programming(dynamic Message)
Parameters
Type | Name | Description |
---|---|---|
System.Object | Message | Plc type : STRING [VAR_INPUT]; Twin type : Vortex.Connector.ValueTypes.OnlinerString
|
Returns
Type | Description |
---|---|
System.Object | Plc type ITcoMessageProperties; Twin type: |
Trace(Object)
Adds message of 'trace' category to the message queue. Use when you need to track detailed information about internal states of the program for detailed visibility. This is lowest level of category that can be used in production, for detailed observation of PLC program.
Declaration
[IgnoreReflection]
public dynamic Trace(dynamic Message)
Parameters
Type | Name | Description |
---|---|---|
System.Object | Message | Plc type : STRING [VAR_INPUT]; Twin type : Vortex.Connector.ValueTypes.OnlinerString
|
Returns
Type | Description |
---|---|
System.Object | Plc type ITcoMessageProperties; Twin type: |
UnPin()
Unpins this messenger.
Declaration
[IgnoreReflection]
public void UnPin()
Warning(Object)
Adds message of 'warning' category to the message queue. Use this category when you want to report to the user an information about a possible problem, that may adversly affect a process. Information in this cateogory aims to help the user to identify a problem, the cause of such problem does not necessarily stops the process.
Declaration
[IgnoreReflection]
public dynamic Warning(dynamic Message)
Parameters
Type | Name | Description |
---|---|---|
System.Object | Message | Plc type : STRING [VAR_INPUT]; Twin type : Vortex.Connector.ValueTypes.OnlinerString
|
Returns
Type | Description |
---|---|
System.Object | Plc type ITcoMessageProperties; Twin type: |