판정 프로토콜 수정

- 생산속도, 재전송 기능 추가
main
DESKTOP-S459P9R\LSJ 2025-07-10 14:57:37 +09:00
parent b08fd0b845
commit 24323daf94
3 changed files with 234 additions and 127 deletions

View File

@ -1518,7 +1518,7 @@ namespace INT99DC_7C
{
this.m_JudgmentStatus = value;
this.ProductionSpeedCalculation();
//this.ProductionSpeedCalculation();
if (value == DataStore.JudgmentStatus.Under)
{
@ -3770,4 +3770,58 @@ namespace INT99DC_7C
#endregion
}
#endregion
#region CommunicationRespone
public class CommunicationRespone
{
#region Field
private bool m_IsFirst;
private string m_TransactionID;
private string m_TransferCount;
#endregion
#region Constructor
public CommunicationRespone()
{
this.Initialization();
}
#endregion
#region Property
public bool IsFirst
{
get { return this.m_IsFirst; }
set { this.m_IsFirst = value; }
}
/// <summary>
/// Data ID (0~9)
/// </summary>
public string TransactionID
{
get { return this.m_TransactionID; }
set { this.m_TransactionID = value; }
}
/// <summary>
/// 재전송 CNT (0~9)
/// </summary>
public string TransferCount
{
get { return this.m_TransferCount; }
set { this.m_TransferCount = value; }
}
#endregion
#region Method
public void Initialization()
{
this.IsFirst = false;
this.TransactionID = "a";
this.TransferCount = "a";
}
#endregion
}
#endregion
}

View File

@ -111,6 +111,8 @@ namespace INT99DC_7C.Forms
public List<string> ListDllUserName;
// TotalPass Count
public Counter CurrentAlarmTotalPassCnt;
// Communication Respone
private CommunicationRespone CurrentComRespone;
// Collection
private Collection<int> CollectionGraphData; // 판정설정 그래프 데이터
@ -410,6 +412,7 @@ namespace INT99DC_7C.Forms
this.CurrentOptionParameterItem = new OptionParameterItem();
this.CurrentUserGroup = new UserGroup();
this.CurrentDataViewerFilter = new DataViewerFilter();
this.CurrentComRespone = new CommunicationRespone();
this.ListDllUserName = new List<string>();
this.ListDllUserName.Clear();
@ -908,6 +911,9 @@ namespace INT99DC_7C.Forms
else
this.timerOPT1.Enabled = false;
// Respone
this.CurrentComRespone.Initialization();
// Part 11
if (this.SystemConfig.IsPart11 == true)
this.SetTrackingHistoryData(DataStore.TrackingOperation.EquipmentStop, "");
@ -980,7 +986,7 @@ namespace INT99DC_7C.Forms
private int ReceiveCommandS(string strTemp)
{
int ret = 0;
string cmd = "", lane = "", receiveData = "";
string cmd = "", lane = "", receiveData = "", dataID = "", transferCNT = "";
// SIZE 확인
if (this.SizeCheck("S", strTemp) == false)
@ -1004,6 +1010,8 @@ namespace INT99DC_7C.Forms
this.smartFileCommunicationLog.WriteString(string.Format("Receive ({0:yyyy-MM-dd HH:mm:ss}): {1}", DateTime.Now, strTemp));
cmd = strTemp.Substring(0, 3);
dataID = strTemp.Substring(3, 1);
transferCNT = strTemp.Substring(4, 1);
lane = strTemp.Substring(5, 1);
receiveData = strTemp.Substring(10, strTemp.Length - 12);
@ -1018,7 +1026,7 @@ namespace INT99DC_7C.Forms
return ret;
break;
case "SR0":
if ((ret = this.ReceiveCommandSR0(lane, receiveData)) != 0)
if ((ret = this.ReceiveCommandSR0(lane, receiveData, dataID, transferCNT)) != 0)
return ret;
break;
case "SC0":
@ -1193,6 +1201,23 @@ namespace INT99DC_7C.Forms
this.CurrentCalibrationItem.Constant11 = receiveData.Substring(91, 7).Trim();
this.CurrentCalibrationItem.Constant12 = receiveData.Substring(98, 7).Trim();
break;
case 15:
this.CurrentCalibrationItem.Constant1 = receiveData.Substring(21, 7).Trim();
this.CurrentCalibrationItem.Constant2 = receiveData.Substring(28, 7).Trim();
this.CurrentCalibrationItem.Constant3 = receiveData.Substring(35, 7).Trim();
this.CurrentCalibrationItem.Constant4 = receiveData.Substring(42, 7).Trim();
this.CurrentCalibrationItem.Constant5 = receiveData.Substring(49, 7).Trim();
this.CurrentCalibrationItem.Constant6 = receiveData.Substring(56, 7).Trim();
this.CurrentCalibrationItem.Constant7 = receiveData.Substring(63, 7).Trim();
this.CurrentCalibrationItem.Constant8 = receiveData.Substring(70, 7).Trim();
this.CurrentCalibrationItem.Constant9 = receiveData.Substring(77, 7).Trim();
this.CurrentCalibrationItem.Constant10 = receiveData.Substring(84, 7).Trim();
this.CurrentCalibrationItem.Constant11 = receiveData.Substring(91, 7).Trim();
this.CurrentCalibrationItem.Constant12 = receiveData.Substring(98, 7).Trim();
this.CurrentCalibrationItem.Constant13 = receiveData.Substring(105, 7).Trim();
this.CurrentCalibrationItem.Constant14 = receiveData.Substring(112, 7).Trim();
this.CurrentCalibrationItem.Constant15 = receiveData.Substring(119, 7).Trim();
break;
default:
break;
}
@ -1460,7 +1485,7 @@ namespace INT99DC_7C.Forms
return ret;
}
// 운전시 중량
private int ReceiveCommandSR0(string lane, string receiveData)
private int ReceiveCommandSR0(string lane, string receiveData, string transactionID, string transferCNT)
{
bool result = false;
int ret = 0;
@ -1482,17 +1507,23 @@ namespace INT99DC_7C.Forms
{
case "Z":
#region Value Assign
if (this.CurrentComRespone.TransactionID != transactionID)
{
this.CurrentComRespone.TransactionID = transactionID;
this.CurrentComRespone.TransferCount = transferCNT;
if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormMainDisplay)
{
if (this.SystemConfig.IsWeightViewForward == true)
{
for (int i = 0; i < this.SystemConfig.EquipmentColumns; i++)
{
this.CollectionWeightData[i].JudgmentStatus = Helper.StringToJudgmentStatus(receiveData.Substring(i * 12, 2));
this.CollectionWeightData[i].Weight = Helper.StringToWeight(receiveData.Substring(i * 12 + 2, 5), this.SystemConfig.DecimalPlaces);
this.CollectionWeightData[i].WeightString = receiveData.Substring(i * 12 + 2, 5);
this.CollectionWeightData[i].ADCValue = receiveData.Substring(i * 12 + 7, 5);
this.CollectionWeightData[i].JudgmentStatus = Helper.StringToJudgmentStatus(receiveData.Substring(i * 7, 2));
this.CollectionWeightData[i].Weight = Helper.StringToWeight(receiveData.Substring(i * 7 + 2, 5), this.SystemConfig.DecimalPlaces);
this.CollectionWeightData[i].WeightString = receiveData.Substring(i * 7 + 2, 5);
//this.CollectionWeightData[i].ADCValue = receiveData.Substring(i * 12 + 7, 5);
if (this.SystemConfig.IsModbusEnable == true)
this.Update30000ModbusData(i);
}
}
@ -1500,11 +1531,12 @@ namespace INT99DC_7C.Forms
{
for (int i = 1; i <= this.SystemConfig.EquipmentColumns; i++)
{
this.CollectionWeightData[this.CollectionWeightData.Count - i].JudgmentStatus = Helper.StringToJudgmentStatus(receiveData.Substring((i - 1) * 12, 2));
this.CollectionWeightData[this.CollectionWeightData.Count - i].Weight = Helper.StringToWeight(receiveData.Substring((i - 1) * 12 + 2, 5), this.SystemConfig.DecimalPlaces);
this.CollectionWeightData[this.CollectionWeightData.Count - i].WeightString = receiveData.Substring((i - 1) * 12 + 2, 5);
this.CollectionWeightData[this.CollectionWeightData.Count - i].ADCValue = receiveData.Substring((i - 1) * 12 + 7, 5);
this.CollectionWeightData[this.CollectionWeightData.Count - i].JudgmentStatus = Helper.StringToJudgmentStatus(receiveData.Substring((i - 1) * 7, 2));
this.CollectionWeightData[this.CollectionWeightData.Count - i].Weight = Helper.StringToWeight(receiveData.Substring((i - 1) * 7 + 2, 5), this.SystemConfig.DecimalPlaces);
this.CollectionWeightData[this.CollectionWeightData.Count - i].WeightString = receiveData.Substring((i - 1) * 7 + 2, 5);
//this.CollectionWeightData[this.CollectionWeightData.Count - i].ADCValue = receiveData.Substring((i - 1) * 12 + 7, 5);
if (this.SystemConfig.IsModbusEnable == true)
this.Update30000ModbusData(this.CollectionWeightData.Count - i);
}
}
@ -1515,21 +1547,31 @@ namespace INT99DC_7C.Forms
{
for (int i = 0; i < this.SystemConfig.EquipmentColumns; i++)
{
this.CollectionWeightDataTest[i].JudgmentStatus = Helper.StringToJudgmentStatus(receiveData.Substring(i * 12, 2));
this.CollectionWeightDataTest[i].Weight = Helper.StringToWeight(receiveData.Substring(i * 12 + 2, 5), this.SystemConfig.DecimalPlaces);
this.CollectionWeightDataTest[i].ADCValue = receiveData.Substring(i * 12 + 7, 5);
this.CollectionWeightDataTest[i].JudgmentStatus = Helper.StringToJudgmentStatus(receiveData.Substring(i * 7, 2));
this.CollectionWeightDataTest[i].Weight = Helper.StringToWeight(receiveData.Substring(i * 7 + 2, 5), this.SystemConfig.DecimalPlaces);
//this.CollectionWeightDataTest[i].ADCValue = receiveData.Substring(i * 12 + 7, 5);
}
}
else
{
for (int i = 1; i <= this.SystemConfig.EquipmentColumns; i++)
{
this.CollectionWeightDataTest[this.CollectionWeightDataTest.Count - i].JudgmentStatus = Helper.StringToJudgmentStatus(receiveData.Substring((i - 1) * 12, 2));
this.CollectionWeightDataTest[this.CollectionWeightDataTest.Count - i].Weight = Helper.StringToWeight(receiveData.Substring((i - 1) * 12 + 2, 5), this.SystemConfig.DecimalPlaces);
this.CollectionWeightDataTest[this.CollectionWeightDataTest.Count - i].ADCValue = receiveData.Substring((i - 1) * 12 + 7, 5);
this.CollectionWeightDataTest[this.CollectionWeightDataTest.Count - i].JudgmentStatus = Helper.StringToJudgmentStatus(receiveData.Substring((i - 1) * 7, 2));
this.CollectionWeightDataTest[this.CollectionWeightDataTest.Count - i].Weight = Helper.StringToWeight(receiveData.Substring((i - 1) * 7 + 2, 5), this.SystemConfig.DecimalPlaces);
//this.CollectionWeightDataTest[this.CollectionWeightDataTest.Count - i].ADCValue = receiveData.Substring((i - 1) * 12 + 7, 5);
}
}
}
// 생산속도
try
{
this.CollectionWeightData[0].ProductionSpeed = int.Parse(receiveData.Substring(receiveData.Length - 4, 4).Trim());
}
catch
{
this.CollectionWeightData[0].ProductionSpeed = 0;
}
#endregion
if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormMainDisplay)
{
@ -1636,6 +1678,7 @@ namespace INT99DC_7C.Forms
{
this.ChildFormEquipmentTest.UpdateStartWeightDisplay(this.EquipmentStatus, this.CollectionWeightDataTest);
}
}
break;
default:
break;
@ -1699,7 +1742,7 @@ namespace INT99DC_7C.Forms
// 판정설정 그래프
private int ReceiveCommandSG0(string lane, string receiveData)
{
int ret = 0, temp = 12;
int ret = 0, temp = 20;
switch (lane)
{
@ -8782,10 +8825,12 @@ namespace INT99DC_7C.Forms
//Console.WriteLine(string.Format("{0} : DefaultSetting2", DateTime.Now));
// Modbus Data Update
if (this.SystemConfig.IsModbusEnable == true)
{
this.Update30000ModbusData();
for (int i = 0; i < this.SystemConfig.EquipmentColumns; i++)
this.Update30000ModbusData(i);
}
//Console.WriteLine(string.Format("{0} : Update30000ModbusData", DateTime.Now));
// UserManager 초기화

View File

@ -2019,6 +2019,14 @@ namespace INT99DC_7C.Forms
if (this.MainDisplayTable12 != null)
this.MainDisplayTable12.UpdateBypassDisplay(this.ParentForm.CollectionWeightData);
break;
case 15:
if (this.MainDisplayEachBarGraph15 != null)
this.MainDisplayEachBarGraph15.UpdateBypassDisplay(this.ParentForm.CollectionWeightData);
if (this.MainDisplayDotGraph15 != null)
this.MainDisplayDotGraph15.UpdateBypassDisplay(this.ParentForm.CollectionWeightData);
if (this.MainDisplayTable15 != null)
this.MainDisplayTable15.UpdateBypassDisplay(this.ParentForm.CollectionWeightData);
break;
default:
break;
}