modbus/mb_utils.py
changeset 2664 a26a8e182190
parent 2655 d2b2ee04bfa1
child 2713 680ea4684209
equal deleted inserted replaced
2663:54f5b8e5c8d2 2664:a26a8e182190
    93     if int(request_dict["address"]) not in xrange(65536):
    93     if int(request_dict["address"]) not in xrange(65536):
    94         self.GetCTRoot().logger.write_error(
    94         self.GetCTRoot().logger.write_error(
    95             "Modbus plugin: Invalid Start Address in server memory area node %(locreqstr)s (Must be in the range [0..65535])\nModbus plugin: Aborting C code generation for this node\n" % request_dict)
    95             "Modbus plugin: Invalid Start Address in server memory area node %(locreqstr)s (Must be in the range [0..65535])\nModbus plugin: Aborting C code generation for this node\n" % request_dict)
    96         return None
    96         return None
    97     request_dict["count"] = GetCTVal(child, 1)
    97     request_dict["count"] = GetCTVal(child, 1)
    98     if int(request_dict["count"]) not in xrange(1, 65536):
    98     if int(request_dict["count"]) not in xrange(1, 65537):
    99         self.GetCTRoot().logger.write_error(
    99         self.GetCTRoot().logger.write_error(
   100             "Modbus plugin: Invalid number of channels in server memory area node %(locreqstr)s (Must be in the range [1..65536-start_address])\nModbus plugin: Aborting C code generation for this node\n" % request_dict)
   100             "Modbus plugin: Invalid number of channels in server memory area node %(locreqstr)s (Must be in the range [1..65536-start_address])\nModbus plugin: Aborting C code generation for this node\n" % request_dict)
   101         return None
   101         return None
   102     if (int(request_dict["address"]) + int(request_dict["count"])) not in xrange(1, 65537):
   102     if (int(request_dict["address"]) + int(request_dict["count"])) not in xrange(1, 65537):
   103         self.GetCTRoot().logger.write_error(
   103         self.GetCTRoot().logger.write_error(