Add Region
This commit is contained in:
@@ -1440,6 +1440,7 @@ namespace Testrong.User.Program
|
||||
/// <param name="testVersion"></param>
|
||||
void Rint_FVMV_2mA_Pre(IFlowRunnerContext context, TestVersion testVersion)
|
||||
{
|
||||
#region Init Config & Variables
|
||||
List<int> ChannelDps = new List<int>();
|
||||
List<int> ChannelPmu = new List<int>();
|
||||
for (int m = 0; m < 256; m++)
|
||||
@@ -1457,11 +1458,6 @@ namespace Testrong.User.Program
|
||||
slotList.Add(slotInfos[slotLen].No);
|
||||
}
|
||||
|
||||
//-----config dmm3458A and ExtCalibrationBoard-----
|
||||
KeysightDMM3458A dmm = new KeysightDMM3458A();
|
||||
ExternalCalibrationHandle extCaliHandle = new ExternalCalibrationHandle();
|
||||
string extConnStr = Select_IP[testVersion];
|
||||
int extPort = port;
|
||||
//-----config Board-----
|
||||
byte[] armDnaPortCmd = new byte[2] { 14, 57 };
|
||||
byte[] armDnaRaw = context.Communicator.Send(armDnaPortCmd);
|
||||
@@ -1470,9 +1466,6 @@ namespace Testrong.User.Program
|
||||
int SlotNum = context.Communicator.SlotNo;
|
||||
double[,] ExtBoard_Res = ReadRext(EXT_CAL_INIT_PATH + "ExtBoardRes.csv");
|
||||
|
||||
//Folder Related
|
||||
File_Mover(SlotNum: SlotNum, slotList: slotList, pathFlag: "CAL_Single");
|
||||
|
||||
//-----Start Slot Number-----
|
||||
StreamWriter swdata;
|
||||
swdata = new StreamWriter(METADATA_PATH, true, Encoding.UTF8)
|
||||
@@ -1488,11 +1481,27 @@ namespace Testrong.User.Program
|
||||
context: context,
|
||||
init_Flag: true
|
||||
);
|
||||
#endregion
|
||||
|
||||
#region Config DMM
|
||||
//-----config dmm3458A and ExtCalibrationBoard-----
|
||||
KeysightDMM3458A dmm = new KeysightDMM3458A();
|
||||
ExternalCalibrationHandle extCaliHandle = new ExternalCalibrationHandle();
|
||||
string extConnStr = Select_IP[testVersion];
|
||||
int extPort = port;
|
||||
|
||||
dmm.InitDMM(ksightConnStr);
|
||||
#endregion
|
||||
|
||||
//Folder Related
|
||||
File_Mover(SlotNum: SlotNum, slotList: slotList, pathFlag: "CAL_Single");
|
||||
|
||||
string filetime = DateTime.Now.ToString("yyyy-MM-dd HH-mm-ss");
|
||||
|
||||
#region Test
|
||||
for (int loopk = 0; loopk < 256; loopk++)
|
||||
{
|
||||
#region Test Config
|
||||
string[] PmuPinName = { ("A" + (ChannelPmu[loopk] < 10 ? "0" : "") + ChannelPmu[loopk]) };
|
||||
RELAY.SwitchMode(RelayMode.Open);
|
||||
RELAY.SwitchToPPMU(PmuPinName);
|
||||
@@ -1502,11 +1511,11 @@ namespace Testrong.User.Program
|
||||
string filename = EXT_CAL_PATH + filepath;
|
||||
int ch = ChannelPmu[loopk];
|
||||
|
||||
|
||||
double[] AteMeasure = new double[SampliCount];
|
||||
double[] ForceValue = new double[SampliCount];
|
||||
double[] DMMValue = new double[SampliCount];
|
||||
double[] TempValue = new double[SampliCount];
|
||||
#endregion
|
||||
|
||||
extCaliHandle.SetPpmuExternalCalibration(extConnStr, extPort, SlotNum, ExternalCalibrationMode.Channel, ch, ExtCaliVI.V, ExtCaliLoad.no_load, 0);//change channel
|
||||
|
||||
@@ -1514,6 +1523,7 @@ namespace Testrong.User.Program
|
||||
{
|
||||
DelayHelper.Sleep(20);
|
||||
}
|
||||
#region Actual Test
|
||||
for (int p = 0; p < SampliCount; p++)
|
||||
{
|
||||
PPMU.Force(PmuPinName, ForceVoltage, PpmuMode.FVMV, PpmuIRange._2mA, VRange.Normal);
|
||||
@@ -1534,9 +1544,10 @@ namespace Testrong.User.Program
|
||||
TempValue[p] = chTemp;
|
||||
ForceVoltage += VoltageStep;
|
||||
}
|
||||
#endregion
|
||||
|
||||
PPMU.Force(PmuPinName, 0, PpmuMode.FVMV, PpmuIRange._2mA, VRange.Normal);
|
||||
|
||||
#region File Writing
|
||||
StreamWriter sw = new StreamWriter(filename, true, Encoding.UTF8)
|
||||
{
|
||||
AutoFlush = true
|
||||
@@ -1571,11 +1582,14 @@ namespace Testrong.User.Program
|
||||
Range: "2mA",
|
||||
filepath: filepath,
|
||||
filetime: filetime);
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
#endregion
|
||||
SlotThreadLocker(SlotNum: SlotNum, slotList: slotList, pathFlag: "CAL");
|
||||
swdata.Flush();
|
||||
swdata.Close();
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1587,6 +1601,7 @@ namespace Testrong.User.Program
|
||||
/// <param name="testVersion"></param>
|
||||
void Rint_FVMV_2mA_Post(IFlowRunnerContext context, TestVersion testVersion)
|
||||
{
|
||||
#region Init Config & Variables
|
||||
List<int> ChannelDps = new List<int>();
|
||||
List<int> ChannelPmu = new List<int>();
|
||||
//-----Select PreTest or ReTest-----
|
||||
@@ -1605,13 +1620,6 @@ namespace Testrong.User.Program
|
||||
}
|
||||
slotList.Add(slotInfos[slotLen].No);
|
||||
}
|
||||
|
||||
//-----config dmm3458A and ExtCalibrationBoard-----
|
||||
KeysightDMM3458A dmm = new KeysightDMM3458A();
|
||||
ExternalCalibrationHandle extCaliHandle = new ExternalCalibrationHandle();
|
||||
string extConnStr = Select_IP[testVersion];
|
||||
int extPort = port;
|
||||
|
||||
//-----config Board-----
|
||||
byte[] armDnaPortCmd = new byte[2] { 14, 57 };
|
||||
byte[] armDnaRaw = context.Communicator.Send(armDnaPortCmd);
|
||||
@@ -1619,18 +1627,13 @@ namespace Testrong.User.Program
|
||||
string arm_dna = BitConverter.ToUInt64(armDnaRaw, 0).ToString();
|
||||
int SlotNum = context.Communicator.SlotNo;
|
||||
|
||||
//-----Read R File-----
|
||||
double[,] ExtBoard_Res = ReadRext(EXT_CAL_INIT_PATH + "ExtBoardRes.csv");
|
||||
|
||||
//-----Move File To History-----
|
||||
File_Mover(SlotNum: SlotNum, slotList: slotList, pathFlag: "CAL_Single");
|
||||
|
||||
//-----Start Slot Number-----
|
||||
//-----Start Write MetaData-----
|
||||
StreamWriter swdata;
|
||||
swdata = new StreamWriter(METADATA_PATH, true, Encoding.UTF8)
|
||||
{
|
||||
AutoFlush = true
|
||||
};
|
||||
|
||||
Metadata_handler(
|
||||
swdata: swdata,
|
||||
SlotNum: SlotNum,
|
||||
@@ -1639,13 +1642,33 @@ namespace Testrong.User.Program
|
||||
context: context,
|
||||
init_Flag: true
|
||||
);
|
||||
#endregion
|
||||
|
||||
#region Config DMM
|
||||
//-----config dmm3458A and ExtCalibrationBoard-----
|
||||
KeysightDMM3458A dmm = new KeysightDMM3458A();
|
||||
ExternalCalibrationHandle extCaliHandle = new ExternalCalibrationHandle();
|
||||
string extConnStr = Select_IP[testVersion];
|
||||
int extPort = port;
|
||||
|
||||
dmm.InitDMM(ksightConnStr);
|
||||
#endregion
|
||||
|
||||
//-----Read R File-----
|
||||
double[,] ExtBoard_Res = ReadRext(EXT_CAL_INIT_PATH + "ExtBoardRes.csv");
|
||||
|
||||
//-----Move File To History-----
|
||||
File_Mover(SlotNum: SlotNum, slotList: slotList, pathFlag: "CAL_Single");
|
||||
|
||||
|
||||
extCaliHandle.SetPpmuExternalCalibration(extConnStr, extPort, 1, ExternalCalibrationMode.Channel, 1, ExtCaliVI.V, ExtCaliLoad.RC_RL7, 0);
|
||||
double rload = GetRloadValue(dmm, 2000, 5);
|
||||
string filetime = DateTime.Now.ToString("yyyy-MM-dd HH-mm-ss");
|
||||
|
||||
#region Test
|
||||
for (int loopk = 0; loopk < 256; loopk++)
|
||||
{
|
||||
#region Test Config
|
||||
double ForceVoltage = -2;
|
||||
double VoltageStep = 1;
|
||||
string[] PmuPinName = { ("A" + (ChannelPmu[loopk] < 10 ? "0" : "") + ChannelPmu[loopk]) };
|
||||
@@ -1659,13 +1682,14 @@ namespace Testrong.User.Program
|
||||
RELAY.SwitchToPPMU(PmuPinName);
|
||||
string filepath = "Slot" + SlotNum + "_PMU_" + "ch" + ChannelPmu[loopk] + "_" + "FVMV" + "_" + "Hi-Z" + "_" + "2mA" + ".csv";
|
||||
string filename = EXT_CAL_PATH + filepath;
|
||||
|
||||
#endregion
|
||||
|
||||
extCaliHandle.SetPpmuExternalCalibration(extConnStr, extPort, SlotNum, ExternalCalibrationMode.Channel, ch, ExtCaliVI.V, ExtCaliLoad.RC_RL7, 0);//change channel
|
||||
if (loopk == 0)
|
||||
{
|
||||
DelayHelper.Sleep(20);
|
||||
}
|
||||
#region Actual Test
|
||||
for (int p = 0; p < SampliCount; p++)
|
||||
{
|
||||
PPMU.Force(PmuPinName, ForceVoltage, PpmuMode.FVMV, PpmuIRange._2mA, VRange.Normal);
|
||||
@@ -1685,8 +1709,11 @@ namespace Testrong.User.Program
|
||||
TempValue[p] = chTemp;
|
||||
ForceVoltage += VoltageStep;
|
||||
}
|
||||
#endregion
|
||||
|
||||
PPMU.Force(PmuPinName, 0, PpmuMode.FVMV, PpmuIRange._2mA, VRange.Normal);
|
||||
|
||||
#region File Writing
|
||||
StreamWriter sw = new StreamWriter(filename, true, Encoding.UTF8)
|
||||
{
|
||||
AutoFlush = true
|
||||
@@ -1721,12 +1748,17 @@ namespace Testrong.User.Program
|
||||
Range: "2mA",
|
||||
filepath: filepath,
|
||||
filetime: filetime);
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
swdata.Flush();
|
||||
swdata.Close();
|
||||
Thread.Sleep(1000);
|
||||
|
||||
#region Post Process
|
||||
#region File Process
|
||||
StreamReader metareader = new StreamReader(METADATA_PATH, Encoding.UTF8);
|
||||
List<string> dnaip = new List<string>();
|
||||
List<string> path = new List<string>();
|
||||
@@ -1745,9 +1777,12 @@ namespace Testrong.User.Program
|
||||
cnnt = cnnt + 1;
|
||||
}
|
||||
metareader.Close();
|
||||
|
||||
string pmurapth = EXT_CAL_PATH + context.Communicator.ServerIP + "_" + "Pmur" + ".txt";
|
||||
StreamWriter Pmur = new StreamWriter(pmurapth, true);
|
||||
Pmur.AutoFlush = true;
|
||||
#endregion
|
||||
#region Rint Calculation
|
||||
for (int p = 0; p < path.Count; p++)
|
||||
{
|
||||
string dna = path[p].Split(',')[0];
|
||||
@@ -1769,12 +1804,12 @@ namespace Testrong.User.Program
|
||||
}
|
||||
double ateV = Convert.ToDouble(datassingle[linefile].Split(',')[1]);
|
||||
double voltage = Convert.ToDouble(datassingle[linefile].Split(',')[2]);
|
||||
double iii = voltage / RL;
|
||||
double diff = ateV - voltage;
|
||||
double rrr = diff / iii;
|
||||
res = res + (rrr - rext);
|
||||
double iii = voltage / RL; //???
|
||||
double diff = ateV - voltage;
|
||||
double rrr = diff / iii; //???
|
||||
res = res + (rrr - rext); //Rint?
|
||||
}
|
||||
res = res / 4;
|
||||
res = res / 4; //Average
|
||||
string ChannelFormat;
|
||||
if (ChannelNum < 10)
|
||||
{
|
||||
@@ -1793,7 +1828,9 @@ namespace Testrong.User.Program
|
||||
datassingle.Clear();
|
||||
singlefile.Close();
|
||||
}
|
||||
#endregion
|
||||
Pmur.Close();
|
||||
#endregion
|
||||
|
||||
#region Thread Lock
|
||||
SlotThreadLocker(SlotNum: SlotNum, slotList: slotList, pathFlag: "CAL");
|
||||
|
||||
Reference in New Issue
Block a user