Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cyclic read and bug fixes #2170

Merged
merged 39 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
2cc7e13
Fix authorization required
marcschier Jan 18, 2024
0e49330
Formatting
marcschier Jan 18, 2024
8762f21
Model changes
marcschier Jan 24, 2024
c9712b5
Disable swagger and test for bad heartbeat
marcschier Jan 25, 2024
bdd56a9
Use monitored items in subscription during synchronization
marcschier Jan 25, 2024
2a12ee0
Fix pipeline
marcschier Jan 25, 2024
9fcc76a
Fix ordered metadata
marcschier Jan 26, 2024
02edae3
Fix MI sync
marcschier Jan 26, 2024
4452c9c
.net UA 1.5 stack preview
marcschier Jan 26, 2024
9be2ecf
Reset error counter
marcschier Jan 26, 2024
96cf953
Improved API
marcschier Jan 27, 2024
fc1dd0d
Fix site id
marcschier Jan 28, 2024
8c86c80
Fix assert and cleanup
marcschier Jan 29, 2024
11fdfef
Fix 2
marcschier Jan 29, 2024
41d9153
Update dependencies
marcschier Jan 29, 2024
16f148b
Defensive
marcschier Jan 29, 2024
bd045b7
Throw when client is disposed.
marcschier Jan 29, 2024
deb32c6
Fix session and subscription closing/dispose
marcschier Jan 29, 2024
8a5534f
Logs
marcschier Jan 29, 2024
e971756
Fix
marcschier Jan 30, 2024
1d0a756
Group sampled nodes per subscription and allow overriding limits
marcschier Jan 30, 2024
1bdcfb4
Docs
marcschier Jan 30, 2024
9b0c393
update
marcschier Jan 31, 2024
7a2f958
Disable log errors
marcschier Jan 31, 2024
5af31c6
Fix error
marcschier Jan 31, 2024
d1b1f6f
More assertions
marcschier Jan 31, 2024
92e59e9
Wait until mqtt server is started.
marcschier Jan 31, 2024
f9f8167
update
marcschier Jan 31, 2024
7743565
Update2
marcschier Feb 1, 2024
ec904e9
KA settings
marcschier Feb 1, 2024
5d6474d
Full dump
marcschier Feb 1, 2024
1011185
Stop keep alive on dispose
marcschier Feb 1, 2024
4ca96ed
Revert lock
marcschier Feb 1, 2024
ca67585
Revert timeout
marcschier Feb 1, 2024
7898321
Extra diag for cyclic reads
marcschier Feb 2, 2024
1f4cd7a
Disable flaky test
marcschier Feb 2, 2024
5b3843c
Formatting
marcschier Feb 2, 2024
a30c337
update
marcschier Feb 2, 2024
8d50f02
Formatting docs
marcschier Feb 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions common.props
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
<!--<TreatWarningsAsErrors>true</TreatWarningsAsErrors>-->
</PropertyGroup>
<ItemGroup Condition="$(NO_RCS) == ''">
<PackageReference Include="Roslynator.Analyzers" Version="4.9.0" PrivateAssets="All"/>
<PackageReference Include="Roslynator.Formatting.Analyzers" Version="4.9.0" PrivateAssets="All"/>
<PackageReference Include="Roslynator.Analyzers" Version="4.10.0" PrivateAssets="All"/>
<PackageReference Include="Roslynator.Formatting.Analyzers" Version="4.10.0" PrivateAssets="All"/>
</ItemGroup>
<!-- only create the SARIF files for the SDL build step in cloud builds -->
<PropertyGroup Condition="'$(NBGV_NugetPackageVersion)' != ''">
Expand Down
49 changes: 49 additions & 0 deletions docs/opc-publisher/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,55 @@ Stop publishing values from a node on the specified server. The group field that
* `application/x-msgpack`


<a name="diagnostics_resource"></a>
### Diagnostics
<br>
This section lists the diagnostics APi provided by OPC Publisher providing
connection related diagnostics API methods.

<br>
The method name for all transports other than HTTP (which uses the shown
HTTP methods and resource uris) is the name of the subsection header.
To use the version specific method append "_V1" or "_V2" to the method
name.


<a name="resetallclients"></a>
#### ResetAllClients
```
GET /v2/reset
```


##### Description
Can be used to reset all established connections causing a full reconnect and recreate of all subscriptions.


##### Responses

|HTTP Code|Description|Schema|
|---|---|---|
|**200**|Success|No Content|


<a name="settracemode"></a>
#### SetTraceMode
```
GET /v2/tracemode
```


##### Description
Can be used to set trace mode for all established connections. Call within a minute to keep trace mode up or else trace mode will be disabled again after 1 minute. Enabling and resetting tracemode will cause a reconnect of the client.


##### Responses

|HTTP Code|Description|Schema|
|---|---|---|
|**200**|Success|No Content|


<a name="discovery_resource"></a>
### Discovery
<br>OPC UA and network discovery related API.
Expand Down
33 changes: 23 additions & 10 deletions docs/opc-publisher/commandline.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@ The following OPC Publisher configuration can be applied by Command Line Interfa
When both environment variable and CLI argument are provided, the command line option will override the environment variable.

```text

██████╗ ██████╗ ██████╗ ██████╗ ██╗ ██╗██████╗ ██╗ ██╗███████╗██╗ ██╗███████╗██████╗
██╔═══██╗██╔══██╗██╔════╝ ██╔══██╗██║ ██║██╔══██╗██║ ██║██╔════╝██║ ██║██╔════╝██╔══██╗
██║ ██║██████╔╝██║ ██████╔╝██║ ██║██████╔╝██║ ██║███████╗███████║█████╗ ██████╔╝
██║ ██║██╔═══╝ ██║ ██╔═══╝ ██║ ██║██╔══██╗██║ ██║╚════██║██╔══██║██╔══╝ ██╔══██╗
╚██████╔╝██║ ╚██████╗ ██║ ╚██████╔╝██████╔╝███████╗██║███████║██║ ██║███████╗██║ ██║
╚═════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝╚═╝╚══════╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
2.9.4 (.NET 8.0.1/win-x64/OPC Stack 1.4.372.116)
2.9.4 (.NET 8.0.1/win-x64/OPC Stack 1.5.373.3)

General
-------
Expand Down Expand Up @@ -71,7 +70,7 @@ General
--doa, --disableopenapi, --DisableOpenApiEndpoint[=VALUE]
Disable the OPC Publisher Open API endpoint
exposed by the built-in HTTP server.
Default: `enabled`.
Default: `False` (enabled).

Messaging configuration
-----------------------
Expand Down Expand Up @@ -537,20 +536,25 @@ Subscription settings
Also can be set using `DefaultHeartbeatInterval`
environment variable in the form of a duration
string in the form `[d.]hh:mm:ss[.fffffff]`.
--ucr, --usecyclicreads, --DefaultSamplingUsingCyclicRead[=VALUE]
All nodes should be sampled using periodical
client reads instead of subscriptions services,
unless otherwise configured.
Default: `false`.
--da, --deferredacks, --UseDeferredAcknoledgements[=VALUE]
(Experimental) Acknoledge subscription
notifications only when the data has been
successfully published.
Default: `false`.
--rbp, --rebrowseperiod, --DefaultRebrowsePeriod=VALUE
(Experimental) The default time to wait until the
address space model is browsed again when
generating model change notifications.
Default: `12:00:00`.
--sqp, --sequentialpublishing, --EnableSequentialPublishing[=VALUE]
(Experimental) Explicitly disable or enable
sequential publishing.
Default: `true` (enabled).
--ucr, --usecyclicreads, --DefaultSamplingUsingCyclicRead[=VALUE]
(Experimental) All nodes should be sampled using
periodical client reads instead of subscriptions
services, unless otherwise configured.
Default: `false`.
--urc, --usereverseconnect, --DefaultUseReverseConnect[=VALUE]
(Experimental) Use reverse connect for all
endpoints that are part of the subscription
Expand Down Expand Up @@ -614,6 +618,16 @@ OPC UA Client configuration
The port to use when accepting inbound reverse
connect requests from servers.
Default: `4840`.
--mnr, --maxnodesperread, --MaxNodesPerReadOverride=VALUE
Limit max number of nodes to read in a single read
request when batching reads or the server limit
if less.
Default: `0` (using server limit).
--mnb, --maxnodesperbrowse, --MaxNodesPerBrowseOverride=VALUE
Limit max number of nodes per browse request when
batching browse operations or the server limit
if less.
Default: `0` (using server limit).
--mpr, --minpublishrequests, --MinPublishRequests=VALUE
Minimum number of publish requests to queue once
subscriptions are created in the session.
Expand Down Expand Up @@ -807,8 +821,7 @@ Diagnostic options
`None`
Default: `Information`.
--lfm, --logformat, --LogFormat=VALUE
The logging format to use when writing to the
console.
The log format to use when writing to the console.
Allowed values:
`simple`
`syslog`
Expand Down
39 changes: 34 additions & 5 deletions docs/opc-publisher/definitions.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,10 @@ Attribute to read
Attribute value read


|Name|Schema|
|---|---|
|**errorInfo** <br>*optional*|[ServiceResultModel](definitions.md#serviceresultmodel)|
|Name|Description|Schema|
|---|---|---|
|**errorInfo** <br>*optional*||[ServiceResultModel](definitions.md#serviceresultmodel)|
|**value** <br>*optional*|Attribute value|object|


<a name="attributewriterequestmodel"></a>
Expand All @@ -97,6 +98,7 @@ Attribute and value to write to it
|---|---|---|
|**attribute** <br>*required*||[NodeAttribute](definitions.md#nodeattribute)|
|**nodeId** <br>*required*|Node to write to (mandatory) <br>**Minimum length** : `1`|string|
|**value** <br>*required*|Value to write (mandatory)|object|


<a name="attributewriteresponsemodel"></a>
Expand All @@ -116,6 +118,7 @@ Authentication Method model

|Name|Description|Schema|
|---|---|---|
|**configuration** <br>*optional*|Method specific configuration|object|
|**credentialType** <br>*optional*||[CredentialType](definitions.md#credentialtype)|
|**id** <br>*required*|Method id <br>**Minimum length** : `1`|string|
|**securityPolicy** <br>*optional*|Security policy to use when passing credential.|string|
Expand Down Expand Up @@ -703,6 +706,7 @@ Filter operand
|**index** <br>*optional*|Element reference in the outer list if<br>operand is an element operand|integer (int64)|
|**indexRange** <br>*optional*|Index range of attribute operand|string|
|**nodeId** <br>*optional*|Type definition node id if operand is<br>simple or full attribute operand.|string|
|**value** <br>*optional*|Variant value if operand is a literal|object|


<a name="filteroperatortype"></a>
Expand Down Expand Up @@ -743,7 +747,10 @@ Heartbeat behavior
### HistoricEventModel
Historic event

*Type* : object

|Name|Description|Schema|
|---|---|---|
|**eventFields** <br>*optional*|The selected fields of the event|object|


<a name="historiceventmodelarrayhistoryreadnextresponsemodel"></a>
Expand Down Expand Up @@ -791,6 +798,7 @@ Historic data
|**sourcePicoseconds** <br>*optional*|Additional resolution for the source timestamp.|integer (int32)|
|**sourceTimestamp** <br>*optional*|The source timestamp associated with the value.|string (date-time)|
|**status** <br>*optional*||[ServiceResultModel](definitions.md#serviceresultmodel)|
|**value** <br>*optional*|The value of data value.|object|


<a name="historicvaluemodelarrayhistoryreadnextresponsemodel"></a>
Expand Down Expand Up @@ -990,6 +998,7 @@ Method argument model
|Name|Description|Schema|
|---|---|---|
|**dataType** <br>*optional*|Data type Id of the value (from meta data)|string|
|**value** <br>*optional*|Initial value or value to use|object|


<a name="methodcallrequestmodel"></a>
Expand Down Expand Up @@ -1039,6 +1048,7 @@ Method argument metadata model
|Name|Description|Schema|
|---|---|---|
|**arrayDimensions** <br>*optional*|Optional Array dimension of argument|integer (int64)|
|**defaultValue** <br>*optional*|Default value for the argument|object|
|**description** <br>*optional*|Optional description of argument|string|
|**errorInfo** <br>*optional*||[ServiceResultModel](definitions.md#serviceresultmodel)|
|**name** <br>*optional*|Name of the argument|string|
Expand Down Expand Up @@ -1096,6 +1106,16 @@ Result of method metadata query
|**outputArguments** <br>*optional*|output argument meta data|< [MethodMetadataArgumentModel](definitions.md#methodmetadataargumentmodel) > array|


<a name="modelchangehandlingoptionsmodel"></a>
### ModelChangeHandlingOptionsModel
Describes how model changes are published


|Name|Description|Schema|
|---|---|---|
|**rebrowseIntervalTimespan** <br>*optional*|Rebrowse period|string (date-span)|


<a name="modificationinfomodel"></a>
### ModificationInfoModel
Modification information
Expand Down Expand Up @@ -1219,6 +1239,7 @@ Node model
|**children** <br>*optional*|Whether node has children which are defined as<br>any forward hierarchical references.<br>(default: unknown)|boolean|
|**containsNoLoops** <br>*optional*|Whether a view contains loops. Null if<br>not a view.|boolean|
|**dataType** <br>*optional*|If variable the datatype of the variable.<br>(default: null)|string|
|**dataTypeDefinition** <br>*optional*|Data type definition in case node is a<br>data type node and definition is available,<br>otherwise null.|object|
|**description** <br>*optional*|Description if any|string|
|**displayName** <br>*optional*|Display name|string|
|**errorInfo** <br>*optional*||[ServiceResultModel](definitions.md#serviceresultmodel)|
Expand All @@ -1241,6 +1262,7 @@ Node model
|**userExecutable** <br>*optional*|If method node class, whether method can<br>be called by current user.<br>(default: false if not executable)|boolean|
|**userRolePermissions** <br>*optional*|User Role permissions|< [RolePermissionModel](definitions.md#rolepermissionmodel) > array|
|**userWriteMask** <br>*optional*|User write mask for the node<br>(default: 0)|integer (int64)|
|**value** <br>*optional*|Value of variable or default value of the<br>subtyped variable in case node is a variable<br>type, otherwise null.|object|
|**valueRank** <br>*optional*||[NodeValueRank](definitions.md#nodevaluerank)|
|**writeMask** <br>*optional*|Default write mask for the node<br>(default: 0)|integer (int64)|

Expand Down Expand Up @@ -1316,6 +1338,7 @@ Describing an entry in the node list
|**HeartbeatIntervalTimespan** <br>*optional*|Heartbeat interval as TimeSpan.|string (date-span)|
|**Id** <br>*optional*|Node Identifier|string|
|**IndexRange** <br>*optional*|Index range to read, default to null.|string|
|**ModelChangeHandling** <br>*optional*||[ModelChangeHandlingOptionsModel](definitions.md#modelchangehandlingoptionsmodel)|
|**OpcPublishingInterval** <br>*optional*|Publishing interval in milliseconds|integer (int32)|
|**OpcPublishingIntervalTimespan** <br>*optional*|OpcPublishingInterval as TimeSpan.|string (date-span)|
|**OpcSamplingInterval** <br>*optional*|Sampling interval in milliseconds|integer (int32)|
Expand Down Expand Up @@ -1568,7 +1591,7 @@ Contains the nodes which should be published
|**BatchTriggerIntervalTimespan** <br>*optional*|Send network messages at the specified publishing<br>interval.<br>Takes precedence over Azure.IIoT.OpcUa.Publisher.Models.PublishedNodesEntryModel.BatchTriggerInterval<br>if defined.|string (date-span)|
|**DataSetClassId** <br>*optional*|A dataset class id.|string (uuid)|
|**DataSetDescription** <br>*optional*|The optional description of the dataset.|string|
|**DataSetExtensionFields** <br>*optional*|Optional field and value pairs to insert into the<br>data sets emitted by data set writer.|object|
|**DataSetExtensionFields** <br>*optional*|Optional field and value pairs to insert into the<br>data sets emitted by data set writer.|< string, object > map|
|**DataSetKeyFrameCount** <br>*optional*|Insert a key frame every x messages|integer (int64)|
|**DataSetName** <br>*optional*|The optional short name of the dataset.|string|
|**DataSetPublishingInterval** <br>*optional*|The Publishing interval for a dataset writer<br>in miliseconds.|integer (int32)|
Expand Down Expand Up @@ -2207,6 +2230,7 @@ Value read response model
|**serverTimestamp** <br>*optional*|Timestamp of when value was read at server.|string (date-time)|
|**sourcePicoseconds** <br>*optional*|Pico seconds part of when value was read at source.|integer (int32)|
|**sourceTimestamp** <br>*optional*|Timestamp of when value was read at source.|string (date-time)|
|**value** <br>*optional*|Value read|object|


<a name="valuewriterequestmodel"></a>
Expand All @@ -2221,6 +2245,7 @@ Value write request model
|**header** <br>*optional*||[RequestHeaderModel](definitions.md#requestheadermodel)|
|**indexRange** <br>*optional*|Index range to write|string|
|**nodeId** <br>*optional*|Node id to write value to.|string|
|**value** <br>*required*|Value to write. The system tries to convert<br>the value according to the data type value,<br>e.g. convert comma seperated value strings<br>into arrays. (Mandatory)|object|


<a name="valuewriterequestmodelrequestenvelope"></a>
Expand Down Expand Up @@ -2267,6 +2292,7 @@ History read continuation result
|---|---|---|
|**continuationToken** <br>*optional*|Continuation token if more results pending.|string|
|**errorInfo** <br>*optional*||[ServiceResultModel](definitions.md#serviceresultmodel)|
|**history** <br>*optional*|History as json encoded extension object|object|


<a name="variantvaluehistoryreadrequestmodel"></a>
Expand All @@ -2277,6 +2303,7 @@ Request node history read
|Name|Description|Schema|
|---|---|---|
|**browsePath** <br>*optional*|An optional path from NodeId instance to<br>the actual node.|< string > array|
|**details** <br>*required*|The HistoryReadDetailsType extension object<br>encoded in json and containing the tunneled<br>Historian reader request.|object|
|**header** <br>*optional*||[RequestHeaderModel](definitions.md#requestheadermodel)|
|**indexRange** <br>*optional*|Index range to read, e.g. 1:2,0:1 for 2 slices<br>out of a matrix or 0:1 for the first item in<br>an array, string or bytestring.<br>See 7.22 of part 4: NumericRange.|string|
|**nodeId** <br>*required*|Node to read from (mandatory) <br>**Minimum length** : `1`|string|
Expand Down Expand Up @@ -2305,6 +2332,7 @@ History read results
|---|---|---|
|**continuationToken** <br>*optional*|Continuation token if more results pending.|string|
|**errorInfo** <br>*optional*||[ServiceResultModel](definitions.md#serviceresultmodel)|
|**history** <br>*optional*|History as json encoded extension object|object|


<a name="variantvaluehistoryupdaterequestmodel"></a>
Expand All @@ -2315,6 +2343,7 @@ Request node history update
|Name|Description|Schema|
|---|---|---|
|**browsePath** <br>*optional*|An optional path from NodeId instance to<br>the actual node.|< string > array|
|**details** <br>*required*|The HistoryUpdateDetailsType extension object<br>encoded as json Variant and containing the tunneled<br>update request for the Historian server. The value<br>is updated at edge using above node address.|object|
|**header** <br>*optional*||[RequestHeaderModel](definitions.md#requestheadermodel)|
|**nodeId** <br>*required*|Node to update <br>**Minimum length** : `1`|string|

Expand Down
Loading