modbus/mb_utils.py
changeset 1919 ccea0fa6ea91
parent 1918 e7b6478b4ebc
child 2019 92f02bb17c7e
equal deleted inserted replaced
1918:e7b6478b4ebc 1919:ccea0fa6ea91
    68         # return None
    68         # return None
    69 
    69 
    70     node_dict = {"locnodestr": location,
    70     node_dict = {"locnodestr": location,
    71                  "host": host,
    71                  "host": host,
    72                  "port": port,
    72                  "port": port,
    73                  "slaveid": slaveid,
    73                  "slaveid": slaveid}
    74                  }
       
    75     return node_init_template % node_dict
    74     return node_init_template % node_dict
    76 
    75 
    77 
    76 
    78 def GetTCPServerMemAreaPrinted(self, child, nodeid):
    77 def GetTCPServerMemAreaPrinted(self, child, nodeid):
    79     """
    78     """
   126     node_dict = {"locnodestr": location,
   125     node_dict = {"locnodestr": location,
   127                  "device": device,
   126                  "device": device,
   128                  "baud": baud,
   127                  "baud": baud,
   129                  "parity": modbus_serial_parity_dict[parity],
   128                  "parity": modbus_serial_parity_dict[parity],
   130                  "stopbits": stopbits,
   129                  "stopbits": stopbits,
   131                  "slaveid": slaveid
   130                  "slaveid": slaveid}
   132                  }
       
   133     return node_init_template % node_dict
   131     return node_init_template % node_dict
   134 
   132 
   135 
   133 
   136 def GetRTUClientNodePrinted(self, child):
   134 def GetRTUClientNodePrinted(self, child):
   137     """
   135     """
   147     node_dict = {"locnodestr": location,
   145     node_dict = {"locnodestr": location,
   148                  "device": device,
   146                  "device": device,
   149                  "baud": baud,
   147                  "baud": baud,
   150                  "parity": modbus_serial_parity_dict[parity],
   148                  "parity": modbus_serial_parity_dict[parity],
   151                  "stopbits": stopbits,
   149                  "stopbits": stopbits,
   152                  "coms_period": coms_period
   150                  "coms_period": coms_period}
   153                  }
       
   154     return node_init_template % node_dict
   151     return node_init_template % node_dict
   155 
   152 
   156 
   153 
   157 def GetTCPClientNodePrinted(self, child):
   154 def GetTCPClientNodePrinted(self, child):
   158     """
   155     """
   166     host, port, coms_period = GetCTVals(child, range(3))
   163     host, port, coms_period = GetCTVals(child, range(3))
   167 
   164 
   168     node_dict = {"locnodestr": location,
   165     node_dict = {"locnodestr": location,
   169                  "host": host,
   166                  "host": host,
   170                  "port": port,
   167                  "port": port,
   171                  "coms_period": coms_period
   168                  "coms_period": coms_period}
   172                  }
       
   173     return node_init_template % node_dict
   169     return node_init_template % node_dict
   174 
   170 
   175 
   171 
   176 def GetClientRequestPrinted(self, child, nodeid):
   172 def GetClientRequestPrinted(self, child, nodeid):
   177     """
   173     """