Skip to content

Commit

Permalink
fix(wind-turbine): set name option for Modbus clients in main controller
Browse files Browse the repository at this point in the history
  • Loading branch information
activeshadow committed Aug 16, 2024
1 parent 53571e7 commit e0b6ab9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/python/phenix_apps/apps/wind_turbine/wind_turbine.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,8 @@ def __main_controller(self, node, anemo = None, yaw = None, match = None):
yaw_setpoint = adjust ? target : yaw_setpoint
# hack to get yaw.dir-error tag published to DNP3 module
dir_error = dir_error
# hack to get turbine.emergency-stop tag published to DNP3 module
proto_emer_stop = proto_emer_stop
"""

variables = {
Expand Down Expand Up @@ -318,7 +320,7 @@ def __main_controller(self, node, anemo = None, yaw = None, match = None):
anemo = self.extract_app_node(node.metadata.controllers.anemometer)

mb = Modbus()
mb.init_xml_root('client', anemo)
mb.init_xml_root('client', anemo, name=anemo.hostname)
mb.registers_to_xml(self.__anemometer_registers(anemo))

config.append_to_root(mb.root)
Expand All @@ -327,7 +329,7 @@ def __main_controller(self, node, anemo = None, yaw = None, match = None):
yaw = self.extract_app_node(node.metadata.controllers.yaw)

mb = Modbus()
mb.init_xml_root('client', yaw)
mb.init_xml_root('client', yaw, name=yaw.hostname)
mb.registers_to_xml(self.__yaw_registers())

config.append_to_root(mb.root)
Expand All @@ -340,7 +342,7 @@ def __main_controller(self, node, anemo = None, yaw = None, match = None):
})

mb = Modbus()
mb.init_xml_root('client', blade)
mb.init_xml_root('client', blade, name=blade.hostname)
mb.registers_to_xml(self.__blade_registers())

config.append_to_root(mb.root)
Expand Down

0 comments on commit e0b6ab9

Please sign in to comment.