Professional Documents
Culture Documents
CTT Wanna Be
CTT Wanna Be
// Write Instruction
#region Get Param
cdRes = meterConn.GetCosem(classID, attrID, obisCode, null);
cpy0 = cdRes.ToString();
cpy0 = EDMI.Indonesia.DLMS.DLMSLib.Hex(cpy0);
cpy0 = "#03#01";
hex = cpy0.Replace("#", "").Replace(" ", "");
sParam = EDMI.Indonesia.DLMS.DLMSLib.StringFromHex(hex);
cdParam = EDMI.Indonesia.DLMS.DLMSDecoder.DecodeDLMS(sParam);
result = meterConn.SetCosem(classID, attrID, obisCode, cdParam);
if (!result) { print(meterConn.LastError); }
else
{
}
System.Threading.Thread.Sleep(50);
}
else
{
if (cpy0 == "#03#01")
{
cpy0 = "#03#00";
hex = cpy0.Replace("#", "").Replace(" ", "");
sParam = EDMI.Indonesia.DLMS.DLMSLib.StringFromHex(hex);
cdParam = EDMI.Indonesia.DLMS.DLMSDecoder.DecodeDLMS(sParam);
result = meterConn.SetCosem(classID, attrID, obisCode,
cdParam);
if (!result) { print(meterConn.LastError); }
else
{
}
System.Threading.Thread.Sleep(50);
}
}
#endregion
if (cpy2 == cpy0)
{
VWPS = VWPS + 1;
EVAL = "PASS";
System.Threading.Thread.Sleep(30);
}
else
{
EVT.Add("\t\tInvalid Data on ID Class " + Data[A1 + 4] + "\t OBIS
Code " + IC + "\t Attribute " + ATTR);
EVAL = "FAIL";
System.Threading.Thread.Sleep(30);
VWPF = VWPF + 1;
}
System.Threading.Thread.Sleep(30);
#endregion
}
static void Access_Right_Identifier(DLMSSet meterConn)
{
}
static void Loop_Atr(DLMSSet meterConn)
{
// Attribute Pointer
A3 = 0;
A4 = 0;
// Looping attribute
for (int bc = 0; bc < SumAtt; bc++)
{
// Attribute identifier
if (Data[A1 + A3 + 19] == 2 && Data[A1 + A3 + 20] == 3 && Data[A1 +
A3 + 21] == 15)
{
// Attribute identifier
ATTR = Data[A1 + A3 + 22];
attrID = Convert.ToByte(ATTR);
// Print Result
print("\t " + ATTR + "\t\t " + AC_Stat + " \t\t " +
STAT_TEST + "\t\t " + EVAL);
System.Threading.Thread.Sleep(80);
// Attribute Counter
A4 = A4 + 1;
}
else
{
// Atrribute limiter
if (A4 == SumAtt)
{
bc = (SumAtt - 1);
}
else
{
bc = 0;
}
}
}
static void Loop_OBIS(DLMSSet meterConn)
{
// Looping Obis
for (int ab = 0; ab < ObisLoop; ab++)
{
// Class ID Identifier
classID = Convert.ToInt32(Data[A1 + 4]);
// Obis counter
A2 = A2 + 1;
}
else
{
// Obis Limiter
if (A2 == ObisLoop)
{
ab = (ObisLoop - 1);
}
else
{
ab = 0;
}
System.Threading.Thread.Sleep(50);
}
static void Get_Assoc(DLMSSet meterConn)
{
//PrintParam(meterConn);
System.Threading.Thread.Sleep(50);
//ConnectSPadm(meterConn); //SEC A5
//ConnectManuf(meterConn); //SEC A120
ConnectManagement(meterConn); //IDIS Gen 2
//ConnectAdminGen1(meterConn); //Gen 1
Get_Assoc(meterConn);
Loop_OBIS(meterConn);
Testing_Summary();
Reset_Baud(meterConn);
#endregion