modbus/modbus.py
changeset 2179 84c4e56b38d6
parent 1919 ccea0fa6ea91
child 2182 eeca1aff0691
equal deleted inserted replaced
2178:bd0d13d10b8e 2179:84c4e56b38d6
   596 
   596 
   597         for i in range(0, len(IPServer_port_numbers) - 1):
   597         for i in range(0, len(IPServer_port_numbers) - 1):
   598             for j in range(i + 1, len(IPServer_port_numbers)):
   598             for j in range(i + 1, len(IPServer_port_numbers)):
   599                 if IPServer_port_numbers[i][1] == IPServer_port_numbers[j][1]:
   599                 if IPServer_port_numbers[i][1] == IPServer_port_numbers[j][1]:
   600                     self.GetCTRoot().logger.write_warning(
   600                     self.GetCTRoot().logger.write_warning(
   601                         _("Error: Modbus/IP Servers %s.x and %s.x use the same port number %s.\n") % (
   601                         _("Error: Modbus/IP Servers %{a1}.x and %{a2}.x use the same port number {a3}.\n").\
   602                             _lt_to_str(IPServer_port_numbers[i][0]),
   602                         format(
   603                             _lt_to_str(IPServer_port_numbers[j][0]),
   603                             a1=_lt_to_str(IPServer_port_numbers[i][0]),
   604                             IPServer_port_numbers[j][1]))
   604                             a2=_lt_to_str(IPServer_port_numbers[j][0]),
       
   605                             a3=IPServer_port_numbers[j][1]))
   605                     raise Exception
   606                     raise Exception
   606                     # TODO: return an error code instead of raising an
   607                     # TODO: return an error code instead of raising an
   607                     # exception
   608                     # exception
   608 
   609 
   609         # Determine the current location in Beremiz's project configuration
   610         # Determine the current location in Beremiz's project configuration