Add Comments & Bug fixes
This commit is contained in:
Binary file not shown.
@@ -5,13 +5,6 @@
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{E96B1A19-D109-4F67-B1AA-5BF15E580D77}|Testrong.User.Program\\Testrong.User.Program.csproj|d:\\work\\manlin\\verify\\userprogram_time\\testrong.user.program\\userprogram.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{E96B1A19-D109-4F67-B1AA-5BF15E580D77}|Testrong.User.Program\\Testrong.User.Program.csproj|solutionrelative:testrong.user.program\\userprogram.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||
},
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\ProgramData\\Testrong\\ATE_Tester\\setting\\NLog.config||{FA3CD31E-987B-443A-9B81-186104E8DAC1}"
|
||||
},
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{E96B1A19-D109-4F67-B1AA-5BF15E580D77}|Testrong.User.Program\\Testrong.User.Program.csproj|D:\\WORK\\ManLin\\Verify\\UserProgram_time\\testrong.user.program\\keysight53220a.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{E96B1A19-D109-4F67-B1AA-5BF15E580D77}|Testrong.User.Program\\Testrong.User.Program.csproj|solutionrelative:testrong.user.program\\keysight53220a.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||
}
|
||||
],
|
||||
"DocumentGroupContainers": [
|
||||
@@ -21,34 +14,12 @@
|
||||
"DocumentGroups": [
|
||||
{
|
||||
"DockedWidth": 200,
|
||||
"SelectedChildIndex": 3,
|
||||
"SelectedChildIndex": 1,
|
||||
"Children": [
|
||||
{
|
||||
"$type": "Bookmark",
|
||||
"Name": "ST:0:0:{1c4feeaa-4718-4aa9-859d-94ce25d182ba}"
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 1,
|
||||
"Title": "NLog.config",
|
||||
"DocumentMoniker": "C:\\ProgramData\\Testrong\\ATE_Tester\\setting\\NLog.config",
|
||||
"ToolTip": "C:\\ProgramData\\Testrong\\ATE_Tester\\setting\\NLog.config",
|
||||
"ViewState": "AQIAADgAAAAAzszMzMwgwE8AAAAjAAAA",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000601|",
|
||||
"WhenOpened": "2024-07-10T10:20:55.074Z"
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 2,
|
||||
"Title": "Keysight53220A.cs",
|
||||
"DocumentMoniker": "D:\\WORK\\ManLin\\Verify\\UserProgram_time\\Testrong.User.Program\\Keysight53220A.cs",
|
||||
"RelativeDocumentMoniker": "Testrong.User.Program\\Keysight53220A.cs",
|
||||
"ToolTip": "D:\\WORK\\ManLin\\Verify\\UserProgram_time\\Testrong.User.Program\\Keysight53220A.cs",
|
||||
"RelativeToolTip": "Testrong.User.Program\\Keysight53220A.cs",
|
||||
"ViewState": "AQIAAHMAAAAAAAAAAAAYwKkAAAAiAAAA",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2024-06-18T12:27:43.62Z"
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 0,
|
||||
@@ -57,7 +28,7 @@
|
||||
"RelativeDocumentMoniker": "Testrong.User.Program\\UserProgram.cs",
|
||||
"ToolTip": "D:\\WORK\\ManLin\\Verify\\UserProgram_time\\Testrong.User.Program\\UserProgram.cs",
|
||||
"RelativeToolTip": "Testrong.User.Program\\UserProgram.cs",
|
||||
"ViewState": "AgIAALsEAAAAAAAAAAAQwNAEAAA6AAAAAAAAAA==",
|
||||
"ViewState": "AgIAAEEEAAAAAAAAAAAIwGAEAAAdAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2024-06-18T12:27:43.78Z",
|
||||
"EditorCaption": ""
|
||||
|
||||
@@ -5,13 +5,6 @@
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{E96B1A19-D109-4F67-B1AA-5BF15E580D77}|Testrong.User.Program\\Testrong.User.Program.csproj|d:\\work\\manlin\\verify\\userprogram_time\\testrong.user.program\\userprogram.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{E96B1A19-D109-4F67-B1AA-5BF15E580D77}|Testrong.User.Program\\Testrong.User.Program.csproj|solutionrelative:testrong.user.program\\userprogram.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||
},
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\ProgramData\\Testrong\\ATE_Tester\\setting\\NLog.config||{FA3CD31E-987B-443A-9B81-186104E8DAC1}"
|
||||
},
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{E96B1A19-D109-4F67-B1AA-5BF15E580D77}|Testrong.User.Program\\Testrong.User.Program.csproj|D:\\WORK\\ManLin\\Verify\\UserProgram_time\\testrong.user.program\\keysight53220a.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||
"RelativeMoniker": "D:0:0:{E96B1A19-D109-4F67-B1AA-5BF15E580D77}|Testrong.User.Program\\Testrong.User.Program.csproj|solutionrelative:testrong.user.program\\keysight53220a.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||
}
|
||||
],
|
||||
"DocumentGroupContainers": [
|
||||
@@ -21,43 +14,21 @@
|
||||
"DocumentGroups": [
|
||||
{
|
||||
"DockedWidth": 200,
|
||||
"SelectedChildIndex": 3,
|
||||
"SelectedChildIndex": 1,
|
||||
"Children": [
|
||||
{
|
||||
"$type": "Bookmark",
|
||||
"Name": "ST:0:0:{1c4feeaa-4718-4aa9-859d-94ce25d182ba}"
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 1,
|
||||
"Title": "NLog.config",
|
||||
"DocumentMoniker": "C:\\ProgramData\\Testrong\\ATE_Tester\\setting\\NLog.config",
|
||||
"ToolTip": "C:\\ProgramData\\Testrong\\ATE_Tester\\setting\\NLog.config",
|
||||
"ViewState": "AQIAADgAAAAAzszMzMwgwE8AAAAjAAAA",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000601|",
|
||||
"WhenOpened": "2024-07-10T10:20:55.074Z"
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 2,
|
||||
"Title": "Keysight53220A.cs",
|
||||
"DocumentMoniker": "D:\\WORK\\ManLin\\Verify\\UserProgram_time\\Testrong.User.Program\\Keysight53220A.cs",
|
||||
"RelativeDocumentMoniker": "Testrong.User.Program\\Keysight53220A.cs",
|
||||
"ToolTip": "D:\\WORK\\ManLin\\Verify\\UserProgram_time\\Testrong.User.Program\\Keysight53220A.cs",
|
||||
"RelativeToolTip": "Testrong.User.Program\\Keysight53220A.cs",
|
||||
"ViewState": "AQIAAHMAAAAAAAAAAAAYwKkAAAAiAAAA",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2024-06-18T12:27:43.62Z"
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 0,
|
||||
"Title": "UserProgram.cs",
|
||||
"DocumentMoniker": "D:\\WORK\\ManLin\\Verify\\UserProgram_time\\Testrong.User.Program\\UserProgram.cs",
|
||||
"RelativeDocumentMoniker": "Testrong.User.Program\\UserProgram.cs",
|
||||
"ToolTip": "D:\\WORK\\ManLin\\Verify\\UserProgram_time\\Testrong.User.Program\\UserProgram.cs*",
|
||||
"RelativeToolTip": "Testrong.User.Program\\UserProgram.cs*",
|
||||
"ViewState": "AgIAAEsGAAAAAAAAAAAowFcGAAAAAAAAAAAAAA==",
|
||||
"ToolTip": "D:\\WORK\\ManLin\\Verify\\UserProgram_time\\Testrong.User.Program\\UserProgram.cs",
|
||||
"RelativeToolTip": "Testrong.User.Program\\UserProgram.cs",
|
||||
"ViewState": "AgIAAMwDAAAAAAAAAAAmwOoDAAAyAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2024-06-18T12:27:43.78Z",
|
||||
"EditorCaption": ""
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.30320.27
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.13.35806.99 d17.13
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testrong.User.Program", "Testrong.User.Program\Testrong.User.Program.csproj", "{E96B1A19-D109-4F67-B1AA-5BF15E580D77}"
|
||||
EndProject
|
||||
|
||||
@@ -11,8 +11,14 @@ using Testrong.User.Program;
|
||||
|
||||
namespace Testrong.User.Program
|
||||
{
|
||||
/// <summary>
|
||||
/// Keysight53220A Related
|
||||
/// </summary>
|
||||
public class Keysight53220A
|
||||
{
|
||||
/// <summary>
|
||||
/// Global variables
|
||||
/// </summary>
|
||||
public class Globals
|
||||
{
|
||||
public static int videfaultRM;
|
||||
@@ -24,14 +30,22 @@ namespace Testrong.User.Program
|
||||
public static bool connected;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// KeysightMeasMode
|
||||
/// </summary>
|
||||
public enum KeysightMeasMode
|
||||
{
|
||||
FREQ,
|
||||
INIT
|
||||
}
|
||||
|
||||
// KeysightMeasMode PresentMode;
|
||||
|
||||
/// <summary>
|
||||
/// Initial DMM
|
||||
/// </summary>
|
||||
/// <param name="address">DMM USB ADDR</param>
|
||||
/// <param name="funcMode">KeysightMeasMode</param>
|
||||
/// <returns>true if connected, false if not</returns>
|
||||
public bool InitDMM53220A(string address, KeysightMeasMode funcMode)
|
||||
{
|
||||
try
|
||||
@@ -73,7 +87,11 @@ namespace Testrong.User.Program
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get DMM Measured Data
|
||||
/// </summary>
|
||||
/// <param name="count">count</param>
|
||||
/// <returns>ReturnReadings()</returns>
|
||||
public double GetDmm53220AMeasureData(int count = 1)
|
||||
{
|
||||
if (!Globals.connected)
|
||||
@@ -85,8 +103,12 @@ namespace Testrong.User.Program
|
||||
}
|
||||
|
||||
|
||||
//bool GlobalSetup = false;
|
||||
|
||||
/// <summary>
|
||||
/// Setup DMM
|
||||
/// </summary>
|
||||
/// <param name="funcMode">KeysightMeasMode</param>
|
||||
/// <returns>SendCmd(text) if Success, false if Failed</returns>
|
||||
private bool Setup(KeysightMeasMode funcMode)
|
||||
{
|
||||
try
|
||||
@@ -96,47 +118,27 @@ namespace Testrong.User.Program
|
||||
text += "*CLS\n";
|
||||
text += "STAT:PRES\n";
|
||||
text += "CONF:FREQ\n";
|
||||
//switch (funcMode)
|
||||
//{
|
||||
// case KeysightMeasMode.FREQ:
|
||||
// {
|
||||
// //text += "TRIG:COUN 1\n";
|
||||
// //text += "SAMP:COUN 10\n";
|
||||
// //text += "INIT\n";
|
||||
// }
|
||||
// break;
|
||||
// default:
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
//}
|
||||
text += "INP:COUP DC\n";
|
||||
//text += "INP:NREJ ON\n";
|
||||
text += "INP:LEV 2\n";
|
||||
text += "INP:SLOP NEG\n";
|
||||
//text += "INP:LEV 10\n";
|
||||
text += "SYST:BEEP:STAT OFF\n";
|
||||
text += "FREQ:GATE:SOUR TIME\n";
|
||||
text += "FREQ:GATE:TIME .0001\n";
|
||||
text += "TRIG:SOUR BUS\n";
|
||||
text += "TRIG:COUN 100000\n";
|
||||
text += "SAMP:COUN 1\n";
|
||||
//text += "INP:LEV:AUTO ON\n";
|
||||
|
||||
//text += "SAMP:COUN 2\n";
|
||||
//text += "TRIG:DEL .01\n";
|
||||
text += "INIT\n";
|
||||
//GlobalSetup = true;
|
||||
//PresentMode = funcMode;
|
||||
return SendCmd(text);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
//return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Return DMM Readings
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private double ReturnReadings()
|
||||
{
|
||||
string text = "";
|
||||
@@ -182,6 +184,11 @@ namespace Testrong.User.Program
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Send CMD to DMM
|
||||
/// </summary>
|
||||
/// <param name="Cmds">CMD String</param>
|
||||
/// <returns></returns>
|
||||
private bool SendCmd(string Cmds)
|
||||
{
|
||||
try
|
||||
@@ -200,12 +207,20 @@ namespace Testrong.User.Program
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Close DMM Connection
|
||||
/// </summary>
|
||||
/// <returns>true</returns>
|
||||
public bool CloseDMM53220A()
|
||||
{
|
||||
Globals.errorStatus = visa32.viClose(Globals.vi);
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string GetData()
|
||||
{
|
||||
StringBuilder stringBuilder = new StringBuilder(2048);
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<DocumentationFile>bin\x64\Debug\UserProgram.xml</DocumentationFile>
|
||||
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<OutputPath>bin\x64\Release\</OutputPath>
|
||||
|
||||
@@ -4,7 +4,6 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.Remoting.Contexts;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using Testrong.Core.Common;
|
||||
@@ -17,11 +16,13 @@ using Testrong.Core.Model.Ppmu;
|
||||
using Testrong.Core.Model.Relay;
|
||||
using Testrong.Core.Primitives;
|
||||
using Testrong.Core.Primitives.Extend;
|
||||
using Testrong.Core.Primitives.Service.AcTiming;
|
||||
using Testrong.Core.Primitives.TestrongSystem;
|
||||
|
||||
namespace Testrong.User.Program
|
||||
{
|
||||
/// <summary>
|
||||
/// ALL BOARDS
|
||||
/// </summary>
|
||||
public enum TestVersion
|
||||
{
|
||||
Board_1K_FT,
|
||||
@@ -32,6 +33,9 @@ namespace Testrong.User.Program
|
||||
Board_Ppmu_FT,
|
||||
KM_2
|
||||
}
|
||||
/// <summary>
|
||||
/// Test Parameters
|
||||
/// </summary>
|
||||
public class TestParaSet
|
||||
{
|
||||
public int delayMs;
|
||||
@@ -325,7 +329,7 @@ namespace Testrong.User.Program
|
||||
};
|
||||
#endregion
|
||||
|
||||
#region 其他参数
|
||||
#region Variables Definition
|
||||
List<string> testRangesPmu = new List<string> { "5uA", "20uA", "200uA", "2mA", "60mA" };
|
||||
List<string> testRangesDps = new List<string> { "5uA", "20uA", "200uA", "2mA", "60mA", "1A" };
|
||||
string[] FreqStr_Test = { "1M", "2M", "2.5M", "5M", "10M" };
|
||||
@@ -466,10 +470,17 @@ namespace Testrong.User.Program
|
||||
int port = 200;
|
||||
string ksightConnStr = "GPIB1::22::INSTR";
|
||||
TestVersion SelectTestVersion = Select_Version[Readjson(CONFIG_JSON_PATH).Version];
|
||||
const int ChannelCount = 256;
|
||||
double[] rInt = new double[ChannelCount];
|
||||
#endregion
|
||||
|
||||
#region 函数定义
|
||||
|
||||
/// <summary>
|
||||
/// Read JSON From json_path
|
||||
/// </summary>
|
||||
/// <param name="json_path">The Path of JSON</param>
|
||||
/// <returns>Json TYPE</returns>
|
||||
public static Json Readjson(string json_path)
|
||||
{
|
||||
Json get = new Json();
|
||||
@@ -481,22 +492,23 @@ namespace Testrong.User.Program
|
||||
return get;
|
||||
}
|
||||
|
||||
|
||||
/* ----------Metadata_handler-------------
|
||||
* StreamWriter swdata: File Handler, Should be Initialized ahead,
|
||||
* int SlotNum: Current Slot Number,
|
||||
* List<int> slotList: Slot List,
|
||||
* string arm_dna: DNA Data from Zynq,
|
||||
* IFlowRunnerContext context: info from ATE Software,
|
||||
* bool init_Flag: choose from Header to Body| True=Header/False=Body,
|
||||
* string Type:[OPTIONAL] Only need if init_Flag == False, Channel Type, Possible Value="PMU","DPS", "NULL"(Default),
|
||||
* int Channel:[OPTIONAL] Only need if init_Flag == False, Channel Number, Default = -1,
|
||||
* string Mode:[OPTIONAL] Only need if init_Flag == False, Test Mode, Possible Value="FVMV","FVMI","FIMV","FIMI","FZMV"(PMU Only), "NULL"(Default),
|
||||
* string Rload:[OPTIONAL] Only need if init_Flag == False,Resistance Load, Default = "NaN",
|
||||
* string Range:[OPTIONAL] Only need if init_Flag == False,Range, Possible Value="5uA", "20uA", "200uA", "2mA", "60mA", "1A"(DPS Only), Default = "N/A",
|
||||
* string filepath:[OPTIONAL] Only need if init_Flag == False, CSV File Path, Default = "N/A",
|
||||
* string filetime:[OPTIONAL] Only need if init_Flag == False, CSV File Creation Time, Default = "N/A"
|
||||
*/
|
||||
/// <summary>
|
||||
/// Metadata_handler, Write metadata.csv
|
||||
/// Also Prevents thread conflict
|
||||
/// </summary>
|
||||
/// <param name="swdata">File Handler, Should be Initialized ahead,</param>
|
||||
/// <param name="SlotNum">Current Slot Number, </param>
|
||||
/// <param name="slotList">Slot List, </param>
|
||||
/// <param name="arm_dna">DNA Data from Zynq, </param>
|
||||
/// <param name="context">info from ATE Software, </param>
|
||||
/// <param name="init_Flag">choose from Header to Body| True=Header/False=Body, </param>
|
||||
/// <param name="Type">[OPTIONAL] Only need if init_Flag == False, Channel Type, Possible Value="PMU","DPS", "NULL"(Default), </param>
|
||||
/// <param name="Channel">[OPTIONAL] Only need if init_Flag == False, Channel Number, Default = -1, </param>
|
||||
/// <param name="Mode">[OPTIONAL] Only need if init_Flag == False, Test Mode, Possible Value="FVMV","FVMI","FIMV","FIMI","FZMV"(PMU Only), "NULL"(Default),</param>
|
||||
/// <param name="Rload">[OPTIONAL] Only need if init_Flag == False,Resistance Load, Default = "NaN", </param>
|
||||
/// <param name="Range">[OPTIONAL] Only need if init_Flag == False,Range, Possible Value="5uA", "20uA", "200uA", "2mA", "60mA", "1A"(DPS Only), Default = "N/A", </param>
|
||||
/// <param name="filepath">[OPTIONAL] Only need if init_Flag == False, CSV File Path, Default = "N/A", </param>
|
||||
/// <param name="filetime">[OPTIONAL] Only need if init_Flag == False, CSV File Creation Time, Default = "N/A"</param>
|
||||
public void Metadata_handler(StreamWriter swdata, int SlotNum, List<int> slotList, string arm_dna, IFlowRunnerContext context, bool init_Flag, string Type = "NULL", int Channel = -1, string Mode = "NULL", string Rload = "NaN", string Range = "N/A", string filepath = "N/A", string filetime = "N/A")
|
||||
{
|
||||
//Are We Writing the header of MetaData?
|
||||
@@ -584,12 +596,13 @@ namespace Testrong.User.Program
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------File_Mover-------------
|
||||
* int SlotNum: Current Slot Number,
|
||||
* List<int> slotList: Slot List,
|
||||
* string pathFlag: Path Selector, Possible Value="Freq","CAL_Single"(No Pre/Post),"CAL_Normal",
|
||||
* bool isPreCheck:[OPTIONAL] Only need if pathFlag =="CAL_Normal",PreCheck Flag, Default = false
|
||||
*/
|
||||
/// <summary>
|
||||
/// Move Folder to Bak/History
|
||||
/// </summary>
|
||||
/// <param name="SlotNum">Current Slot Number, </param>
|
||||
/// <param name="slotList">Slot List, </param>
|
||||
/// <param name="pathFlag">Path Selector, Possible Value="Freq","CAL_Single"(No Pre/Post),"CAL_Normal",</param>
|
||||
/// <param name="isPreCheck">[OPTIONAL] Only need if pathFlag =="CAL_Normal",PreCheck Flag, Default = false</param>
|
||||
public void File_Mover(int SlotNum, List<int> slotList, string pathFlag, bool isPreCheck = false)
|
||||
{
|
||||
string DateCode = DateTime.Now.ToString("yyyy-MM-dd HH-mm-ss");
|
||||
@@ -655,11 +668,12 @@ namespace Testrong.User.Program
|
||||
|
||||
}
|
||||
|
||||
/* ----------SlotThreadLocker-------------
|
||||
* int SlotNum: Current Slot Number,
|
||||
* List<int> slotList: Slot List,
|
||||
* string pathFlag: Path Selector, Possible Value="Freq","CAL_Init","CAL","RINT","CAL_COM",
|
||||
*/
|
||||
/// <summary>
|
||||
/// Prevent thread run at the same time
|
||||
/// </summary>
|
||||
/// <param name="SlotNum">Current Slot Number, </param>
|
||||
/// <param name="slotList">Slot List, </param>
|
||||
/// <param name="pathFlag">Path Selector, Possible Value="Freq","CAL_Init","CAL","RINT","CAL_COM",</param>
|
||||
public void SlotThreadLocker(int SlotNum, List<int> slotList, string pathFlag)
|
||||
{
|
||||
string WritePath;
|
||||
@@ -747,6 +761,10 @@ namespace Testrong.User.Program
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Delete Anything inside Folder
|
||||
/// </summary>
|
||||
/// <param name="DirPath"></param>
|
||||
public void EmptyDir(string DirPath)
|
||||
{
|
||||
System.IO.DirectoryInfo di = new DirectoryInfo(DirPath);
|
||||
@@ -765,6 +783,13 @@ namespace Testrong.User.Program
|
||||
}
|
||||
return ans;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get ATE Measure Result
|
||||
/// </summary>
|
||||
/// <param name="InfoList">SiteInfo</param>
|
||||
/// <param name="PinName">PinName</param>
|
||||
/// <returns>double Measured Value</returns>
|
||||
private double GetATEChannelMeasure(List<SiteInfo> InfoList, string[] PinName)
|
||||
{
|
||||
double result = 0;
|
||||
@@ -784,6 +809,20 @@ namespace Testrong.User.Program
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get Rload
|
||||
/// Will Loop Measure 100 times,do average
|
||||
/// And measure 101th
|
||||
/// Then Compare the difference between them
|
||||
/// if Out-Of-Limit
|
||||
/// Will Try Again
|
||||
/// For INIFINATE Times
|
||||
/// </summary>
|
||||
/// <param name="rdmm">DMM Handler</param>
|
||||
/// <param name="range">DMM Measure Range</param>
|
||||
/// <param name="limit">Resistance Diff limit</param>
|
||||
/// <returns></returns>
|
||||
private double GetRloadValue(KeysightDMM3458A rdmm, double range, double limit)
|
||||
{
|
||||
double value = 0;
|
||||
@@ -927,26 +966,72 @@ namespace Testrong.User.Program
|
||||
return DmmDic;
|
||||
}
|
||||
|
||||
/*----------Write Data To File-------------
|
||||
* Variable Definition
|
||||
* string filename: filename
|
||||
* int slot: Slot Number
|
||||
* string dna: DNA Number
|
||||
* string type: DPS/PMU
|
||||
* int channel: Channel Number(PMU:1-256, DPS:1-32/64)
|
||||
* string mode: FVMV/FVMI/FIMV/FZMV(PMU Only)
|
||||
* string rload: External Resistance Load
|
||||
* double[,] extR: Internal Resistance On the External Calibration Board
|
||||
* string range: Board Measurment Range(5uA; 20uA; 200uA; 2mA; 60mA; 1A(DPS Only))
|
||||
* double[] ForceValue: ForceValue
|
||||
* double[] AteMeasure: ATE Measure Value
|
||||
* double[] DmmMeasure: DMM Measure Value
|
||||
* double[] TempValue: Temperature Value(May Not Available)
|
||||
*/
|
||||
public void WriteSingleFile(string filename, int slot, string dna, string type, int channel, string mode, string rload, double[,] extR, string range, double[] ForceValue, double[] AteMeasure, double[] DmmMeasure, double[] TempValue)
|
||||
/// <summary>
|
||||
/// Write Data To File, Need import StreamWriter and close FileHandler after using this func
|
||||
/// </summary>
|
||||
/// <param name="sw">StreamWriter, Need to be initialized first</param>
|
||||
/// <param name="slot">Slot Number</param>
|
||||
/// <param name="dna">DNA Number</param>
|
||||
/// <param name="type">DPS/PMU</param>
|
||||
/// <param name="channel">Channel Number(PMU:1-256, DPS:1-32/64)</param>
|
||||
/// <param name="mode">FVMV/FVMI/FIMV/FZMV(PMU Only)</param>
|
||||
/// <param name="rload">External Resistance Load</param>
|
||||
/// <param name="extR">Internal Resistance On the External Calibration Board</param>
|
||||
/// <param name="range">Board Measurment Range(5uA; 20uA; 200uA; 2mA; 60mA; 1A(DPS Only))</param>
|
||||
/// <param name="ForceValue">ForceValue</param>
|
||||
/// <param name="AteMeasure">ATE Measure Value</param>
|
||||
/// <param name="DmmMeasure">DMM Measure Value</param>
|
||||
/// <param name="TempValue">Temperature Value(May Not Available)</param>
|
||||
/// <param name="contextFormat">[OPTIONAL] For custom CSV content</param>
|
||||
/// <param name="customData">[OPTIONAL]</param>
|
||||
/// <param name="SampliCount">[OPTIONAL]</param>
|
||||
public void WriteSingleFile(StreamWriter sw, int slot, string dna, string type, int channel, string mode, string rload, double[,] extR, string range, double[] ForceValue, double[] AteMeasure, double[] DmmMeasure, double[] TempValue, string contextFormat = "Normal", double[] customData = null, int SampliCount = 5)
|
||||
{
|
||||
StreamWriter sw = new StreamWriter(filename, true, Encoding.UTF8);
|
||||
sw.AutoFlush = true;
|
||||
switch (contextFormat)
|
||||
{
|
||||
case "Freq":
|
||||
sw.Write("Channel_No,Freq_Force,Freq_Measure\n");
|
||||
for (int fCount = 0; fCount < SampliCount; fCount++) // 625K - 32M
|
||||
{
|
||||
for(int ch=0; ch<channel;ch ++)
|
||||
{
|
||||
sw.Write($"{ch},");
|
||||
sw.Write($"{customData[2 * (fCount)]:F3},");
|
||||
sw.Write($"{customData[2 * (fCount+1)]:F5}\n");
|
||||
sw.Flush();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "RintGND":
|
||||
sw.Write("Tester_Name,Foo\n");
|
||||
sw.Write($"Slot_No,{slot}\n");
|
||||
sw.Write($"Board_Dna,{dna}\n");
|
||||
sw.Write("Channel_Type,PMU\n");
|
||||
sw.Write($"Channel_No,{channel}\n");
|
||||
sw.Write($"Mode,FVMI\n");
|
||||
sw.Write($"R_Load,Hi-Z\n");
|
||||
sw.Write($"R_Int,{0}\n");
|
||||
sw.Write($"R_Ext,{0}\n");
|
||||
sw.Write($"I_Range,2mA\n");
|
||||
sw.Write("V_Range,20V\n");
|
||||
sw.Write("Meas_Range,13V\n");
|
||||
sw.Write("\n");
|
||||
sw.Write($"Force_0V_MV={customData[0] * 1000:F8}mV\n"); //Write MV at ForceV=0
|
||||
sw.Write($"Force_0V_MI={customData[1] * 1000:F8}mA\n"); //Write MI at ForceV=0
|
||||
sw.Write("Force Voltage(mV),Measure Voltage(mV),Measure Current(mA),Diff_Voltage(mV),Resistance(FV/MI),Resistance(Caled),Temperature\n");
|
||||
for (int writeLine = SampliCount; writeLine < SampliCount; writeLine++)
|
||||
{
|
||||
sw.Write($"{ForceValue[writeLine] * 1000:F8},");
|
||||
sw.Write($"{customData[writeLine + 2] * 1000:F8},"); //customData[writeLine + 2] = Measure Voltage
|
||||
sw.Write($"{AteMeasure[writeLine] * 1000:F8},");
|
||||
sw.Write($"{(customData[writeLine + 2] - ForceValue[writeLine]) * 1000:F8},");
|
||||
sw.Write($"{ForceValue[writeLine] / AteMeasure[writeLine]:F8},");
|
||||
sw.Write($"{(ForceValue[writeLine]- customData[0]) / (AteMeasure[writeLine]- customData[1]):F8},");
|
||||
sw.Write($"{TempValue[writeLine]:F8}\n");
|
||||
}
|
||||
break;
|
||||
case "Normal":
|
||||
default:
|
||||
sw.Write("Tester_Name,Foo\n");
|
||||
sw.Write($"Slot_No,{slot}\n");
|
||||
sw.Write($"Board_Dna,{dna}\n");
|
||||
@@ -968,7 +1053,7 @@ namespace Testrong.User.Program
|
||||
sw.Write("Meas_Range,13V\n");
|
||||
sw.Write("\n");
|
||||
sw.Write("Force Value,ATE Measure,DMM Measure,Temperature\n");
|
||||
for (int writeLine = 0; writeLine < 5; writeLine++)
|
||||
for (int writeLine = SampliCount; writeLine < SampliCount; writeLine++)
|
||||
{
|
||||
|
||||
if (mode == "FVMV" || mode == "FZMV")
|
||||
@@ -1009,8 +1094,8 @@ namespace Testrong.User.Program
|
||||
}
|
||||
sw.Write($"{TempValue[writeLine]:F8}\n");
|
||||
}
|
||||
sw.Flush();
|
||||
sw.Close();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -1158,11 +1243,11 @@ namespace Testrong.User.Program
|
||||
FreqCounter53220A.InitDMM53220A(addressFreq, Keysight53220A.KeysightMeasMode.FREQ);
|
||||
}
|
||||
Thread.Sleep(100);
|
||||
double[] customData = new double[2 * (FreqStr.Length + 1)];
|
||||
for (int fCount = 0; fCount < FreqStr.Length; fCount++) // 625K - 32M
|
||||
{
|
||||
string FreqFileNmae = EXT_CAL_FREQ_PATH + "Slot" + SlotNum + "_" + "Freq" + "_" + FreqStr[fCount] + ".csv";
|
||||
StreamWriter sw = new StreamWriter(FreqFileNmae, true, Encoding.UTF8);
|
||||
sw.Write("Channel_No,Freq_Force,Freq_Measure\n");
|
||||
Thread.Sleep(10);
|
||||
string strPattern = FreqInfo[FreqStr[fCount]];
|
||||
PATTERN.DCLevel.Set("level_5V");
|
||||
@@ -1211,11 +1296,33 @@ namespace Testrong.User.Program
|
||||
break;
|
||||
}
|
||||
}
|
||||
sw.Write($"{ChannelPmu[loopk]},");
|
||||
sw.Write($"{FreqForce[fCount]:F3},");
|
||||
sw.Write($"{freqValue:F5}\n");
|
||||
customData[2 * (fCount)] = FreqForce[fCount];
|
||||
customData[2 * (fCount + 1)] = freqValue;
|
||||
sw.Flush();
|
||||
}
|
||||
double[,] ZeroExtR = {
|
||||
{ 0.0 , 0.0 , 0.0}
|
||||
};
|
||||
double[] Zero=new double[1];
|
||||
Zero[0] = 0;
|
||||
WriteSingleFile(
|
||||
sw:sw,
|
||||
slot:SlotNum,
|
||||
dna:arm_dna,
|
||||
type:"K7",
|
||||
channel: PmuChannelCount,
|
||||
mode:"Freq",
|
||||
rload:"0",
|
||||
extR: ZeroExtR,
|
||||
range:"NULL",
|
||||
ForceValue: Zero,
|
||||
AteMeasure: Zero,
|
||||
DmmMeasure: Zero,
|
||||
TempValue: Zero,
|
||||
contextFormat:"Freq",
|
||||
customData:customData,
|
||||
SampliCount: FreqStr.Length
|
||||
);
|
||||
sw.Close();
|
||||
|
||||
}
|
||||
@@ -1230,7 +1337,12 @@ namespace Testrong.User.Program
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Reset Rint
|
||||
/// Empty Local Rint Folder and Files
|
||||
/// Put Initial Files into Zynq (Not only Rint,but also others)
|
||||
/// </summary>
|
||||
/// <param name="context">info from ATE Software</param>
|
||||
void Rint_Reset(IFlowRunnerContext context)
|
||||
{
|
||||
var slotInfos = context.FlowCatalog.GetAll<SlotInfo>();
|
||||
@@ -1319,6 +1431,13 @@ namespace Testrong.User.Program
|
||||
|
||||
SlotThreadLocker(SlotNum: SlotNum, slotList: slotList, pathFlag: "CAL_Init");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To Pre-Test Rint with External Calibration Board
|
||||
/// Mainly get FVMV data to Calibrate ForceV
|
||||
/// </summary>
|
||||
/// <param name="context">info from ATE Software</param>
|
||||
/// <param name="testVersion"></param>
|
||||
void Rint_FVMV_2mA_Pre(IFlowRunnerContext context, TestVersion testVersion)
|
||||
{
|
||||
List<int> ChannelDps = new List<int>();
|
||||
@@ -1383,10 +1502,6 @@ namespace Testrong.User.Program
|
||||
string filename = EXT_CAL_PATH + filepath;
|
||||
int ch = ChannelPmu[loopk];
|
||||
|
||||
StreamWriter sw = new StreamWriter(filename, true, Encoding.UTF8)
|
||||
{
|
||||
AutoFlush = true
|
||||
};
|
||||
|
||||
double[] AteMeasure = new double[SampliCount];
|
||||
double[] ForceValue = new double[SampliCount];
|
||||
@@ -1422,8 +1537,11 @@ namespace Testrong.User.Program
|
||||
|
||||
PPMU.Force(PmuPinName, 0, PpmuMode.FVMV, PpmuIRange._2mA, VRange.Normal);
|
||||
|
||||
WriteSingleFile(
|
||||
filename: filename,
|
||||
StreamWriter sw = new StreamWriter(filename, true, Encoding.UTF8)
|
||||
{
|
||||
AutoFlush = true
|
||||
};
|
||||
WriteSingleFile(sw: sw,
|
||||
slot: SlotNum,
|
||||
dna: arm_dna,
|
||||
type: "PMU",
|
||||
@@ -1435,14 +1553,12 @@ namespace Testrong.User.Program
|
||||
ForceValue: ForceValue,
|
||||
AteMeasure: AteMeasure,
|
||||
DmmMeasure: DMMValue,
|
||||
TempValue:TempValue
|
||||
);
|
||||
TempValue: TempValue);
|
||||
|
||||
sw.Flush();
|
||||
sw.Close();
|
||||
|
||||
Metadata_handler(
|
||||
swdata: swdata,
|
||||
Metadata_handler(swdata: swdata,
|
||||
SlotNum: SlotNum,
|
||||
slotList: slotList,
|
||||
arm_dna: arm_dna,
|
||||
@@ -1454,8 +1570,7 @@ namespace Testrong.User.Program
|
||||
Rload: "Hi-Z",
|
||||
Range: "2mA",
|
||||
filepath: filepath,
|
||||
filetime: filetime
|
||||
);
|
||||
filetime: filetime);
|
||||
}
|
||||
|
||||
SlotThreadLocker(SlotNum: SlotNum, slotList: slotList, pathFlag: "CAL");
|
||||
@@ -1463,97 +1578,13 @@ namespace Testrong.User.Program
|
||||
swdata.Close();
|
||||
}
|
||||
|
||||
void Rint_DataUpload(IFlowRunnerContext context)
|
||||
{
|
||||
var slotInfos = context.FlowCatalog.GetAll<SlotInfo>();
|
||||
List<int> slotList = new List<int>();
|
||||
for (int slotLen = 0; slotLen < slotInfos.Count; slotLen++)
|
||||
{
|
||||
if (slotInfos[slotLen].FirmwareVersion == "")
|
||||
{
|
||||
continue;
|
||||
}
|
||||
slotList.Add(slotInfos[slotLen].No);
|
||||
}
|
||||
byte[] armDnaPortCmd = new byte[2] { 14, 57 }; // command to read arm dna
|
||||
byte[] armDnaRaw = context.Communicator.Send(armDnaPortCmd); //send command
|
||||
armDnaRaw = armDnaRaw.Reverse().ToArray();
|
||||
string arm_dna = BitConverter.ToUInt64(armDnaRaw, 0).ToString(); //convert hex dna to decimal
|
||||
int SlotNum = context.Communicator.SlotNo;
|
||||
ExternalCalibrationHandle extCaliHandle = new ExternalCalibrationHandle();
|
||||
if (SlotNum == slotList[0])
|
||||
{
|
||||
DelayHelper.Sleep(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
int Cried = slotList.FindIndex(x => x.Equals(SlotNum));
|
||||
while (true)
|
||||
{
|
||||
Thread.Sleep(1000);
|
||||
if (File.Exists(RINT_COMPFILE_PATH + slotList[Cried - 1] + ".flag"))
|
||||
{
|
||||
File.Delete(RINT_COMPFILE_PATH + slotList[Cried - 1] + ".flag");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Thread.Sleep(10);
|
||||
var isDnaUploadOK = extCaliHandle.UploadFile(context.Communicator.ServerIP, RINT_COMPFILE_PATH + "DNA_" + context.Communicator.ServerIP + ".csv", FileType.dna);
|
||||
LogRawText($"Dna Status: {isDnaUploadOK}");
|
||||
|
||||
Thread.Sleep(10);
|
||||
var isMVUploadOK = extCaliHandle.UploadFile(context.Communicator.ServerIP, RINT_COMPFILE_PATH + context.Communicator.ServerIP + "_MV.csv", FileType.mv);
|
||||
LogRawText($"MV Status: {isMVUploadOK}");
|
||||
|
||||
SlotThreadLocker(SlotNum: SlotNum, slotList: slotList, pathFlag: "RINT");
|
||||
}
|
||||
void Pmur_Upload(IFlowRunnerContext context)
|
||||
{
|
||||
var slotInfos = context.FlowCatalog.GetAll<SlotInfo>();
|
||||
List<int> slotList = new List<int>();
|
||||
for (int slotLen = 0; slotLen < slotInfos.Count; slotLen++)
|
||||
{
|
||||
if (slotInfos[slotLen].FirmwareVersion == "")
|
||||
{
|
||||
continue;
|
||||
}
|
||||
slotList.Add(slotInfos[slotLen].No);
|
||||
}
|
||||
byte[] armDnaPortCmd = new byte[2] { 14, 57 }; // command to read arm dna
|
||||
byte[] armDnaRaw = context.Communicator.Send(armDnaPortCmd); //send command
|
||||
armDnaRaw = armDnaRaw.Reverse().ToArray();
|
||||
string arm_dna = BitConverter.ToUInt64(armDnaRaw, 0).ToString(); //convert hex dna to decimal
|
||||
int SlotNum = context.Communicator.SlotNo;
|
||||
ExternalCalibrationHandle extCaliHandle = new ExternalCalibrationHandle();
|
||||
if (SlotNum == slotList[0])
|
||||
{
|
||||
DelayHelper.Sleep(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
int Cried = slotList.FindIndex(x => x.Equals(SlotNum));
|
||||
while (true)
|
||||
{
|
||||
Thread.Sleep(1000);
|
||||
if (File.Exists(RINT_FILE_PATH + slotList[Cried - 1] + ".flag"))
|
||||
{
|
||||
File.Delete(RINT_FILE_PATH + slotList[Cried - 1] + ".flag");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
Thread.Sleep(10);
|
||||
var isPmurUploadOK = extCaliHandle.UploadFile(context.Communicator.ServerIP, RINT_FILE_PATH + context.Communicator.ServerIP + "_Pmur.txt", FileType.pmu_r);
|
||||
LogRawText($"Pmur Status: {isPmurUploadOK}");
|
||||
if (SlotNum < slotList[slotList.Count - 1])
|
||||
{
|
||||
StreamWriter swSignal = new StreamWriter(RINT_FILE_PATH + SlotNum + ".flag");
|
||||
swSignal.Flush();
|
||||
swSignal.Close();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Post-Test Rint with External Calibration Board
|
||||
/// Do FVMV Second time with MV Compensate
|
||||
/// Calculate Rint value and generate Pmu_r file
|
||||
/// </summary>
|
||||
/// <param name="context">info from ATE Software</param>
|
||||
/// <param name="testVersion"></param>
|
||||
void Rint_FVMV_2mA_Post(IFlowRunnerContext context, TestVersion testVersion)
|
||||
{
|
||||
List<int> ChannelDps = new List<int>();
|
||||
@@ -1628,10 +1659,7 @@ 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;
|
||||
StreamWriter sw = new StreamWriter(filename, true, Encoding.UTF8)
|
||||
{
|
||||
AutoFlush = true
|
||||
};
|
||||
|
||||
|
||||
extCaliHandle.SetPpmuExternalCalibration(extConnStr, extPort, SlotNum, ExternalCalibrationMode.Channel, ch, ExtCaliVI.V, ExtCaliLoad.RC_RL7, 0);//change channel
|
||||
if (loopk == 0)
|
||||
@@ -1659,8 +1687,11 @@ namespace Testrong.User.Program
|
||||
}
|
||||
PPMU.Force(PmuPinName, 0, PpmuMode.FVMV, PpmuIRange._2mA, VRange.Normal);
|
||||
|
||||
WriteSingleFile(
|
||||
filename: filename,
|
||||
StreamWriter sw = new StreamWriter(filename, true, Encoding.UTF8)
|
||||
{
|
||||
AutoFlush = true
|
||||
};
|
||||
WriteSingleFile(sw: sw,
|
||||
slot: SlotNum,
|
||||
dna: arm_dna,
|
||||
type: "PMU",
|
||||
@@ -1672,14 +1703,12 @@ namespace Testrong.User.Program
|
||||
ForceValue: ForceValue,
|
||||
AteMeasure: AteMeasure,
|
||||
DmmMeasure: DMMValue,
|
||||
TempValue: TempValue
|
||||
);
|
||||
TempValue: TempValue);
|
||||
|
||||
sw.Flush();
|
||||
sw.Close();
|
||||
|
||||
Metadata_handler(
|
||||
swdata: swdata,
|
||||
Metadata_handler(swdata: swdata,
|
||||
SlotNum: SlotNum,
|
||||
slotList: slotList,
|
||||
arm_dna: arm_dna,
|
||||
@@ -1691,8 +1720,8 @@ namespace Testrong.User.Program
|
||||
Rload: rload.ToString(),
|
||||
Range: "2mA",
|
||||
filepath: filepath,
|
||||
filetime: filetime
|
||||
);
|
||||
filetime: filetime);
|
||||
|
||||
}
|
||||
swdata.Flush();
|
||||
swdata.Close();
|
||||
@@ -1760,6 +1789,7 @@ namespace Testrong.User.Program
|
||||
ChannelFormat = Convert.ToString(ChannelNum);
|
||||
}
|
||||
Pmur.WriteLine($"ch {ChannelFormat} : {res:F3}");
|
||||
rInt[ChannelNum] = res; //Put R_Int into array
|
||||
datassingle.Clear();
|
||||
singlefile.Close();
|
||||
}
|
||||
@@ -1769,6 +1799,112 @@ namespace Testrong.User.Program
|
||||
SlotThreadLocker(SlotNum: SlotNum, slotList: slotList, pathFlag: "CAL");
|
||||
#endregion
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Use TFTP to upload DNA/MV file into Zynq
|
||||
/// </summary>
|
||||
/// <param name="context">info from ATE Software</param>
|
||||
void Rint_DataUpload(IFlowRunnerContext context)
|
||||
{
|
||||
var slotInfos = context.FlowCatalog.GetAll<SlotInfo>();
|
||||
List<int> slotList = new List<int>();
|
||||
for (int slotLen = 0; slotLen < slotInfos.Count; slotLen++)
|
||||
{
|
||||
if (slotInfos[slotLen].FirmwareVersion == "")
|
||||
{
|
||||
continue;
|
||||
}
|
||||
slotList.Add(slotInfos[slotLen].No);
|
||||
}
|
||||
byte[] armDnaPortCmd = new byte[2] { 14, 57 }; // command to read arm dna
|
||||
byte[] armDnaRaw = context.Communicator.Send(armDnaPortCmd); //send command
|
||||
armDnaRaw = armDnaRaw.Reverse().ToArray();
|
||||
string arm_dna = BitConverter.ToUInt64(armDnaRaw, 0).ToString(); //convert hex dna to decimal
|
||||
int SlotNum = context.Communicator.SlotNo;
|
||||
ExternalCalibrationHandle extCaliHandle = new ExternalCalibrationHandle();
|
||||
if (SlotNum == slotList[0])
|
||||
{
|
||||
DelayHelper.Sleep(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
int Cried = slotList.FindIndex(x => x.Equals(SlotNum));
|
||||
while (true)
|
||||
{
|
||||
Thread.Sleep(1000);
|
||||
if (File.Exists(RINT_COMPFILE_PATH + slotList[Cried - 1] + ".flag"))
|
||||
{
|
||||
File.Delete(RINT_COMPFILE_PATH + slotList[Cried - 1] + ".flag");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Thread.Sleep(10);
|
||||
var isDnaUploadOK = extCaliHandle.UploadFile(context.Communicator.ServerIP, RINT_COMPFILE_PATH + "DNA_" + context.Communicator.ServerIP + ".csv", FileType.dna);
|
||||
LogRawText($"Dna Status: {isDnaUploadOK}");
|
||||
|
||||
Thread.Sleep(10);
|
||||
var isMVUploadOK = extCaliHandle.UploadFile(context.Communicator.ServerIP, RINT_COMPFILE_PATH + context.Communicator.ServerIP + "_MV.csv", FileType.mv);
|
||||
LogRawText($"MV Status: {isMVUploadOK}");
|
||||
|
||||
SlotThreadLocker(SlotNum: SlotNum, slotList: slotList, pathFlag: "RINT");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Use TFTP to upload PMU_R(Rint) file into Zynq
|
||||
/// </summary>
|
||||
/// <param name="context">info from ATE Software</param>
|
||||
void Pmur_Upload(IFlowRunnerContext context)
|
||||
{
|
||||
var slotInfos = context.FlowCatalog.GetAll<SlotInfo>();
|
||||
List<int> slotList = new List<int>();
|
||||
for (int slotLen = 0; slotLen < slotInfos.Count; slotLen++)
|
||||
{
|
||||
if (slotInfos[slotLen].FirmwareVersion == "")
|
||||
{
|
||||
continue;
|
||||
}
|
||||
slotList.Add(slotInfos[slotLen].No);
|
||||
}
|
||||
byte[] armDnaPortCmd = new byte[2] { 14, 57 }; // command to read arm dna
|
||||
byte[] armDnaRaw = context.Communicator.Send(armDnaPortCmd); //send command
|
||||
armDnaRaw = armDnaRaw.Reverse().ToArray();
|
||||
string arm_dna = BitConverter.ToUInt64(armDnaRaw, 0).ToString(); //convert hex dna to decimal
|
||||
int SlotNum = context.Communicator.SlotNo;
|
||||
ExternalCalibrationHandle extCaliHandle = new ExternalCalibrationHandle();
|
||||
if (SlotNum == slotList[0])
|
||||
{
|
||||
DelayHelper.Sleep(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
int Cried = slotList.FindIndex(x => x.Equals(SlotNum));
|
||||
while (true)
|
||||
{
|
||||
Thread.Sleep(1000);
|
||||
if (File.Exists(RINT_FILE_PATH + slotList[Cried - 1] + ".flag"))
|
||||
{
|
||||
File.Delete(RINT_FILE_PATH + slotList[Cried - 1] + ".flag");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
Thread.Sleep(10);
|
||||
var isPmurUploadOK = extCaliHandle.UploadFile(context.Communicator.ServerIP, RINT_FILE_PATH + context.Communicator.ServerIP + "_Pmur.txt", FileType.pmu_r);
|
||||
LogRawText($"Pmur Status: {isPmurUploadOK}");
|
||||
if (SlotNum < slotList[slotList.Count - 1])
|
||||
{
|
||||
StreamWriter swSignal = new StreamWriter(RINT_FILE_PATH + SlotNum + ".flag");
|
||||
swSignal.Flush();
|
||||
swSignal.Close();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Put Initial Files into Zynq (MV MI DNA)
|
||||
/// </summary>
|
||||
/// <param name="context">info from ATE Software</param>
|
||||
void ExternalCalibrationReset(IFlowRunnerContext context)
|
||||
{
|
||||
var slotInfos = context.FlowCatalog.GetAll<SlotInfo>();
|
||||
@@ -1819,6 +1955,14 @@ namespace Testrong.User.Program
|
||||
|
||||
SlotThreadLocker(SlotNum: SlotNum, slotList: slotList, pathFlag: "CAL_Init");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get External Calibration Board's Resistance Value
|
||||
/// Will Call GetRloadValue(),
|
||||
/// Will get R Value for each different Type and Mode
|
||||
/// </summary>
|
||||
/// <param name="context">info from ATE Software</param>
|
||||
/// <param name="testVersion"></param>
|
||||
void DmmGetResValue(IFlowRunnerContext context, TestVersion testVersion)
|
||||
{
|
||||
//config DMM3458A
|
||||
@@ -1925,6 +2069,15 @@ namespace Testrong.User.Program
|
||||
|
||||
SlotThreadLocker(SlotNum: SlotNum, slotList: slotList, pathFlag: "CAL_Init");
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Main Function to Do External Instrument Calibration
|
||||
/// </summary>
|
||||
/// <param name="context">info from ATE Software</param>
|
||||
/// <param name="testVersion"></param>
|
||||
/// <param name="isFirstTest">Flag for first test or retest</param>
|
||||
/// <param name="isPreCheck">Flag for Precheck/Postcheck</param>
|
||||
void ExternalCalibrationCollect(IFlowRunnerContext context, TestVersion testVersion, bool isFirstTest, bool isPreCheck)
|
||||
{
|
||||
#region Read JSON
|
||||
@@ -2740,8 +2893,13 @@ namespace Testrong.User.Program
|
||||
string filepath = "Slot" + SlotNum + "_PMU_" + "ch" + ch + "_" + Mode + "_" + Rload + "_" + Range + ".csv";
|
||||
string filename = EXT_CAL_PATH + filepath;
|
||||
string filetime = DateTime.Now.ToString("yyyy-MM-dd HH-mm-ss");
|
||||
WriteSingleFile(
|
||||
filename: filename,
|
||||
|
||||
StreamWriter sw = new StreamWriter(filename, true, Encoding.UTF8)
|
||||
{
|
||||
AutoFlush = true
|
||||
};
|
||||
|
||||
WriteSingleFile(sw: sw,
|
||||
slot: SlotNum,
|
||||
dna: arm_dna,
|
||||
type: Type,
|
||||
@@ -2753,11 +2911,12 @@ namespace Testrong.User.Program
|
||||
ForceValue: ForceValueDir[ch],
|
||||
AteMeasure: AteMeasureDir[ch],
|
||||
DmmMeasure: DmmMeasureDir[ch],
|
||||
TempValue: TempValueDir[ch]
|
||||
);
|
||||
TempValue: TempValueDir[ch]);
|
||||
|
||||
Metadata_handler(
|
||||
swdata: swdata,
|
||||
sw.Flush();
|
||||
sw.Close();
|
||||
|
||||
Metadata_handler(swdata: swdata,
|
||||
SlotNum: SlotNum,
|
||||
slotList: slotList,
|
||||
arm_dna: arm_dna,
|
||||
@@ -2769,8 +2928,7 @@ namespace Testrong.User.Program
|
||||
Rload: rl,
|
||||
Range: Range,
|
||||
filepath: filepath,
|
||||
filetime: filetime
|
||||
);
|
||||
filetime: filetime);
|
||||
}
|
||||
}
|
||||
else if (Type == "DPS")
|
||||
@@ -2784,8 +2942,13 @@ namespace Testrong.User.Program
|
||||
double[,] ZeroExtR = {
|
||||
{ 0.0 , 0.0 , 0.0}
|
||||
};
|
||||
WriteSingleFile(
|
||||
filename: filename,
|
||||
|
||||
StreamWriter sw = new StreamWriter(filename, true, Encoding.UTF8)
|
||||
{
|
||||
AutoFlush = true
|
||||
};
|
||||
|
||||
WriteSingleFile(sw: sw,
|
||||
slot: SlotNum,
|
||||
dna: arm_dna,
|
||||
type: Info[loopi].chType,
|
||||
@@ -2797,11 +2960,12 @@ namespace Testrong.User.Program
|
||||
ForceValue: ForceValueDir[ch],
|
||||
AteMeasure: AteMeasureDir[ch],
|
||||
DmmMeasure: DmmMeasureDir[ch],
|
||||
TempValue: TempValueDir[ch]
|
||||
);
|
||||
TempValue: TempValueDir[ch]);
|
||||
|
||||
Metadata_handler(
|
||||
swdata: swdata,
|
||||
sw.Flush();
|
||||
sw.Close();
|
||||
|
||||
Metadata_handler(swdata: swdata,
|
||||
SlotNum: SlotNum,
|
||||
slotList: slotList,
|
||||
arm_dna: arm_dna,
|
||||
@@ -2813,8 +2977,7 @@ namespace Testrong.User.Program
|
||||
Rload: rl,
|
||||
Range: Range,
|
||||
filepath: filepath,
|
||||
filetime: filetime
|
||||
);
|
||||
filetime: filetime);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
@@ -2832,6 +2995,10 @@ namespace Testrong.User.Program
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Use TFTP to upload DNA/MV/MI file into Zynq
|
||||
/// </summary>
|
||||
/// <param name="context">info from ATE Software</param>
|
||||
void ExternalCalibrationWriteCalFiles(IFlowRunnerContext context)
|
||||
{
|
||||
//read dna and ip
|
||||
@@ -2885,6 +3052,12 @@ namespace Testrong.User.Program
|
||||
SlotThreadLocker(SlotNum: SlotNum, slotList: slotList, pathFlag: "CAL_COM");
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get Measurments For Rint w/ GND Board
|
||||
/// Only Use FVMI 2mA Range
|
||||
/// </summary>
|
||||
/// <param name="context">info from ATE Software</param>
|
||||
void Rint_GND_FVMI_2mA(IFlowRunnerContext context)
|
||||
{
|
||||
List<int> ChannelPmu = new List<int>();
|
||||
@@ -2989,8 +3162,7 @@ namespace Testrong.User.Program
|
||||
}
|
||||
PPMU.Force(PmuPinName, 0, PpmuMode.FVMI, PpmuIRange._2mA, VRange.Normal);
|
||||
|
||||
WriteSingleFile(
|
||||
filename: filename,
|
||||
WriteSingleFile(sw: sw,
|
||||
slot: SlotNum,
|
||||
dna: arm_dna,
|
||||
type: "PMU",
|
||||
@@ -3002,22 +3174,26 @@ namespace Testrong.User.Program
|
||||
ForceValue: ForceValue,
|
||||
AteMeasure: AteMeasure,
|
||||
DmmMeasure: DMMValue,
|
||||
TempValue: TempValue
|
||||
);
|
||||
TempValue: TempValue,
|
||||
contextFormat: "RintGND");
|
||||
|
||||
sw.Flush();
|
||||
sw.Close();
|
||||
swdata.Write($"{arm_dna},");
|
||||
swdata.Write("PMU,");
|
||||
swdata.Write($"{ChannelPmu[loopk]},");
|
||||
swdata.Write($"FVMI,");
|
||||
swdata.Write($"Hi-Z,");
|
||||
swdata.Write($"2mA,");
|
||||
swdata.Write("20V,");
|
||||
swdata.Write("13V,");
|
||||
swdata.Write($"{filepath},");
|
||||
swdata.Write($"{filetime}\n");
|
||||
swdata.Flush();
|
||||
|
||||
Metadata_handler(swdata: swdata,
|
||||
SlotNum: SlotNum,
|
||||
slotList: slotList,
|
||||
arm_dna: arm_dna,
|
||||
context: context,
|
||||
init_Flag: false,
|
||||
Type: "PMU",
|
||||
Channel: ch,
|
||||
Mode: "FVMI",
|
||||
Rload: "Hi-Z",
|
||||
Range: "2mA",
|
||||
filepath: filepath,
|
||||
filetime: filetime);
|
||||
|
||||
}
|
||||
swdata.Flush();
|
||||
swdata.Close();
|
||||
|
||||
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
@@ -2421,3 +2421,4 @@ D:\WORK\ManLin\Verify\UserProgram_time\Testrong.User.Program\obj\x64\Debug\Testr
|
||||
D:\WORK\ManLin\Verify\UserProgram_time\Testrong.User.Program\obj\x64\Debug\Testrong.A8AD3C05.Up2Date
|
||||
D:\WORK\ManLin\Verify\UserProgram_time\Testrong.User.Program\obj\x64\Debug\UserProgram.dll
|
||||
D:\WORK\ManLin\Verify\UserProgram_time\Testrong.User.Program\obj\x64\Debug\UserProgram.pdb
|
||||
D:\WORK\ManLin\Verify\UserProgram_time\Testrong.User.Program\bin\x64\Debug\UserProgram.xml
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user