//private function section, unique to ZNBT private void WriteSingleStandard(SCalStdTable stdTable, int stdNumber, string rSStandard) { string cmd = ""; cmd = cmd + ":SENS:CORR:CKIT:"; cmd = cmd + rSStandard; cmd = cmd + " 'Package','" + stdTable.calkit_label; //calkitLabel; cmd = cmd + "','" + stdTable.CalStdData[stdNumber].StdLabel + "'"; //stdLabel cmd = cmd + "," + stdTable.CalStdData[stdNumber].MinFreq; //TEXT(FMIN.ToString()); cmd = cmd + "," + stdTable.CalStdData[stdNumber].MaxFreq; //TEXT(FMAX.ToString()); cmd = cmd + "," + stdTable.CalStdData[stdNumber].OffsetDelay; //TEXT(DEL.ToString()); cmd = cmd + "," + stdTable.CalStdData[stdNumber].OffsetLoss / 1000000000; //TEXT(LOSS.ToString()); cmd = cmd + "," + stdTable.CalStdData[stdNumber].OffsetZ0; //TEXT(Z0.ToString()); if (!rSStandard.Contains("THrough")) { cmd = cmd + "," + stdTable.CalStdData[stdNumber].C0_L0; //TEXT(C0.ToString()); cmd = cmd + "," + stdTable.CalStdData[stdNumber].C1_L1; //TEXT(C1.ToString()); cmd = cmd + "," + stdTable.CalStdData[stdNumber].C2_L2; //TEXT(C2.ToString()); cmd = cmd + "," + stdTable.CalStdData[stdNumber].C3_L3; //TEXT(C3.ToString()); cmd = cmd + "," + stdTable.CalStdData[stdNumber].C0_L0; //TEXT(L0.ToString()); cmd = cmd + "," + stdTable.CalStdData[stdNumber].C1_L1; //TEXT(L1.ToString()); cmd = cmd + "," + stdTable.CalStdData[stdNumber].C2_L2; //TEXT(L2.ToString()); cmd = cmd + "," + stdTable.CalStdData[stdNumber].C3_L3; //TEXT(L3.ToString()); if (stdTable.CalStdData[stdNumber].Port1 != 0 & stdTable.CalStdData[stdNumber].Port1 != -1) { if (stdTable.CalStdData[stdNumber].StdType == naEnum.ECalibrationStandard.LOAD) { cmd = cmd + "," + "MATC"; //tempStandard cmd = cmd + "," + stdTable.CalStdData[stdNumber].Port1; //TEXT(Port1.ToString()); } else { cmd = cmd + "," + stdTable.CalStdData[stdNumber].StdType.ToString(); //tempStandard cmd = cmd + "," + stdTable.CalStdData[stdNumber].Port1; //TEXT(Port1.ToString()); } } } else { if (stdTable.CalStdData[stdNumber].Port1 != 0 && stdTable.CalStdData[stdNumber].Port2 != 0) { cmd = cmd + "," + stdTable.CalStdData[stdNumber].Port1; //TEXT(Port1.ToString()); cmd = cmd + "," + stdTable.CalStdData[stdNumber].Port2; //TEXT(Port2.ToString()); } } SendCommand(cmd); string rc = ReadCommand(":SYST:ERR?"); rc = rc.ToUpper(); if (!rc.Contains("NO ERROR")) { string s = cmd; } }
internal override void InsertCalKitStd(SCalStdTable stdTable) { string ckit; ckit = ReadCommand(":SENS:CORR:CKIT:CATalog?"); bool b = ckit.Contains(stdTable.calkit_label); if (b) { SendCommand(":SENS:CORR:CKIT:DEL " + "'" + stdTable.calkit_label + "'"); // delete calkit if it exist [sayaun] } SetCalKitLabel(stdTable.channelNo, stdTable.calkit_label); AveragingMode(stdTable.channelNo, stdTable.Avg_Mode); AveragingFactor(stdTable.channelNo, stdTable.Avg_Factor); for (int i = 0; i < stdTable.CalStdData.Length; i++) { switch (stdTable.CalStdData[i].StdType) { case naEnum.ECalibrationStandard.OPEN: // "OPEN": //tempStandard = "OPEN"; WriteSingleStandard(stdTable, i, "FOPEN"); WriteSingleStandard(stdTable, i, "MOPEN"); break; case naEnum.ECalibrationStandard.SHORT: //"SHORT": //tempStandard = "SHOR"; WriteSingleStandard(stdTable, i, "FSHORT"); WriteSingleStandard(stdTable, i, "MSHORT"); break; case naEnum.ECalibrationStandard.LOAD: //"LOAD": //tempStandard = "MATC"; WriteSingleStandard(stdTable, i, "MMTCh"); WriteSingleStandard(stdTable, i, "FMTCh"); break; case naEnum.ECalibrationStandard.THRU: //"THRU": WriteSingleStandard(stdTable, i, "MMTHrough"); WriteSingleStandard(stdTable, i, "MFTHrough"); WriteSingleStandard(stdTable, i, "FFTHrough"); break; } base.Operation_Complete(); } }
internal override void InsertCalKitStd(SCalStdTable stdTable) { int channelNo = stdTable.channelNo; int stdNo; ActiveChannel(channelNo); ChannelMax(channelNo, true); SendCommand(":SENS" + channelNo + ":CORR:COLL:CKIT " + stdTable.calkit_locnum); SendCommand(":SENS" + channelNo + ":CORR:COLL:CKIT:LAB \"" + stdTable.calkit_label + "\""); base.Operation_Complete(); for (int i = 0; i < stdTable.CalStdData.Length; i++) { stdNo = stdTable.CalStdData[i].StdNo; SendCommand(":SENS" + channelNo + ":CORR:COLL:CKIT:STAN" + stdNo + ":TYPE " + stdTable.CalStdData[i].StdType); SendCommand(":SENS" + channelNo + ":CORR:COLL:CKIT:STAN" + stdNo + ":LAB \"" + stdTable.CalStdData[i].StdLabel + "\""); SendCommand(":SENS" + channelNo + ":CORR:COLL:CKIT:STAN" + stdNo + ":C0 " + stdTable.CalStdData[i].C0_L0); SendCommand(":SENS" + channelNo + ":CORR:COLL:CKIT:STAN" + stdNo + ":C1 " + stdTable.CalStdData[i].C1_L1); SendCommand(":SENS" + channelNo + ":CORR:COLL:CKIT:STAN" + stdNo + ":C2 " + stdTable.CalStdData[i].C2_L2); SendCommand(":SENS" + channelNo + ":CORR:COLL:CKIT:STAN" + stdNo + ":C3 " + stdTable.CalStdData[i].C3_L3); SendCommand(":SENS" + channelNo + ":CORR:COLL:CKIT:STAN" + stdNo + ":L0 " + stdTable.CalStdData[i].C0_L0); SendCommand(":SENS" + channelNo + ":CORR:COLL:CKIT:STAN" + stdNo + ":L1 " + stdTable.CalStdData[i].C1_L1); SendCommand(":SENS" + channelNo + ":CORR:COLL:CKIT:STAN" + stdNo + ":L2 " + stdTable.CalStdData[i].C2_L2); SendCommand(":SENS" + channelNo + ":CORR:COLL:CKIT:STAN" + stdNo + ":L3 " + stdTable.CalStdData[i].C3_L3); SendCommand(":SENS" + channelNo + ":CORR:COLL:CKIT:STAN" + stdNo + ":DEL " + stdTable.CalStdData[i].OffsetDelay); SendCommand(":SENS" + channelNo + ":CORR:COLL:CKIT:STAN" + stdNo + ":Z0 " + stdTable.CalStdData[i].OffsetZ0); SendCommand(":SENS" + channelNo + ":CORR:COLL:CKIT:STAN" + stdNo + ":LOSS " + stdTable.CalStdData[i].OffsetLoss); SendCommand(":SENS" + channelNo + ":CORR:COLL:CKIT:STAN" + stdNo + ":ARB " + stdTable.CalStdData[i].ArbImp); SendCommand(":SENS" + channelNo + ":CORR:COLL:CKIT:STAN" + stdNo + ":FMIN " + stdTable.CalStdData[i].MinFreq); SendCommand(":SENS" + channelNo + ":CORR:COLL:CKIT:STAN" + stdNo + ":FMAX " + stdTable.CalStdData[i].MaxFreq); SendCommand(":SENS" + channelNo + ":CORR:COLL:CKIT:STAN" + stdNo + ":CHAR " + Enum.GetName(typeof(naEnum.ECalStdMedia), stdTable.CalStdData[i].Media)); base.Operation_Complete(); } ChannelMax(channelNo, false); waitTimer.Wait(300); }
internal virtual void InsertCalKitStd(SCalStdTable stdTable) { }
//Setup Cal-kit public void SetupCalKit(SCalStdTable stdTable) { InsertCalKitStd(stdTable); }