Skip to content

Commit f768fbc

Browse files
authored
Merge pull request #1061 from Inxton/controller-logger-updates-rep
controller logger updates rep
2 parents 5c81766 + c9cab09 commit f768fbc

51 files changed

Lines changed: 1239 additions & 376 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.config/dotnet-tools.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"isRoot": true,
44
"tools": {
55
"AXSharp.ixc": {
6-
"version": "0.47.0-alpha.439",
6+
"version": "0.47.0-alpha.452",
77
"commands": [
88
"ixc"
99
],
@@ -17,14 +17,14 @@
1717
"rollForward": false
1818
},
1919
"AXSharp.ixd": {
20-
"version": "0.47.0-alpha.439",
20+
"version": "0.47.0-alpha.452",
2121
"commands": [
2222
"ixd"
2323
],
2424
"rollForward": false
2525
},
2626
"AXSharp.ixr": {
27-
"version": "0.47.0-alpha.439",
27+
"version": "0.47.0-alpha.452",
2828
"commands": [
2929
"ixr"
3030
],

CHANGELOG.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,41 @@
1+
### [CORE] Controller logger updates ([#1054](https://github.com/Inxton/AXOpen/pull/1054))
2+
3+
**Note:** Enhanced logging and messaging capabilities with new message categories and requalification features.
4+
5+
- feat: Added new `Potential` message category (severity level 150) for messages that may escalate to warnings or errors
6+
- feat: Introduced message requalification system via `RequalifyDownstreamMessages()` to allow downstream message category promotion
7+
- feat: Added `_messageCode` parameter to logger methods for improved message tracking and identification
8+
- feat: Implemented step timeout detection in `AxoSequencer` with automatic error message generation
9+
- feat: Enhanced `AxoMessageProvider` and `Flattener` to support configurable observation depth
10+
- refactor: Standardized severity localization keys (simplified from "SeverityInfo" to "Info", etc.)
11+
- refactor: Updated AxoMessenger logging signatures to use rise/fall signature markers for clarity
12+
- chore: Bumped AXSharp packages to 0.47.0-alpha.452 and Siemens.Simatic.S7.Webserver.API to 3.3.24
13+
14+
**Impact:**
15+
- Enables intermediate message categorization before escalation to warnings or errors
16+
- Improves diagnostics through message code tracking and step timeout detection
17+
- Provides better control over message severity in distributed systems
18+
- Simplifies localization maintenance with consistent key naming
19+
20+
**New Message Categories:**
21+
- `None` (0): No category; ignore non-critical messages
22+
- `Info` (100): Informative messages with minimal impact
23+
- `Potential` (150): Potential problems that may escalate (automatically requalified if configured)
24+
- `Warning` (200): Possible problems affecting the process
25+
- `Error` (300): Failures requiring intervention
26+
- `Critical` (400): Critical system failures
27+
- `ProgrammingError` (500): Implementation/configuration errors
28+
29+
**Risks/Review:**
30+
- Existing code using old severity localization keys should be updated to use new simplified keys
31+
- Message requalification logic should be tested in environments with coordinated components
32+
- Step timeout thresholds should be validated for application-specific timing requirements
33+
34+
**Testing:**
35+
- Unit tests for message requalification across all categories
36+
- Integration tests for step timeout scenarios in sequencers
37+
- Localization verification for all supported languages
38+
139
### [INTEGRATIONS] Additional alignments with application template ([#768](https://github.com/Inxton/AXOpen/pull/768))
240

341
**Note:** Namespace and component renames require consumers to update imports, templates, and generated UI bindings before upgrading.

Directory.Packages.props

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
<!-- Framework-Agnostic Packages -->
1212
<ItemGroup>
1313
<!-- AX# Libraries -->
14-
<PackageVersion Include="AXSharp.Abstractions" Version="0.47.0-alpha.456" />
15-
<PackageVersion Include="AXSharp.Connector" Version="0.47.0-alpha.456" />
16-
<PackageVersion Include="AXSharp.Connector.S71500.WebAPI" Version="0.47.0-alpha.456" />
17-
<PackageVersion Include="AXSharp.Presentation.Blazor" Version="0.47.0-alpha.456" />
18-
<PackageVersion Include="AXSharp.Presentation.Blazor.Controls" Version="0.47.0-alpha.456" />
19-
<PackageVersion Include="Inxton.Operon" Version="0.3.0-alpha.133" />
14+
<PackageVersion Include="AXSharp.Abstractions" Version="0.47.0-alpha.452" />
15+
<PackageVersion Include="AXSharp.Connector" Version="0.47.0-alpha.452" />
16+
<PackageVersion Include="AXSharp.Connector.S71500.WebAPI" Version="0.47.0-alpha.452" />
17+
<PackageVersion Include="AXSharp.Presentation.Blazor" Version="0.47.0-alpha.452" />
18+
<PackageVersion Include="AXSharp.Presentation.Blazor.Controls" Version="0.47.0-alpha.452" />
19+
<PackageVersion Include="Inxton.Operon" Version="0.3.0-alpha.114" />
2020
<!-- Data & Serialization -->
2121
<PackageVersion Include="ClosedXML" Version="0.105.0" />
2222
<PackageVersion Include="Microsoft.Build" Version="18.0.2" />
@@ -40,7 +40,7 @@
4040
<PackageVersion Include="Serilog" Version="4.3.0" />
4141
<PackageVersion Include="Serilog.Sinks.Console" Version="6.0.0" />
4242
<!-- Hardware & Devices -->
43-
<PackageVersion Include="Siemens.Simatic.S7.Webserver.API" Version="3.3.3" />
43+
<PackageVersion Include="Siemens.Simatic.S7.Webserver.API" Version="3.3.24" />
4444
<!-- Testing - Core -->
4545
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
4646
<PackageVersion Include="NSubstitute" Version="5.3.0" />

docfx/articles/guidelines/components.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,30 @@ Components should surface diagnostic and alarm information consistently:
123123

124124
For UI auto‑rendering the alarm level icons provided by `AxoComponent` will reflect the highest active severity; ensure warnings are deactivated when condition clears to avoid stale visualization.
125125

126+
### Message Categories
127+
128+
The framework supports the following message categories (in order of severity):
129+
130+
* **None** (0): No category; used to clear requalification directives and ignore non-critical messages
131+
* **Info** (100): Informative messages with minimal impact; do not require operator intervention
132+
* **Potential** (150): Potential problems that may escalate to Warning or Error states; these messages can be automatically requalified based on system configuration when downstream conditions are detected
133+
* **Warning** (200): Possible problems that may adversely affect a process; information to help identify problems but does not necessarily stop the process
134+
* **Error** (300): Failures that cannot be immediately recovered; intervention is needed
135+
* **Critical** (400): Critical system failures
136+
* **ProgrammingError** (500): Implementation or configuration errors in the application
137+
138+
When using the `Potential` category, ensure that the parent context or sequencer is configured with appropriate requalification rules to escalate potential issues to `Warning` or `Error` when conditions persist.
139+
140+
### Message Requalification
141+
142+
For coordinated components and sequencers, message requalification allows upstream components to influence downstream message severity. Use `GetMessengerService().RequalifyDownstreamMessages(category)` to set the requalification category. This is particularly useful for:
143+
144+
* Escalating `Potential` messages to `Warning` or `Error` based on elapsed time
145+
* Implementing hierarchical error response strategies in multi-step workflows
146+
* Ensuring consistent severity handling across component hierarchies
147+
148+
Note: Only `Potential` messages are subject to requalification; other categories retain their configured severity.
149+
126150

127151
## Documentation requirements
128152

src/abstractions/ctrl/src/AxoLogger/IAxoLogger.st

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ NAMESPACE AXOpen.Logging
2525
/// _message is a string of maximum 80 characters that represents the log message
2626
/// </summary>
2727
_message : STRING[80];
28-
28+
2929
/// <summary>
3030
/// _level is an instance of eLogLevel that represents the level of the log
3131
/// </summary>
@@ -35,6 +35,11 @@ NAMESPACE AXOpen.Logging
3535
/// _sender is an instance of IAxoObject that represents the sender of the log
3636
/// </summary>
3737
_sender : IAxoObject;
38+
39+
/// <summary>
40+
/// _messageCode is an unsigned long integer that represents the code of the log message
41+
/// </summary>
42+
_messageCode : ULINT;
3843
END_VAR
3944
END_METHOD
4045

src/abstractions/ctrl/src/AxoMessenger/IAxoMessengerService.st

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,37 @@ NAMESPACE AXOpen.Core
55
inMessegenger : IAxoMessenger;
66
END_VAR
77
END_METHOD
8+
/// <summary>
9+
/// Suspends the messaging system. When suspended, messages will not be sent to subscribers until the system is resumed.
10+
/// This is useful for scenarios where you want to temporarily prevent messages from being processed.
11+
/// </summary>
812
METHOD SuspendMessaging END_METHOD
13+
14+
/// <summary>
15+
/// Resumes the messaging system. When resumed, messages that arose while the system was suspended will NOT be sent to subscribers.
16+
/// </summary>
917
METHOD ResumeMessaging END_METHOD
18+
19+
/// <summary>
20+
/// Checks if the messaging system is currently suspended.
21+
/// Returns true if the messaging system is suspended, false otherwise.
22+
/// </summary>
1023
METHOD IsSuspended : BOOL END_METHOD
24+
25+
/// <summary>
26+
/// Requalifies the message category for downstream messages.
27+
/// This is used to ensure that messages that are sent from a downstream component are categorized correctly,
28+
/// even if the upstream component has a different message category.
29+
/// </summary>
30+
METHOD RequalifyDownstreamMessages
31+
VAR_INPUT
32+
inMessageCategory : AXOpen.Messaging.eAxoMessageCategory;
33+
END_VAR
34+
END_METHOD
35+
36+
/// <summary>
37+
/// Gets the requalified message category for downstream messages.
38+
/// </summary>
39+
METHOD GetRequalifiedMessageCategory : AXOpen.Messaging.eAxoMessageCategory END_METHOD
1140
END_INTERFACE
1241
END_NAMESPACE

src/core/ctrl/src/AxoMessaging/eAxoMessageCategory.st renamed to src/abstractions/ctrl/src/AxoMessenger/eAxoMessageCategory.st

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,36 @@ NAMESPACE AXOpen.Messaging
55
/// ATTENTION: Values must be multiply of 100
66
///</summary>
77
eAxoMessageCategory : INT
8-
(
8+
(
9+
///<summary>
10+
/// No category.
11+
/// This is used to indicate that the message does not have any importance and should be ignored by the system.
12+
/// Do not use this category for messages that have to be delivered to the user, even if such information is not critical.
13+
/// </summary>
14+
None := 0,
15+
16+
917
///<summary>
1018
/// Info message.
1119
/// Use when you want to deliver information to the user, that has only informative character and does not adversely affect a process.
1220
///</summary>
1321
Info := 100,
14-
22+
23+
///<summary>
24+
/// Potential problem message.
25+
/// Use this category when you want to report to the user an information about a potential problem, that does not necessarily affect a process
26+
/// but may cause a problem. This is typically used when certain conditions is expected to happen within a process that did not happen yet,
27+
/// this category is aimed to be later automatically requalified to Warning or Error by coordination primitive if the expected conditions did not happen within expected time.
28+
///</summary>
29+
Potential := 150,
30+
1531
///<summary>
1632
/// Warning message.
1733
/// Use this category when you want to report to the user an information about a possible problem, that may adversly affect a process.
1834
/// Information in this cateogory aims to help the user to identify a problem, the cause of such problem does not necessarily stops the process.
1935
///</summary>
2036
Warning := 200,
21-
37+
2238
///<summary>
2339
/// Error message.
2440
/// Use this category when there is a failure that cannot be immediately recovered and an intervention is needed. This is typically a situation when a device fails

src/components.elements/ctrl/test/Mock.st

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,16 @@ NAMESPACE AXOpen.Components.Elements.Tests
6767
END_VAR
6868
;
6969
END_METHOD
70+
71+
METHOD PUBLIC Log
72+
VAR_INPUT
73+
_message : STRING[80];
74+
_level : eLogLevel;
75+
_sender : IAxoObject;
76+
_messageCode : ULINT;
77+
END_VAR
78+
79+
;
80+
END_METHOD
7081
END_CLASS
7182
END_NAMESPACE

src/components.pneumatics/ctrl/src/AxoCylinder.st

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ NAMESPACE AXOpen.Components.Pneumatics
115115
116116
_Messenger.Serve(THIS);
117117
118-
_Messenger.ActivateOnCondition(UINT#3, _OutSensor AND _InSensor, eAxoMessageCategory#Error);
118+
_Messenger.ActivateOnCondition(UINT#3, _OutSensor AND _InSensor, eAxoMessageCategory#Warning);
119119
120120
IF(_StopTask.Execute(THIS)) THEN
121121
_MoveInSignal := FALSE;
@@ -136,9 +136,10 @@ NAMESPACE AXOpen.Components.Pneumatics
136136
137137
_MoveToOutIsBusy := _MoveOutTask.IsBusy();
138138
139-
_Messenger.ActivateOnCondition(UINT#1, (_MoveToOutIsBusy AND NOT _MoveToOutIsSuspended AND _MoveOutTask.Duration >= T#10S), eAxoMessageCategory#Error);
140-
_Messenger.ActivateOnCondition(UINT#9, (_MoveOutTask.IsDone() AND NOT _OutSensor), eAxoMessageCategory#Warning);
141-
139+
IF(NOT _MoveToOutIsSuspended AND NOT THIS._MoveOutTask.IsDisabled) THEN
140+
_Messenger.ActivateOnCondition(UINT#1, (_MoveToOutIsBusy AND NOT _MoveToOutIsSuspended), eAxoMessageCategory#Potential);
141+
_Messenger.ActivateOnCondition(UINT#9, (_MoveOutTask.IsDone() AND NOT _OutSensor), eAxoMessageCategory#Potential);
142+
END_IF;
142143
143144
IF(_MoveInTask.Execute(THIS)) THEN
144145
IF(_MoveInTask.IsFirstExecutionCycle()) THEN
@@ -151,8 +152,10 @@ NAMESPACE AXOpen.Components.Pneumatics
151152
152153
_MoveToInIsBusy := _MoveInTask.IsBusy();
153154
154-
_Messenger.ActivateOnCondition(UINT#2, (_MoveToInIsBusy AND NOT _MoveToInIsSuspended AND _MoveInTask.Duration >= T#10S), eAxoMessageCategory#Error);
155-
_Messenger.ActivateOnCondition(UINT#8, (_MoveInTask.IsDone() AND NOT _InSensor), eAxoMessageCategory#Warning);
155+
IF(NOT _MoveToInIsSuspended AND NOT THIS._MoveInTask.IsDisabled) THEN
156+
_Messenger.ActivateOnCondition(UINT#2, (_MoveToInIsBusy AND NOT _MoveToInIsSuspended), eAxoMessageCategory#Potential);
157+
_Messenger.ActivateOnCondition(UINT#8, (_MoveInTask.IsDone() AND NOT _InSensor), eAxoMessageCategory#Potential);
158+
END_IF;
156159
157160
158161
outMoveInSignal := _MoveInSignal AND NOT _MoveToInIsSuspended;

0 commit comments

Comments
 (0)