An application to acquire data from industrial control systems (PLCs and other controllers)
This project is in early development. It should be considered a technical demo and not relied on for production work loads. A small set of features is currently implemented with more planned in the future. There will be breaking changes as things get developed/refactored until a stable release is made.
I appreciate community help with testing, submitting issues, and requesting features.
For those wanting to jump right in to using Crude Observatory with InfluxDB (an open-source time series database) start here: InfluxDB Configuration
Current assumptions/limitations are documented here: Limitations & Assumptions
Crude Observatory is built as a flexible way to acquire data from multiple sources and route that data to storage/endpoints. It's built using separate modules that can be combined via configuration to accomplish different acquisition scenarios. It takes a lot of inspiration from logging frameworks (such as NLog/Serilog) and shipper agents (Elastic's Beats, SumoLogic's Collectors, Influx's Telegraf).
To build an "Acquisition Set" configuration must be specified for the following:
- Start Trigger - Triggers the start of acquisition processing.
- Ex.
Immediate
- Begin acquiring at program launch.
- Ex.
- End Trigger - Triggers the end of an acquisition set.
- Ex.
Delay
- Acquire data for 120 seconds.
- Ex.
- Interval - Specifies how often to acquire samples.
- Ex.
Periodic
- Every 500 msec, read data.
- Ex.
- Data Sources - Values to be acquired. You can specify multiple sources/tags/values.
- Ex.
libplctag
- Read data from a PLC/Controller.
- Ex.
- Data Target - The item responsible for storing/transferring data points.
- Ex.
CSV
- Store data in the specified CSV file.
- Ex.
Used to start and stop an "Acquisition Set".
Immediate
Never
Delay
ValueTrue
[Planned]ValueFalse
[Planned]
Specify when to get data from the data sources.
Periodic
RisingEdge
[Planned]FallingEdge
[Planned]
PLCs/Controllers/etc that provide the values to be read/stored.
libplctag
SineWave
CSV
InfluxDB
Json
[Planned]MQTT
[Planned]SQLite
[Planned]
Below is an example configuration that acquires data every 500 msec for 2 minutes from several PLC tags and from the purely virtual SineWave
source.
Documentation for configuration files can be found here: Configuration Documentation
{
"Name": "Default Test Config",
"StartTrigger": {
"Type": "Immediate"
},
"EndTrigger": {
"Type": "Delay",
"DelaySeconds": 120.0
},
"Interval": {
"Type": "Periodic",
"PeriodSec": 0.5
},
"DataSources": [
{
"Type": "SineWave",
"PeriodSec": 10,
"Alias": "Sine1"
},
{
"Type": "SineWave",
"PeriodSec": 1,
"Alias": "Sine2"
},
{
"Type": "libplctag",
"Gateway": "10.10.10.17",
"Path": "1,0",
"Protocol": "ab_eip",
"PlcType": "ControlLogix",
"TimeoutSeconds": 5.0,
"Tags": [
{
"Name": "TestDINT0000",
"TagType": "Dint"
},
{
"Name": "TestDINT0001",
"TagType": "Dint"
},
{
"Name": "TestDINT0002",
"TagType": "Dint"
},
{
"Name": "TestDINT0003",
"TagType": "Dint"
}
]
}
],
"DataTarget": {
"Type": "CSV",
"FilePath": "DataTarget.csv"
}
}
Currently, the only available user interface is a CLI app. The application is built in dotnet 6 and requires the host system to have the ASP.NET Core Runtime installed. Packages are built for both Windows and Linux.
Download the latest release and uncompress it to the folder of your choice.
If you want a quick start to using Crude Observatory with InfluxDB, read the documentation here: InfluxDB Configuration
- Modify or copy the included "AcqConfig.json"
- Run the following:
- Windows:
.\CrudeObservatory.CLI.exe --AcqConfigPath .\AcqConfig.json
- Linux:
.\CrudeObservatory.CLI --AcqConfigPath .\AcqConfig.json
- Windows:
- Logging and CLI output can be adjusted in
appsettings.json