Files
Marc Schier 87012a147f Machinery: add bounded inspection and result transfers (#4804)
# Description

- Add opt-in bounded browsing and strict reads with original source,
status, timestamp, and structured-value evidence. Preserve the existing
tolerant constructors and convenience projections, and wire options
through session extensions, factories, and hosting registration.
- Add selected-result streaming downloads with byte/request limits and
independent cleanup, using `TemporaryFileTransferClient.CopyToAsync`
from the client/server predecessor. Retain the detailed transfer
regressions in the Machinery test layer.
- Expose genuinely null unpublished result slots, carry the two
Machinery sample updates, and include the complete Machinery guide and
package README changes.

## Related Issues

- Related tracking issue: #4461; this extraction does not close it.
- Frozen source PR: #4462; this extraction does not close or modify it.
- Immediate predecessor: #4803 (`marcschier-extract-amb-changes`). The
earlier dependencies are client/server #4802 and core/types #4801.

## Checklist

_Put an `x` in the boxes that apply. You can complete these step by step
after opening the PR._

- [ ] I have signed the
[CLA](https://opcfoundation.org/license/cla/ContributorLicenseAgreementv1.0.pdf)
and read the
[CONTRIBUTING](https://github.com/OPCFoundation/UA-.NETStandard/blob/master/CONTRIBUTING.md)
doc.
- [ ] I have added tests that prove my fix is effective or that my
feature works and increased code coverage.
- [x] I have added all necessary documentation.
- [x] I have verified that my changes do not introduce (new) build or
analyzer warnings.
- [ ] I ran **all** tests locally using the **UA.slnx** solution against
at least .net **framework** and .net **10**, and all passed.
- [ ] I fixed **all** failing and flaky tests in the CI pipelines and
**all** CodeQL warnings.
- [ ] I have addressed **all** PR feedback received.
2026-10-16 12:24:35 +02:00
..

OPC 40001 Machinery samples

Two console applications that show the whole OPC 40001 series end to end.

Sample What it does
MachineryServer Serves one simulated hydraulic press with every part of the series
MachineryClient Walks the Machines folder, prints what it finds, downloads a result and streams state

Run them in two terminals:

dotnet run --project samples/Machinery/MachineryServer -- --port 62546
dotnet run --project samples/Machinery/MachineryClient -- --insecure

The client prints something like:

Machine 12:HydraPress-1 (ns=12;i=1)
  Acme Machine Tools HydraPress 500 — serial HP500-2024-0001
  location: Hall 3 / Line 2
  state: Executing / mode: Processing
  component 12:HydraulicUnit
  building block 13:Identification
  building block 3:MachineryEquipment
  building block 8:JobManagement
  building block 3:Monitoring
  building block 3:MachineryItemState
  building block 3:Notifications
  building block 13:OperationCounters
  building block 3:MachineryOperationMode
  building block 3:Components
  device health: NORMAL
  operation counters: power-on 12480.0 h, operating 9215.5 h
  equipment UpperDie (urn:acme-machine-tools.example:equipment:die)
    life: 118400 of 250000 left
  process value HydraulicOilTemperature: 44.0 °C (setpoint 45.0, 45.7 % of range)
    limits: 5.0 / 15.0 / 65.0 / 80.0
  energy CompressedAir: Main = HydraPress-1/CompressedAir
    NeEnergyImportHp = 0
    NeEnergyExportHp = 0
    Volume = 184320
    VolumeFlowRate = 18.4
    Pressure = 620000
    Temperature = 294.65
  energy Electricity: Main = HydraPress-1/Electricity
    AcActivePowerTotal = 41250
Latest result: stroke-000019
  downloaded 42 bytes:
  resultId,stroke-000019
  peakForceKN,4703.6
Observing MachineryItemState for 4s (OPC 40001-1 state changes always come from the server) …
  22:33:52  -> Executing (via FromNotExecutingToExecuting)
  22:33:52  -> NotExecuting (via FromExecutingToNotExecuting)

The namespace indices above are whatever the server happened to assign; only the browse names are stable. 2:Identification and 2:OperationCounters show up as 13: because OPC 40001-1 gives both the Device Integration namespace — see Default instance browse names are load-bearing.

The building blocks come from the OPC 40001-1 MachineryBuildingBlocks organizer, which is the one place a client can discover what a machine supports instead of probing for each block in turn. The oil temperature walks a slow ramp across the datasheet limits, so the exclusive limit alarm on the process value activates and clears while the sample runs; subscribe to HydraulicOilTemperature to watch it.

What the sample does not need a second terminal for is the same walk as an automated test: MachineryEndToEndTests runs this server and this client over opc.tcp inside the test suite.

See the Machinery developer guide.