diff --git a/tri.py b/tri.py index 0fdccef..dc3c989 100755 --- a/tri.py +++ b/tri.py @@ -52,18 +52,6 @@ while a > 1: test=adcc.read_adc(i,gain=GAIN) print("a{0} ".format(i) + ": {0} ;".format(test)) f1.write("a1_{0}".format(i) + ":{0};".format(test)) - -# curr_batt_diff = adcc.read_adc(3, gain=GAIN) -# curr_batt_mppt = adcc.read_adc(2, gain=GAIN) -# curr_out_1 = adc.read_adc(2,gain=GAIN) -# curr_out_2 = adc.read_adc(3,gain=GAIN) -# uv_ind=adc.read_adc(1,gain=GAIN) - -# f1.write("{0} ;".format(curr_batt_diff)) -# f1.write("{0} ;".format(curr_batt_mppt)) -# f1.write("{0} ;".format(curr_out_1)) -# f1.write("{0} ;".format(curr_out_2)) -# f1.write("{0} ;".format(uv_ind)) #read the registers from logical address 0 to 30. rr = client.read_holding_registers(0,90,unit=1) @@ -111,35 +99,22 @@ while a > 1: hourm = rr.registers[42]*65536+rr.registers[43] charge_state = rr.registers[50] #debug - print "Battery Voltage: %.2f" % volt_batt - print "Battery Voltage_t: %.2f" % volt_batt_t - print "Battery Voltage Sense: %.2f" % volt_batt_sens - print "Array Voltage: %.2f" % volt_arr - print "Battery Current: %.2f" % curr_batt - print "Array Current: %.2f" % curr_arr - print "Power in: %.2f" % power_in - print "Power out: %.2f" % power_out +# print "Battery Voltage: %.2f" % volt_batt +# print "Battery Voltage_t: %.2f" % volt_batt_t +# print "Battery Voltage Sense: %.2f" % volt_batt_sens +# print "Array Voltage: %.2f" % volt_arr +# print "Battery Current: %.2f" % curr_batt +# print "Array Current: %.2f" % curr_arr +# print "Power in: %.2f" % power_in +# print "Power out: %.2f" % power_out - print "Controller Temp: %.2f" % temp_heatsink - print "Battery Temp: %.2f" % temp_batt - print "AH total: %.2f" % ah_total - print "kWh total: %.2f" % kwh_total - print "hours: %.2f" % hourm - print "charge state : %.2f" % charge_state +# print "Controller Temp: %.2f" % temp_heatsink +# print "Battery Temp: %.2f" % temp_batt +# print "AH total: %.2f" % ah_total +# print "kWh total: %.2f" % kwh_total +# print "hours: %.2f" % hourm +# print "charge state : %.2f" % charge_state -# out = "V:%.2f" % battsV + " A:%.3f" % chargeI + " AV:%.2f" % arrayV + " D:%.2f" % pwmDuty + " S:" + state[statenum] + " CT:%.2f" % regTemp + " P:%.2f" % powerIn + " AH:%.2f" % ampH + "\n" -# fil = open('/home/pi/dumpdata.txt', 'w') -# fil.write(out) -# fil.close() - counter += 1 - -# if counter == 24: -# tid = time.ctime() -# out = str(tid) + ",%.2f" % battsV + ",%.3f" % chargeI + ",%.2f" % arrayV + ",%.2f" % pwmDuty + "," + state[statenum] + ",%.2f" % regTemp + ",%.2f" % powerIn + ",%.2f" % ampH + "\n" -# fil = open('/mnt/dumplog.csv', 'a') -# fil.write(out) -# fil.close() -# counter = 0 time.sleep(5) f1.write("\n")