diff --git a/Analysis/pyqtPlotMds.py b/Analysis/pyqtPlotMds.py index 5c4c435..9ee5633 100755 --- a/Analysis/pyqtPlotMds.py +++ b/Analysis/pyqtPlotMds.py @@ -71,21 +71,26 @@ p4 = win.addPlot(title="Channel Integrals") p4.addLegend() #for i in range(8,12): start = args.irange[0] -1; stop = args.irange[1] - 1 +print("WO: ", end='') for i in range(start, stop): #mdsNode = tree.getNode(f"ATCAIOP1.ADC8INT") mdsNode = tree.getNode(f"ATCAIOP1.ADC{i}INT") try: - #print(f"ATCAIOP1.ADC{i:d}INT") - dataAdcInt = mdsNode.getData().data() / 2.0e6 # LSB * sec + dataAdcInt = mdsNode.getData().data() timeData = mdsNode.getDimensionAt(0).data() - y = dataAdcInt[ :args.maxsamples, 0] + total_samples = DECIM_RATE * len(dataAdcInt[:, 0]) + y = dataAdcInt[ :args.maxsamples, 0] / 2.0e6 # LSB * sec if(args.zero): - y = y - dataAdcInt[0, 0] + y = y - dataAdcInt[0, 0] / 2.0e6 # LSB * sec + wo = (dataAdcInt[-1, 0] - dataAdcInt[0, 0]) /total_samples + print(f"{wo:0.4f} ", end='') x = DECIM_RATE * np.arange(len(y)) / 2.0e6 # in sec p4.plot(x,y, pen=pg.mkPen(i, width=2), name=f"Ch {i+1}") except: print(f"No data ATCAIOP1.ADC{i:d}INT") +print(" ") + p4.setLabel('bottom', "Time", units='s') #updatePlot() diff --git a/Configurations/RTApp-AtcaIop.cfg b/Configurations/RTApp-AtcaIop.cfg index 581d171..1d4d749 100644 --- a/Configurations/RTApp-AtcaIop.cfg +++ b/Configurations/RTApp-AtcaIop.cfg @@ -1158,10 +1158,12 @@ $IsttokApp = { ADCFrequency = "2000000" RTDecimation = "200" ChopperPeriod = "2000" -// ElectricalOffsets = {"86150" "-142" "130" "-165" "-280" "-187" "-10" "194" "40" "-36" "260" "-770"} ElectricalOffsets = {"-151" "110" "-417" "-35" "-204" "0" "134" "-59" "-227" "-308" "-120" "-175"} - WiringOffsets = {"0.271" "0.211" "0.098" "0.141" "0.312" "0.203" "0.212" "0.361" "-0.546" "-0.433" "-0.598" "1.362"} - //WiringOffsets = {"33.0" "34.89" "26.0" "38.0" "39.0" "-75.0" "30.0" "11.0" "-100.0" "-87.0" "-110.0" "-55.0"} + // "-141" "123" "-415" "-31" "-202" "8" "139" "-53" "-228" "-308" "-111" "-160" + //WiringOffsets = {"0.0" "0.0" "0.0" "0.0" "0.0" "0.0" "0.0" "0.0" "0.0" "0.0" "0.0" "0.0"} + //WiringOffsets = { } + WiringOffsets = {0.354 0.288 -0.010 -0.083 0.347 0.228 0.088 0.186 -0.297 -0.101 0.025 -0.012 } + //WiringOffsets = {"0.271" "0.211" "0.098" "0.141" "0.312" "0.203" "0.212" "0.361" "-0.546" "-0.433" "-0.598" "1.362"} Signals = { Counter = { Type = "uint32" diff --git a/DataSources/AtcaIop/AtcaIopADC.cpp b/DataSources/AtcaIop/AtcaIopADC.cpp index 323f6ef..348891f 100644 --- a/DataSources/AtcaIop/AtcaIopADC.cpp +++ b/DataSources/AtcaIop/AtcaIopADC.cpp @@ -409,7 +409,8 @@ bool AtcaIopADC::SetConfiguredDatabase(StructuredDataI& data) { } for (i=0u; i < ATCA_IOP_N_ADCs ; i++) { eo_conf.offset[i] = electricalOffsets[i]; - wo_conf.offset[i] = wiringOffsets[i]; + wo_conf.offset[i] = static_cast(wiringOffsets[i] * 65536); + REPORT_ERROR(ErrorManagement::Information, "WiringOffset %d: %d", i, wo_conf.offset[i]); } rc = ioctl(boardFileDescriptor, ATCA_PCIE_IOPS_EO_OFFSETS, &eo_conf); rc = ioctl(boardFileDescriptor, ATCA_PCIE_IOPS_WO_OFFSETS, &wo_conf);