Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
Signed-off-by: Johan Fitié <jfitie@gmail.com>
  • Loading branch information
jfitie committed Sep 19, 2023
1 parent 37ac7cb commit 0bebb5c
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 20 deletions.
23 changes: 13 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,18 @@ In this example, an event causes the measured value (black) to cross the lower c
## Program information

### Requirements
| Priority | Requirement | Version |
| --------- | --------------------------------------------------------------- | ---------- |
| Mandatory | Microsoft .NET Framework | 4.0.30319 |
| Optional | OSIsoft PI Asset Framework Software Development Kit (PI AF SDK) | 2.10.7.283 |
| Priority | Requirement | Version |
| --------- | ------------------------------------------------------------- | ---------- |
| Mandatory | Microsoft .NET Framework | 4.0.30319 |
| Optional | AVEVA PI Asset Framework Software Development Kit (PI AF SDK) | 2.10.7.283 |

### Drivers
DBM uses drivers to read information from a source of data. The following drivers are included:

| Driver | Description | Identifier (`Point`) | Remarks |
| ------------------------------ | --------------------------------------- | ------------------------------------------------ | ---------------------------------------------------------------------- |
| `DBMPointDriverCSV.vb` | Driver for CSV files (timestamp,value). | `String` (CSV filename) | Data interval must be the same as the `CalculationInterval` parameter. |
| `DBMPointDriverOSIsoftPIAF.vb` | Driver for OSIsoft PI Asset Framework. | `OSIsoft.AF.Asset.AFAttribute` (PI AF attribute) | Used by PI AF Data Reference `DBMDataRef`. |
| Driver | Description | Identifier (`Point`) | Remarks |
| ---------------------------- | --------------------------------------- | ------------------------------------------------ | ---------------------------------------------------------------------- |
| `DBMPointDriverCSV.vb` | Driver for CSV files (timestamp,value). | `String` (CSV filename) | Data interval must be the same as the `CalculationInterval` parameter. |
| `DBMPointDriverAVEVAPIAF.vb` | Driver for AVEVA PI Asset Framework. | `OSIsoft.AF.Asset.AFAttribute` (PI AF attribute) | Used by PI AF Data Reference `DBMDataRef`. |

### Parameters
DBM can be configured using several parameters. The values for these parameters can be changed at runtime in the `Vitens.DynamicBandwidthMonitor.DBMParameters` class.
Expand Down Expand Up @@ -92,7 +92,7 @@ DBMTester is a command line utility that can be used to quickly calculate DBM re
| `-f=` | 0..1 | Output format. Default for local formatting, `intl` for international formatting. |

### DBMDataRef
DBMDataRef is a custom OSIsoft PI Asset Framework data reference which integrates DBM with PI AF. The `register.bat` script automatically registers the data reference and support assemblies when run on the PI AF server. The data reference uses the parent attribute as input and automatically uses attributes from sibling and parent elements based on the same template containing good data for correlation calculations, unless the `NoCorrelation` category is applied to the output attribute. The value returned from the DBM calculation is determined by the applied property/trait:
DBMDataRef is a custom AVEVA PI Asset Framework data reference which integrates DBM with PI AF. The `register.bat` script automatically registers the data reference and support assemblies when run on the PI AF server. The data reference uses the parent attribute as input and automatically uses attributes from sibling and parent elements based on the same template containing good data for correlation calculations, unless the `NoCorrelation` category is applied to the output attribute. The value returned from the DBM calculation is determined by the applied property/trait:

| Property/trait | Return value | Description |
| -------------- | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
Expand All @@ -111,7 +111,7 @@ The `Target` trait returns the original, valid raw measurements, augmented with

For the `Target` trait, DBM also detects and removes incorrect flatlines in the data and replaces them with forecast values, which are then weight adjusted to the original time range total. Data quality is marked as `Substituted` for this data.

Beginning with PI AF 2018 SP3 Patch 2, all AF plugins must be signed with a valid certificate. Users must ensure any 3rd party or custom plugins are signed with a valid certificate. Digitally signing plugins increases the users' confidence that it is from a trusted entity. AF data references that are not signed could have been tampered with and are potentially dangerous. Therefore, in order to protect its users, OSIsoft software enforces that all AF 2.x data reference plugins be signed. Use `sign.bat` to sign the data reference and support assemblies with your pfx certificate file before registering the data reference with PI AF.
Beginning with PI AF 2018 SP3 Patch 2, all AF plugins must be signed with a valid certificate. Users must ensure any 3rd party or custom plugins are signed with a valid certificate. Digitally signing plugins increases the users' confidence that it is from a trusted entity. AF data references that are not signed could have been tampered with and are potentially dangerous. Therefore, in order to protect its users, AVEVA software enforces that all AF 2.x data reference plugins be signed. Use `sign.bat` to sign the data reference and support assemblies with your pfx certificate file before registering the data reference with PI AF.

### Model calibration metrics: systematic error, random error, and fit
DBM can calculate model calibration metrics. This information is exposed in the DBMTester utility and the DBMDataRef data reference. The model is considered to be calibrated if all of the following conditions are met:
Expand Down Expand Up @@ -142,3 +142,6 @@ One of our main focus points is using advanced water quality, quantity and hydra
![Vitens](img/vitens.png)

https://www.vitens.nl/

## About AVEVA
AVEVA, the AVEVA logo and logotype, OSIsoft, the OSIsoft logo and logotype, Managed PI, OSIsoft Advanced Services, OSIsoft Cloud Services, OSIsoft Connected Services, OSIsoft EDS, PI ACE, PI Advanced Computing Engine, PI AF SDK, PI API, PI Asset Framework, PI Audit Viewer, PI Builder, PI Cloud Connect, PI Connectors, PI Data Archive, PI DataLink, PI DataLink Server, PI Developers Club, PI Integrator for Business Analytics, PI Interfaces, PI JDBC Driver, PI Manual Logger, PI Notifications, PI ODBC Driver, PI OLEDB Enterprise, PI OLEDB Provider, PI OPC DA Server, PI OPC HDA Server, PI ProcessBook, PI SDK, PI Server, PI Square, PI System, PI System Access, PI Vision, PI Visualization Suite, PI Web API, PI WebParts, PI Web Services, RLINK, and RtReports are all trademarks of AVEVA Group plc or its subsidiaries. All other trademarks or trade names used herein are the property of their respective owners.
4 changes: 2 additions & 2 deletions build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ rem Build
%VBC% /reference:build\DBM.dll /target:library /out:build\DBMPointDriverCSV.dll src\dbm\DBMManifest.vb src\dbm\driver\DBMPointDriverCSV.vb
%VBC% /reference:build\DBM.dll,build\DBMPointDriverCSV.dll /out:build\DBMTester.exe src\dbm\DBMManifest.vb src\dbmtester\*.vb
if exist "%PIAFRef%" (
%VBC% /reference:"%PIAFRef%",build\DBM.dll /target:library /out:build\DBMPointDriverOSIsoftPIAF.dll src\dbm\DBMManifest.vb src\dbm\driver\DBMPointDriverOSIsoftPIAF.vb
%VBC% /reference:"%PIAFRef%",build\DBM.dll,build\DBMPointDriverOSIsoftPIAF.dll /target:library /out:build\DBMDataRef.dll src\dbm\DBMManifest.vb src\PIAFDataRef\*.vb
%VBC% /reference:"%PIAFRef%",build\DBM.dll /target:library /out:build\DBMPointDriverAVEVAPIAF.dll src\dbm\DBMManifest.vb src\dbm\driver\DBMPointDriverAVEVAPIAF.vb
%VBC% /reference:"%PIAFRef%",build\DBM.dll,build\DBMPointDriverAVEVAPIAF.dll /target:library /out:build\DBMDataRef.dll src\dbm\DBMManifest.vb src\PIAFDataRef\*.vb
)
4 changes: 2 additions & 2 deletions src/PIAFDataRef/DBMDataRef.vb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Namespace Vitens.DynamicBandwidthMonitor
Inherits AFDataReference


' DBMDataRef is a custom OSIsoft PI Asset Framework data reference which
' DBMDataRef is a custom AVEVA PI Asset Framework data reference which
' integrates DBM with PI AF. The build script automatically registers the
' data reference and support assemblies when run on the PI AF server.
' The data reference uses the parent attribute as input and automatically
Expand Down Expand Up @@ -303,7 +303,7 @@ Namespace Vitens.DynamicBandwidthMonitor

' Gets the annotation associated with a single historical event.

' OSIsoft Tech Support: "[...] the reason you can't see it in Processbook,
' AVEVA Tech Support: "[...] the reason you can't see it in Processbook,
' is because of an old known issue related to annotations with AF2
' attributes"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
' Dynamic Bandwidth Monitor
' Leak detection method implemented in a real-time data historian
' Copyright (C) 2014-2022 J.H. Fitié, Vitens N.V.
' Copyright (C) 2014-2023 J.H. Fitié, Vitens N.V.
'
' This file is part of DBM.
'
Expand All @@ -25,7 +25,7 @@ Imports Vitens.DynamicBandwidthMonitor.DBMParameters


' Assembly title
<assembly:System.Reflection.AssemblyTitle("DBMPointDriverOSIsoftPIAF")>
<assembly:System.Reflection.AssemblyTitle("DBMPointDriverAVEVAPIAF")>


Namespace Vitens.DynamicBandwidthMonitor
Expand All @@ -35,7 +35,7 @@ Namespace Vitens.DynamicBandwidthMonitor
Inherits DBMPointDriverAbstract


' Description: Driver for OSIsoft PI Asset Framework.
' Description: Driver for AVEVA PI Asset Framework.
' Identifier (Point): OSIsoft.AF.Asset.AFAttribute (PI AF attribute)


Expand All @@ -48,14 +48,14 @@ Namespace Vitens.DynamicBandwidthMonitor

Public Overrides Function ToString As String

Return "OSIsoft PI AF driver " & DirectCast(Point, AFAttribute).GetPath
Return "AVEVA PI AF driver " & DirectCast(Point, AFAttribute).GetPath

End Function


Public Overrides Function SnapshotTimestamp As DateTime

' Returns the snapshot timestamp from OSIsoft PI AF.
' Returns the snapshot timestamp from AVEVA PI AF.

Return DirectCast(Point, AFAttribute).GetValue.Timestamp.LocalTime

Expand All @@ -65,7 +65,7 @@ Namespace Vitens.DynamicBandwidthMonitor
Public Overrides Sub PrepareData(startTimestamp As DateTime,
endTimestamp As DateTime)

' Retrieves a value for each interval in the time range from OSIsoft PI AF
' Retrieves a value for each interval in the time range from AVEVA PI AF
' and stores this in memory. The (aligned) end time itself is excluded.

Dim values As AFValues
Expand Down

0 comments on commit 0bebb5c

Please sign in to comment.