Makine, Sensör ve Alarm Verisi Gönderimi
Sinkler, NightWatch'un dış sistemlere veri gönderme mekanizmasıdır. NightWatch dış sistemlere iki tür veri gönderir;
- Makine ve sensörlerden okunan ham veya işlenmiş veri
- Tespit edilen alarm verisi
NightWatch sinkleri bu iki tür veriden ikisini birden veya sadece birisini destekler. Hangi sink türünün hangi veri türünü desteklediği her bir sink'in konfigürasyonunda SinkKind
parametresi ile belirtilir. SinkKind
parametresinin iki değeri vardır;
- Integration: Makine ve sensör versinini gönderilmesi için kullanılır
- Alert: Alarm verisinin gönderilmesi için kullanılır
Örneğin, DCAS Energy Sink
sadece makine ve sensör verisi gönderimi için kullanılabilir, bu sink alarm verisi gönderimi için kullanılamaz. Bu nedenle DCAS Energy Sink
'in SinkKind
parametre değeris sadece SinkKind.Integration
olabilir ve konfigürasyondan değiştirilemez.
Aşağıdaki sinkler sadece makine ve sensör verisi gönderimi için kullanılabilir (SinkKind.Integration)
- Database
- OPC UA
- trexDCAS Energy
- trexDCAS Operator Panel
Aşağıdaki sinkler ise hem makine ve sensör verisi (SinkKind.Integration) hem de alarm verisi gönderimi (SinkKind.Alert) için kullanılabilir * MQTT * RabbitMQ * Redis * WebHook
Mesaj Formatları
Sink mesajları MQTT ve Redis için konulara (topic), RabbitMQ için ise kuyruklara (queue) gönderilir.
Aşağıdaki tablolarda, {tenantId}, {instanceId} {deviceuid}, {unituid} ve {alertuid} değerleri gerçek yer tutucu olarak kullanılmıştır.
MQTT
SinkKind | ReadingPublishTypes | Published To Topic |
---|---|---|
Integration | Device_AsIs | nw/{tenantId}/{instanceId}/{deviceuid}/device_asis/{unituid} |
Integration | Device_Flat | nw/{tenantId}/{instanceId}/{deviceuid}/device_flat/{unituid} |
Integration | Device_GroupedByUnit | nw/{tenantId}/{instanceId}/{deviceuid}/device_byunit/{unituid} |
Integration | Unit_Flat | nw/{tenantId}/{instanceId}/{deviceuid}/unit_flat/{unituid} |
Integration | Unit_AsIs | nw/{tenantId}/{instanceId}/{deviceuid}/unit_asis/{unituid} |
SinkKind | AlertPublishTypes | Published To Topic |
---|---|---|
Alert | PerAlertMessage | nw/{tenantId}/{instanceId}/{deviceuid}/{unituid}/alert_permessage/{alertuid} |
Alert | GroupedByUnitMessages | nw/{tenantId}/{instanceId}/{deviceuid}/{unituid}/alert_grouped_byunit/{alertuid} |
Redis
SinkKind | ReadingPublishTypes | Published To Topic |
---|---|---|
Integration | Device_AsIs | nw:{tenantId}:{instanceId}:{deviceuid}:device_asis:{unituid} |
Integration | Device_Flat | nw:{tenantId}:{instanceId}:{deviceuid}:device_flat:{unituid} |
Integration | Device_GroupedByUnit | nw:{tenantId}:{instanceId}:{deviceuid}:device_byunit:{unituid} |
Integration | Unit_Flat | nw:{tenantId}:{instanceId}:{deviceuid}:unit_flat:{unituid} |
Integration | Unit_AsIs | nw:{tenantId}:{instanceId}:{deviceuid}:unit_asis:{unituid} |
SinkKind | AlertPublishTypes | Published To Topic |
---|---|---|
Alert | PerAlertMessage | nw:{tenantId}:{instanceId}:{deviceuid}:{unituid}:alert_permessage:{alertuid} |
Alert | GroupedByUnitMessages | nw:{tenantId}:{instanceId}:{deviceuid}:{unituid}:alert_grouped_byunit:{alertuid} |
RabbitMQ
- Exchange Adı: Konfigürasyondan alınır (varsayılan değer nw)
- Exchange Tipi: Direct
ReadingPublishTypes | Routing Key and Queue Name |
---|---|
Device_AsIs | nw_{tenantId}_{instanceId}_integration_device_asis |
Device_Flat | nw_{tenantId}_{instanceId}_integration_device_flat |
Device_GroupedByUnit | nw_{tenantId}_{instanceId}_integration_device_byunit |
Unit_Flat | nw_{tenantId}_{instanceId}_integration_unit_flat |
Unit_AsIs | nw_{tenantId}_{instanceId}_integration_unit_asis |
AlertPublishTypes | Routing Key and Queue Name |
---|---|
PerAlertMessage | nw_{tenantId}_{instanceId}_alert_device_asis |
GroupedByUnitMessages | nw_{tenantId}_{instanceId}_alert_device_flat |
Örnek Sensör Verisi (Device_AsIs)
MQTT Topic: nw/ea6335f8-de93-4024-8af2-180c56a2338b/79f33fff-02eb-4634-9e05-0979cf022c2c/f1a5574f-69ad-44bf-aee2-34ede9aa1a14/device_asis
{
"tenantId": "ea6335f8-de93-4024-8af2-180c56a2338b",
"instanceId": "79f33fff-02eb-4634-9e05-0979cf022c2c",
"createdOn": "2023-09-02T13:22:00.221+00:00",
"deviceUid": "f1a5574f-69ad-44bf-aee2-34ede9aa1a14",
"deviceName": "KepWare",
"deviceDisplayText": "KepWare",
"isOnDemandDataResult": false,
"deviceUsesSubscriptionModel": false,
"timeZoneOffset": "03:00:00",
"readings": [
{
"tenantId": "ea6335f8-de93-4024-8af2-180c56a2338b",
"instanceId": "79f33fff-02eb-4634-9e05-0979cf022c2c",
"deviceUid": "f1a5574f-69ad-44bf-aee2-34ede9aa1a14",
"unitUid": "1eacdc6f-8520-42fa-a8a1-523f162b359b",
"unitName": "Local Unit",
"readingDefUid": "91074e50-9b20-48bd-98f2-e72dc838ebeb",
"readingDefName": "ns=2;s=Channel1.Device1.Tag1",
"readingDefDisplayText": "Sayaç (Rnd)",
"receivedOnUtc": "2023-09-02T13:22:00.217+00:00",
"receivedOnLocal": "2023-09-02T16:22:00.217+03:00",
"sourceUtcTimestamp": "2023-09-02T13:21:58.6130492+00:00",
"serverUtcTimestamp": "2023-09-02T13:21:58.6130492+00:00",
"value": 14682,
"valueType": "Double",
"measurementUnit": "Adet",
"alarmMinOccured": false,
"alarmMaxOccured": false,
"alarmOccured": false,
"deviceExternalGroupCode": "DEV",
"unitExternalGroupCode": "PLC",
"timeZoneOffset": "03:00:00",
"receivedOnSystemTimeUtc": "2023-09-02T13:22:00.222+00:00",
"receivedOnSystemTimeLocal": "2023-09-02T16:22:00.222+03:00",
"readingDefExtraProps": {
"processOnChange": true,
"doNotPublishToSinks": false,
"hideFromDashboard": false,
"mesDoNotProcess": false,
"excludeFromOee": true,
"mesProcess": true,
"signalType": "COUNT",
"signalCategory": "",
"discardAllCounters": false,
"discardCounterUids": [],
"isLongCycleCounter": true,
"resetPulseCounterUids": [],
"hasValidResetPulseCounterUid": false,
"isValidCycleSignalForUndefinedStoppage": false,
"isValidCycleTypeForUndefinedStoppage": false
}
},
{
"tenantId": "ea6335f8-de93-4024-8af2-180c56a2338b",
"instanceId": "79f33fff-02eb-4634-9e05-0979cf022c2c",
"deviceUid": "f1a5574f-69ad-44bf-aee2-34ede9aa1a14",
"unitUid": "1eacdc6f-8520-42fa-a8a1-523f162b359b",
"unitName": "Local Unit",
"readingDefUid": "91074e50-9b20-48bd-98f2-e72dc838ebeb",
"readingDefName": "ns=2;s=Channel1.Device1.Tag1",
"readingDefDisplayText": "Sayaç (Rnd)",
"receivedOnUtc": "2023-09-02T13:22:00.217+00:00",
"receivedOnLocal": "2023-09-02T16:22:00.217+03:00",
"sourceUtcTimestamp": "2023-09-02T13:21:58.6130492+00:00",
"serverUtcTimestamp": "2023-09-02T13:21:58.6130492+00:00",
"value": 1223.5,
"valueType": "Double",
"measurementUnit": "Düzine",
"alarmMinOccured": false,
"alarmMaxOccured": false,
"alarmOccured": false,
"deviceExternalGroupCode": "DEV",
"unitExternalGroupCode": "PLC",
"timeZoneOffset": "03:00:00",
"receivedOnSystemTimeUtc": "2023-09-02T13:22:00.222+00:00",
"receivedOnSystemTimeLocal": "2023-09-02T16:22:00.222+03:00",
"readingDefExtraProps": {
"processOnChange": true,
"doNotPublishToSinks": false,
"hideFromDashboard": false,
"mesDoNotProcess": false,
"excludeFromOee": true,
"mesProcess": true,
"signalType": "COUNT",
"signalCategory": "",
"discardAllCounters": false,
"discardCounterUids": [],
"isLongCycleCounter": true,
"resetPulseCounterUids": [],
"hasValidResetPulseCounterUid": false,
"isValidCycleSignalForUndefinedStoppage": false,
"isValidCycleTypeForUndefinedStoppage": false
}
}
]
}
Örnek Sensör Verisi (Device_Flat)
MQTT Topic: nw/ea6335f8-de93-4024-8af2-180c56a2338b/79f33fff-02eb-4634-9e05-0979cf022c2c/f1a5574f-69ad-44bf-aee2-34ede9aa1a14/device_flat
{
"tenantId": "ea6335f8-de93-4024-8af2-180c56a2338b",
"instanceId": "79f33fff-02eb-4634-9e05-0979cf022c2c",
"deviceUid": "f1a5574f-69ad-44bf-aee2-34ede9aa1a14",
"deviceName": "KepWare",
"deviceDisplayText": "KepWare",
"createdOn": "2023-09-02T13:22:00.221+00:00",
"readings": [
{
"tenantId": "ea6335f8-de93-4024-8af2-180c56a2338b",
"instanceId": "79f33fff-02eb-4634-9e05-0979cf022c2c",
"deviceUid": "f1a5574f-69ad-44bf-aee2-34ede9aa1a14",
"unitUid": "1eacdc6f-8520-42fa-a8a1-523f162b359b",
"unitName": "Local Unit",
"readingDefUid": "91074e50-9b20-48bd-98f2-e72dc838ebeb",
"readingDefName": "ns=2;s=Channel1.Device1.Tag1",
"readingDefDisplayText": "Sayaç (Rnd)",
"receivedOnUtc": "2023-09-02T13:22:00.217+00:00",
"receivedOnLocal": "2023-09-02T16:22:00.217+03:00",
"sourceUtcTimestamp": "2023-09-02T13:21:58.6130492+00:00",
"serverUtcTimestamp": "2023-09-02T13:21:58.6130492+00:00",
"value": 14682,
"valueType": "Double",
"measurementUnit": "Adet",
"alarmMinOccured": false,
"alarmMaxOccured": false,
"alarmOccured": false,
"deviceExternalGroupCode": "DEV",
"unitExternalGroupCode": "PLC",
"timeZoneOffset": "03:00:00",
"receivedOnSystemTimeUtc": "2023-09-02T13:22:00.222+00:00",
"receivedOnSystemTimeLocal": "2023-09-02T16:22:00.222+03:00",
"readingDefExtraProps": {
"processOnChange": true,
"doNotPublishToSinks": false,
"hideFromDashboard": false,
"mesDoNotProcess": false,
"excludeFromOee": true,
"mesProcess": true,
"signalType": "COUNT",
"signalCategory": "",
"discardAllCounters": false,
"discardCounterUids": [],
"isLongCycleCounter": true,
"resetPulseCounterUids": [],
"hasValidResetPulseCounterUid": false,
"isValidCycleSignalForUndefinedStoppage": false,
"isValidCycleTypeForUndefinedStoppage": false
}
},
{
"tenantId": "ea6335f8-de93-4024-8af2-180c56a2338b",
"instanceId": "79f33fff-02eb-4634-9e05-0979cf022c2c",
"deviceUid": "f1a5574f-69ad-44bf-aee2-34ede9aa1a14",
"unitUid": "1eacdc6f-8520-42fa-a8a1-523f162b359b",
"unitName": "Local Unit",
"readingDefUid": "91074e50-9b20-48bd-98f2-e72dc838ebeb",
"readingDefName": "ns=2;s=Channel1.Device1.Tag1",
"readingDefDisplayText": "Sayaç (Rnd)",
"receivedOnUtc": "2023-09-02T13:22:00.217+00:00",
"receivedOnLocal": "2023-09-02T16:22:00.217+03:00",
"sourceUtcTimestamp": "2023-09-02T13:21:58.6130492+00:00",
"serverUtcTimestamp": "2023-09-02T13:21:58.6130492+00:00",
"value": 1223.5,
"valueType": "Double",
"measurementUnit": "Düzine",
"alarmMinOccured": false,
"alarmMaxOccured": false,
"alarmOccured": false,
"deviceExternalGroupCode": "DEV",
"unitExternalGroupCode": "PLC",
"timeZoneOffset": "03:00:00",
"receivedOnSystemTimeUtc": "2023-09-02T13:22:00.222+00:00",
"receivedOnSystemTimeLocal": "2023-09-02T16:22:00.222+03:00",
"readingDefExtraProps": {
"processOnChange": true,
"doNotPublishToSinks": false,
"hideFromDashboard": false,
"mesDoNotProcess": false,
"excludeFromOee": true,
"mesProcess": true,
"signalType": "COUNT",
"signalCategory": "",
"discardAllCounters": false,
"discardCounterUids": [],
"isLongCycleCounter": true,
"resetPulseCounterUids": [],
"hasValidResetPulseCounterUid": false,
"isValidCycleSignalForUndefinedStoppage": false,
"isValidCycleTypeForUndefinedStoppage": false
}
}
]
}
Örnek Sensör Verisi (Device_ByUnit)
MQTT Topic: nw/ea6335f8-de93-4024-8af2-180c56a2338b/79f33fff-02eb-4634-9e05-0979cf022c2c/f1a5574f-69ad-44bf-aee2-34ede9aa1a14/device_byunit
{
"tenantId": "ea6335f8-de93-4024-8af2-180c56a2338b",
"instanceId": "79f33fff-02eb-4634-9e05-0979cf022c2c",
"deviceUid": "f1a5574f-69ad-44bf-aee2-34ede9aa1a14",
"deviceName": "KepWare",
"deviceDisplayText": "KepWare",
"createdOn": "2023-09-02T13:22:00.221+00:00",
"units": [
{
"unit": {
"unitUid": "1eacdc6f-8520-42fa-a8a1-523f162b359b",
"unitName": "Local Unit"
},
"readings": [
{
"tenantId": "ea6335f8-de93-4024-8af2-180c56a2338b",
"instanceId": "79f33fff-02eb-4634-9e05-0979cf022c2c",
"deviceUid": "f1a5574f-69ad-44bf-aee2-34ede9aa1a14",
"unitUid": "1eacdc6f-8520-42fa-a8a1-523f162b359b",
"unitName": "Local Unit",
"readingDefUid": "91074e50-9b20-48bd-98f2-e72dc838ebeb",
"readingDefName": "ns=2;s=Channel1.Device1.Tag1",
"readingDefDisplayText": "Sayaç (Rnd)",
"receivedOnUtc": "2023-09-02T13:22:00.217+00:00",
"receivedOnLocal": "2023-09-02T16:22:00.217+03:00",
"sourceUtcTimestamp": "2023-09-02T13:21:58.6130492+00:00",
"serverUtcTimestamp": "2023-09-02T13:21:58.6130492+00:00",
"value": 14682,
"valueType": "Double",
"measurementUnit": "Adet",
"alarmMinOccured": false,
"alarmMaxOccured": false,
"alarmOccured": false,
"deviceExternalGroupCode": "DEV",
"unitExternalGroupCode": "PLC",
"timeZoneOffset": "03:00:00",
"receivedOnSystemTimeUtc": "2023-09-02T13:22:00.222+00:00",
"receivedOnSystemTimeLocal": "2023-09-02T16:22:00.222+03:00",
"readingDefExtraProps": {
"processOnChange": true,
"doNotPublishToSinks": false,
"hideFromDashboard": false,
"mesDoNotProcess": false,
"excludeFromOee": true,
"mesProcess": true,
"signalType": "COUNT",
"signalCategory": "",
"discardAllCounters": false,
"discardCounterUids": [],
"isLongCycleCounter": true,
"resetPulseCounterUids": [],
"hasValidResetPulseCounterUid": false,
"isValidCycleSignalForUndefinedStoppage": false,
"isValidCycleTypeForUndefinedStoppage": false
}
},
{
"tenantId": "ea6335f8-de93-4024-8af2-180c56a2338b",
"instanceId": "79f33fff-02eb-4634-9e05-0979cf022c2c",
"deviceUid": "f1a5574f-69ad-44bf-aee2-34ede9aa1a14",
"unitUid": "1eacdc6f-8520-42fa-a8a1-523f162b359b",
"unitName": "Local Unit",
"readingDefUid": "91074e50-9b20-48bd-98f2-e72dc838ebeb",
"readingDefName": "ns=2;s=Channel1.Device1.Tag1",
"readingDefDisplayText": "Sayaç (Rnd)",
"receivedOnUtc": "2023-09-02T13:22:00.217+00:00",
"receivedOnLocal": "2023-09-02T16:22:00.217+03:00",
"sourceUtcTimestamp": "2023-09-02T13:21:58.6130492+00:00",
"serverUtcTimestamp": "2023-09-02T13:21:58.6130492+00:00",
"value": 1223.5,
"valueType": "Double",
"measurementUnit": "Düzine",
"alarmMinOccured": false,
"alarmMaxOccured": false,
"alarmOccured": false,
"deviceExternalGroupCode": "DEV",
"unitExternalGroupCode": "PLC",
"timeZoneOffset": "03:00:00",
"receivedOnSystemTimeUtc": "2023-09-02T13:22:00.222+00:00",
"receivedOnSystemTimeLocal": "2023-09-02T16:22:00.222+03:00",
"readingDefExtraProps": {
"processOnChange": true,
"doNotPublishToSinks": false,
"hideFromDashboard": false,
"mesDoNotProcess": false,
"excludeFromOee": true,
"mesProcess": true,
"signalType": "COUNT",
"signalCategory": "",
"discardAllCounters": false,
"discardCounterUids": [],
"isLongCycleCounter": true,
"resetPulseCounterUids": [],
"hasValidResetPulseCounterUid": false,
"isValidCycleSignalForUndefinedStoppage": false,
"isValidCycleTypeForUndefinedStoppage": false
}
}
]
}
]
}
Örnek Sensör Verisi (Unit_Flat)
MQTT Topic: nw/ea6335f8-de93-4024-8af2-180c56a2338b/79f33fff-02eb-4634-9e05-0979cf022c2c/f1a5574f-69ad-44bf-aee2-34ede9aa1a14/unit_flat/1eacdc6f-8520-42fa-a8a1-523f162b359b
{
"TenantId": "ea6335f8-de93-4024-8af2-180c56a2338b",
"UnitUid": "1eacdc6f-8520-42fa-a8a1-523f162b359b",
"UnitExternalId": null,
"UnitName": "Local Unit",
"TimeZoneOffset": "03:00:00",
"ns=2;s=Channel1.Device1.Tag1 (Adet)": 14682,
"ns=2;s=Channel1.Device1.Tag1 (D\u00FCzine)": 1223.5
}
Örnek Sensör Verisi (Unit_AsIs)
MQTT Topic: nw/ea6335f8-de93-4024-8af2-180c56a2338b/79f33fff-02eb-4634-9e05-0979cf022c2c/f1a5574f-69ad-44bf-aee2-34ede9aa1a14/unit_asis/1eacdc6f-8520-42fa-a8a1-523f162b359b
[
{
"tenantId": "ea6335f8-de93-4024-8af2-180c56a2338b",
"instanceId": "79f33fff-02eb-4634-9e05-0979cf022c2c",
"deviceUid": "f1a5574f-69ad-44bf-aee2-34ede9aa1a14",
"unitUid": "1eacdc6f-8520-42fa-a8a1-523f162b359b",
"unitName": "Local Unit",
"readingDefUid": "91074e50-9b20-48bd-98f2-e72dc838ebeb",
"readingDefName": "ns=2;s=Channel1.Device1.Tag1",
"readingDefDisplayText": "Sayaç (Rnd)",
"receivedOnUtc": "2023-09-02T13:22:00.217+00:00",
"receivedOnLocal": "2023-09-02T16:22:00.217+03:00",
"sourceUtcTimestamp": "2023-09-02T13:21:58.6130492+00:00",
"serverUtcTimestamp": "2023-09-02T13:21:58.6130492+00:00",
"value": 14682,
"valueType": "Double",
"measurementUnit": "Adet",
"alarmMinOccured": false,
"alarmMaxOccured": false,
"alarmOccured": false,
"deviceExternalGroupCode": "DEV",
"unitExternalGroupCode": "PLC",
"timeZoneOffset": "03:00:00",
"receivedOnSystemTimeUtc": "2023-09-02T13:22:00.222+00:00",
"receivedOnSystemTimeLocal": "2023-09-02T16:22:00.222+03:00",
"readingDefExtraProps": {
"processOnChange": true,
"doNotPublishToSinks": false,
"hideFromDashboard": false,
"mesDoNotProcess": false,
"excludeFromOee": true,
"mesProcess": true,
"signalType": "COUNT",
"signalCategory": "",
"discardAllCounters": false,
"discardCounterUids": [],
"isLongCycleCounter": true,
"resetPulseCounterUids": [],
"hasValidResetPulseCounterUid": false,
"isValidCycleSignalForUndefinedStoppage": false,
"isValidCycleTypeForUndefinedStoppage": false
}
},
{
"tenantId": "ea6335f8-de93-4024-8af2-180c56a2338b",
"instanceId": "79f33fff-02eb-4634-9e05-0979cf022c2c",
"deviceUid": "f1a5574f-69ad-44bf-aee2-34ede9aa1a14",
"unitUid": "1eacdc6f-8520-42fa-a8a1-523f162b359b",
"unitName": "Local Unit",
"readingDefUid": "91074e50-9b20-48bd-98f2-e72dc838ebeb",
"readingDefName": "ns=2;s=Channel1.Device1.Tag1",
"readingDefDisplayText": "Sayaç (Rnd)",
"receivedOnUtc": "2023-09-02T13:22:00.217+00:00",
"receivedOnLocal": "2023-09-02T16:22:00.217+03:00",
"sourceUtcTimestamp": "2023-09-02T13:21:58.6130492+00:00",
"serverUtcTimestamp": "2023-09-02T13:21:58.6130492+00:00",
"value": 1223.5,
"valueType": "Double",
"measurementUnit": "Düzine",
"alarmMinOccured": false,
"alarmMaxOccured": false,
"alarmOccured": false,
"deviceExternalGroupCode": "DEV",
"unitExternalGroupCode": "PLC",
"timeZoneOffset": "03:00:00",
"receivedOnSystemTimeUtc": "2023-09-02T13:22:00.222+00:00",
"receivedOnSystemTimeLocal": "2023-09-02T16:22:00.222+03:00",
"readingDefExtraProps": {
"processOnChange": true,
"doNotPublishToSinks": false,
"hideFromDashboard": false,
"mesDoNotProcess": false,
"excludeFromOee": true,
"mesProcess": true,
"signalType": "COUNT",
"signalCategory": "",
"discardAllCounters": false,
"discardCounterUids": [],
"isLongCycleCounter": true,
"resetPulseCounterUids": [],
"hasValidResetPulseCounterUid": false,
"isValidCycleSignalForUndefinedStoppage": false,
"isValidCycleTypeForUndefinedStoppage": false
}
}
]
Redis Grafik Verisi
- Veri Noktası Anahtarları Topic Adı: nw:{tenantId}:{instanceId}:chartdata:keys
- Grafik Veri Noktaları Topic Adı: nw:{tenantId}:{instanceId}:chartdata:{unit_uid}:{key_hash}
key_hash Sinyal tanımındaki şu değerlerin hashidir
{Name}:{Index}:{FormulaName}:{MeasurementUnit}