modbus/mb_utils.py
changeset 2713 680ea4684209
parent 2664 a26a8e182190
child 3733 d1acf20e8e7c
equal deleted inserted replaced
2667:253110ba0fd7 2713:680ea4684209
   184             The string that should be added on C code - if everything goes allright
   184             The string that should be added on C code - if everything goes allright
   185     """
   185     """
   186 
   186 
   187     req_init_template = '''/*request %(locreqstr)s*/
   187     req_init_template = '''/*request %(locreqstr)s*/
   188 {"%(locreqstr)s", %(nodeid)s, %(slaveid)s, %(iotype)s, %(func_nr)s, %(address)s , %(count)s,
   188 {"%(locreqstr)s", %(nodeid)s, %(slaveid)s, %(iotype)s, %(func_nr)s, %(address)s , %(count)s,
   189 DEF_REQ_SEND_RETRIES, 0 /* error_code */, 0 /* prev_code */, {%(timeout_s)d, %(timeout_ns)d} /* timeout */, %(write_on_change)d /* write_on_change */, 
   189 DEF_REQ_SEND_RETRIES, 0 /* mb_error_code */, 0 /* tn_error_code */, 0 /* prev_code */, {%(timeout_s)d, %(timeout_ns)d} /* timeout */, %(write_on_change)d /* write_on_change */, 
   190 {%(buffer)s}, {%(buffer)s}}'''
   190 {%(buffer)s}, {%(buffer)s}}'''
   191 
   191 
   192     timeout = int(GetCTVal(child, 4))
   192     timeout = int(GetCTVal(child, 4))
   193     timeout_s = timeout // 1000
   193     timeout_s = timeout // 1000
   194     timeout_ms = timeout - (timeout_s * 1000)
   194     timeout_ms = timeout - (timeout_s * 1000)