Skip to content
Open
12 changes: 6 additions & 6 deletions dnp3-master/service/config/device_ip_port_config.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"RTU1": {
"RTU1": {
"name": "RTU1",
"conversion_type": "RTU1",
"CIM object": "l50",
"port": "20000",
"ip": "172.20.128.199",
"port": "30000",
"ip": "127.0.0.1",
"desc": "RTU1",
"link_local_addr": "101",
"link_remote_addr": "43"
"link_local_addr": "2",
"link_remote_addr": "1"
}
}
}
22 changes: 22 additions & 0 deletions dnp3-master/service/config/device_ip_port_config.json.archive
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"RTU1": {
"name": "RTU1",
"conversion_type": "RTU1",
"CIM object": "l50",
"port": "30000",
"ip": "127.0.0.1",
"desc": "RTU1",
"link_local_addr": "2",
"link_remote_addr": "1"
},
"RTU2": {
"name": "RTU2",
"conversion_type": "RTU2",
"CIM object": "l50",
"port": "40000",
"ip": "127.0.0.1",
"desc": "RTU2",
"link_local_addr": "2",
"link_remote_addr": "1"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"5e6dfa84-705b-495a-8497-1c230541b636": 0,
"c3a4f467-fe35-4dce-b0b7-ab1f2f0a4c5d": 1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"1d88371e-3db5-4b23-b8cd-fc0f2f3569fb": 0,
"a9eb2b35-c340-4d31-9a0a-4ff2d4463361": 1
}
62 changes: 62 additions & 0 deletions dnp3-master/service/config/new_conversion_dict_master.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"RTU1": {
"Binary input": {
"0": {
"index": 0,
"original_name": "ufls_59.1",
"Type of Object": "Protection Relay",
"CIM attribute": "FunctionBlock.enabled",
"CIM name": "ufls_59.1",
"CIM phase": "ABC",
"CIM Variable": "Pos",
"CIM units": "",
"CIM type": "Pos",
"Multiplier": 1,
"CIM Var type": "magnitude"
},
"1": {
"index": 1,
"original_name": "ufls_59.5",
"Type of Object": "Protection Relay",
"CIM attribute": "FunctionBlock.enabled",
"CIM name": "ufls_59.5",
"CIM phase": "ABC",
"CIM Variable": "Pos",
"CIM units": "",
"CIM type": "Pos",
"Multiplier": 1,
"CIM Var type": "magnitude"
}
},
"Binary output": {
"0": {
"index": 0,
"original_name": "ufls_59.1",
"Type of Object": "Protection Relay",
"CIM attribute": "FunctionBlock.enabled",
"CIM name": "ufls_59.1",
"CIM phase": "ABC",
"CIM Variable": "pos",
"CIM units": "",
"CIM type": "Pos",
"Multiplier": 1,
"CIM Value Type": "magnitude",
"CIM mRID": "1d88371e-3db5-4b23-b8cd-fc0f2f3569fb"
},
"1": {
"index": 1,
"original_name": "ufls_59.5",
"Type of Object": "Protection Relay",
"CIM attribute": "FunctionBlock.enabled",
"CIM name": "ufls_59.5",
"CIM phase": "ABC",
"CIM Variable": "pos",
"CIM units": "",
"CIM type": "Pos",
"Multiplier": 1,
"CIM Value Type": "magnitude",
"CIM mRID": "a9eb2b35-c340-4d31-9a0a-4ff2d4463361"
}
}
}
}
22 changes: 22 additions & 0 deletions dnp3-master/service/config/new_measurement_dict_master.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"ufls_59.1": {
"Pos": {
"ABC": [
{
"mrid": "1d88371e-3db5-4b23-b8cd-fc0f2f3569fb",
"type": "value"
}
]
}
},
"ufls_59.5": {
"Pos": {
"ABC": [
{
"mrid": "a9eb2b35-c340-4d31-9a0a-4ff2d4463361",
"type": "value"
}
]
}
}
}
23 changes: 23 additions & 0 deletions dnp3-master/service/config/new_model_line_dict.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"ufls_59.1": {
"Pos": {
"ABC": [
{
"mrid": "1d88371e-3db5-4b23-b8cd-fc0f2f3569fb",
"type": "value"
}
]
}
},
"ufls_59.5": {
"Pos": {
"ABC": [
{
"mrid": "a9eb2b35-c340-4d31-9a0a-4ff2d4463361",
"type": "value"
}
]
}
}
}

65 changes: 65 additions & 0 deletions dnp3-master/service/gapp_send_cim_message.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import logging
import time

from gridappsd import GridAPPSD
from gridappsd.topics import field_input_topic

logging.basicConfig(level=logging.DEBUG)
_log = logging.getLogger(__name__)


gapps = GridAPPSD()

assert gapps.connected

# # Note we are sending the function not executing the function in the second parameter
topic = field_input_topic()
# gapps.subscribe(topic, on_message_callback)
# # gapps.subscribe('/topic/goss.gridappsd.field.input', on_message_callback)

# gapps.send(topic, "A message about subscription lalalalalal")

# gapps.send(topic, {"key": "value =======lal"}) # or use key-value pair as message

# example_cim_message
cim_message = {
"command": "update",
"input": {
"message": {
"timestamp": 1736530734.662945,
"difference_mrid": "ccbc9b44-c6b6-4b89-b876-f9472867a2ca",
"reverse_differences": [
{
"object": "5e6dfa84-705b-495a-8497-1c230541b636",
"attribute": "FunctionBlock.enabled",
"value": True
},
{
"object": "c3a4f467-fe35-4dce-b0b7-ab1f2f0a4c5d",
"attribute": "FunctionBlock.enabled",
"value": False
}
],
"forward_differences": [
{
"object": "5e6dfa84-705b-495a-8497-1c230541b636",
"attribute": "FunctionBlock.enabled",
"value": False
},
{
"object": "c3a4f467-fe35-4dce-b0b7-ab1f2f0a4c5d",
"attribute": "FunctionBlock.enabled",
"value": True
}
]
},
"simulation_id": "field_data"
}
}


# print(cim_message["input"]["message"]["timestamp"]) # 1357048800
# print(
# cim_message["input"]["message"]["forward_differences"]
# ) # [{'object': '61A547FB-9F68-5635-BB4C-F7F537FD824E', 'attribute': 'ShuntCompensator.sections', 'value': 0}, {'object': 'E3CA4CD4-B0D4-9A83-3E2F-18AC5F1B55BA', 'attribute': 'ShuntCompensator.sections', 'value': 1}]
gapps.send(topic, cim_message)
Loading