Version: Next
Overview
The PofHistorianService runs as a Windows service that communicates with the client to get the SCADA history data from the history data file. The server is built using .NET and can run only on Windows. When reading from the history data file, the service will create the index file if it does not exist.
#
Technologies UsedThe PofHistorianService is written in C# and targets .NET Framework 4.5.1.
#
Dependencies- .NET Framework 4.5.1.
- Windows 7 operating system with SP 1 or above.
#
Installation Instructions- Login to the Windows machine in which PofHistorianService needs to be installed.
- Create a folder PofHistorianService, (For example: C:\PofHistorianService). You can create other folder name if you wish.
- Copy all the PofHistorianService binaries from the .zip file of the release to this folder.
- Change the config file to make sure it is correct in the running environment.
- Make sure you have administrator privileges.
- Navigate to C:\PofHistorianService
- Run the command .\pof-historian-api.exe install
- You should get the installed successfully message.
- The PofHistorianService windows service is installed at this point.
- Go to the Services console in Windows.
- Make sure the service is running. If not, start it.
- Check the properties of the service to ensure that it is configured to start automatically.
#
Uninstallation Instructions- Login to the Windows machine in which PofHistorianService is installed.
- Make sure you have administrator privileges.
- Navigate to C:\PofHistorianService.
- Run the command .\pof-historian-api.exe uninstall
- You should get an uninstall successful message.
#
Run in ConsoleThe service can also be run as a console app without installing the service. When debugging the service or testing, you may need to simply run the service as a console app.
- Navigate to C:\PofHistorianService
- Right click the app file “pof-historian-api.exe”, select “Run as administrator”.
#
Configuration- Navigate to C:\PofHistorianService.
- Open the file pof-historian-api.exe.config in the text editor of choice.
- Update the configuration items as specified below, save and close the file. Restart the service for the new configuration to take effect.
Key | Description |
---|---|
ServicePort | Service port number |
ServerBaseUrl | Base server URL that will be used by the client to send http requests e.g. https://+:. |
LogFileRelativePath | Path of the log files relative to the deployment directory. A path of Logs\ will create the log file in C:\PofHistorianService\Logs if the deployment directory is C:\PofHistorianService. Log file is created in text format and the rolling interval is set to a day. |
LocalRequestOnly | The flag to set if only the local requests are valid. |
FileLocation | The folder name to contain the data file and index file, including the path name. |
FileLocationSecond | The second folder name to contain the data file and index file, including the path name. |
ConfigSqlite | Connection string. Specify the connection string for the config database in SQLITE |
#
Sample content#
SQLITE Database ConfigurationThe SQLITE configuration can be found in the config.sqlite file within the tblNameMapping table.
#
tblNameMappingHolds the mapping between feeder name and alias/attribute.
Column Name | Description |
---|---|
Name | Feeder name for the service API input parameter |
Phase | Phase information of the measurement |
NomPowerFact | Power factor to calculate the power via formula: P = √3 × pf × I × V |
NomBusVolts | Bus voltage to calculate the power via formula: P = √3 × pf × I × V |
Measuring | Measurement type |
Alias | Measurement alias |
Attribute | Measurement attribute name |
AltAlias | Alternative alias for the measurement. |
AltAttribute | Alternative attribute name for the measurement |
#
Sample contentnote
- When getting power data, if alias with measuring “MW” does not exist as SCADA value, we will calculate it using the current value with measuring “AMPS” with the formula: P = √3 × pf × I × V
- When the first alias can not be found in the data file, the alternative alias will be used to get the data.