Configuration examples
- Last UpdatedFeb 20, 2025
- 2 minute read
The following tables provide examples for all configurations available for PI Adapter for Modbus TCP.
Note: The examples in this topic are using the default port number 5590. If you selected a different port number, replace it with that value.
System components configuration with two Modbus TCP adapter instances
[
{
"componentId": "Modbus1",
"componentType": "Modbus"
},
{
"componentId": "Modbus2",
"componentType": "Modbus"
},
{
"componentId": "OmfEgress",
"componentType": "OmfEgress"
}
]
Modbus adapter configuration
{
"Modbus1": {
"Logging": {
"logLevel": "Information",
"logFileSizeLimitBytes": 34636833,
"logFileCountLimit": 31
},
"DataSource": {
"Devices":
[
{
"id": "Device1",
"ipAddress": "127.0.0.1",
"port": 502
},
{
"id": "Device2",
"ipAddress": "127.0.0.2",
"port": 502
},
{
"id": "Device3",
"ipAddress": "127.0.0.3",
"port": 502
}
],
"streamIdPrefix": "my.prefix",
"defaultStreamIdPattern": "{DeviceId}.{UnitId}.{RegisterType}.{RegisterOffset}",
"reconnectInterval": "00:00:01",
"requestTimeout": "00:00:10",
"relayBetweenRequests": "00:00:00.5",
"maxResponseDataLength": 125
},
"DataSelection": [
{
"deviceId" : "Device1",
"selected": true,
"name": "MyDataItem",
"unitId": 1,
"registerType": 3,
"registerOffset": 123,
"dataTypeCode": 20,
"scheduleId": "Schedule1",
"streamId": "stream.1",
"bitMap": "020301",
"conversionFactor": 12.3,
"conversionOffset": 14.5,
"dataFilterId" : "DataFilter1"
}
]
},
"System": {
"Logging": {
"logLevel": "Information",
"logFileSizeLimitBytes": 34636833,
"logFileCountLimit": 31
},
"HealthEndpoints": [
],
"Diagnostics": {
"enableDiagnostics": true
},
"Components": [
{
"componentId": "Egress",
"componentType": "OmfEgress"
},
{
"componentId": "Modbus1",
"componentType": "Modbus1"
}
],
"Buffering": {
"bufferLocation": "C:/ProgramData/OSIsoft/Adapters/Modbus/Buffers",
"maxBufferSizeMB": -1,
"enableBuffering": true
}
},
"OmfEgress": {
"Logging": {
"logLevel": "Information",
"logFileSizeLimitBytes": 34636833,
"logFileCountLimit": 31
},
"DataEndpoints": [
{
"id": "WebAPI EndPoint",
"endpoint": "https://PIWEBAPIServer/piwebapi/omf",
"userName": "USERNAME",
"password": "PASSWORD"
},
{
"id": "ADH Endpoint",
"endpoint": "https://ADHEndpoint/omf",
"clientId": "CLIENTID",
"clientSecret": "CLIENTSECRET"
}
]
}
}
Data source configuration
The following are representations of minimal and complete data source configurations of Modbus TCP adapter.
Minimal data source configuration
{
"Devices":
[
{
"id": "Device1",
"ipAddress": "127.0.0.1"
}
]
}
Complete data source configuration
{
"Devices":
[
{
"id": "Device1",
"ipAddress": "127.0.0.1",
"port": 502
},
{
"id": "Device2",
"ipAddress": "127.0.0.2",
"port": 502
},
{
"id": "Device3",
"ipAddress": "127.0.0.3",
"port": 502
}
],
"streamIdPrefix": "my.prefix",
"defaultStreamIdPattern": "{DeviceId}.{UnitId}.{RegisterType}.{RegisterOffset}",
"reconnectInterval": "00:00:01",
"requestTimeout": "00:00:10",
"delayBetweenRequests": "00:00:00.5",
"maxResponseDataLength": 125
}
Data selection configuration
The following are representations of minimal and complete data selection configurations of Modbus TCP adapter.
Minimal data selection configuration
[
{
"deviceId" : "Device1",
"delected" : true,
"unitId": 1,
"registerType": 3,
"registerOffset": 122,
"dataTypeCode": 20,
"scheduleId": "Schedule1"
}
]
Complete data selection configuration
[
{
"deviceId" : "Device1",
"selected": true,
"name": "MyDataItem",
"unitId": 1,
"registerType": 3,
"registerOffset": 123,
"dataTypeCode": 20,
"scheduleId": "Schedule1",
"streamId": "stream.1",
"bitMap": "020301",
"conversionFactor": 12.3,
"conversionOffset": 14.5,
"dataFilterId" : "DataFilter1"
}
]