- Printer - Test Send 버튼 눌렀을 때 현재 중량 전송

자리수 미세 조정
 - 재전송 기능 OFF 후 사용
   고속형은 재전송 카운트가 올라가지 않기 때문에 그 부분 수정함
master
DESKTOP-999R8N3\CJY 2024-02-13 14:20:34 +09:00
parent 5755987667
commit ea9816f05f
8 changed files with 1045 additions and 958 deletions

View File

@ -641,7 +641,9 @@ namespace ITC81DB_0H.Controls
#region Printer
sb.Append("0001");
sb.Append(" Pass");
sb.Append(" " + Helper.StringToDecimalPlaces("1234", this.ParentForm.ParentForm.SystemConfig1.DecimalPlaces));
sb.Append(this.ParentForm.ParentForm.PadLeft(9, Helper.DoubleToString
(this.ParentForm.ParentForm.CurrentWeightData.Weight, this.ParentForm.ParentForm.SystemConfig1.DecimalPlaces)));
sb.Append(" ");
sb.Append("1234567890");
#endregion
break;
@ -1020,6 +1022,19 @@ namespace ITC81DB_0H.Controls
byteArray[11] = Helper.ChecksumCalculator(byteArray);
#endregion
break;
case (int)Define.E_CommMode.f22_Modbus:
#region Modbus TCP(16. Write Multiple Registers)
if (this.ParentForm.ParentForm.SystemConfig3.IsModbus == true)
{
if (this.ParentForm.ParentForm.SystemConfig2.ModbusTCPSelectFunction == (int)Define.E_ModbusFunction._16_WriteMultipleRegister)
{
byte[] sendData = this.ParentForm.ParentForm.Modbus.MakeTCPSendAllData(this.ParentForm.ParentForm.Transfer_22_Modbus_Write(), this.ParentForm.ParentForm.SystemConfig2.ModbusTCPStartAddress);
this.ParentForm.ParentForm.EthernetWeightDataForModbus(sendData);
}
}
#endregion
break;
case 23:
#region STD2
sb.Append((char)0x02);

View File

@ -1038,7 +1038,9 @@ namespace ITC81DB_0H.Controls
#region Printer
sb.Append("0001");
sb.Append(" Pass");
sb.Append(" " + Helper.StringToDecimalPlaces("1234", this.ParentForm.ParentForm.SystemConfig1.DecimalPlaces));
sb.Append(this.ParentForm.ParentForm.PadLeft(9, Helper.DoubleToString
(this.ParentForm.ParentForm.CurrentWeightData.Weight, this.ParentForm.ParentForm.SystemConfig1.DecimalPlaces)));
sb.Append(" ");
sb.Append("1234567890");
#endregion
break;

View File

@ -2829,6 +2829,7 @@ namespace ITC81DB_0H
public class SystemConfigurationItem3
{
#region Field
private bool m_IsModbus;
private bool m_IsPart11;
private int m_MULTiJETSlaveAddressCOM1;
@ -2847,6 +2848,11 @@ namespace ITC81DB_0H
#endregion
#region Property
public bool IsModbus
{
get { return this.m_IsModbus; }
set { this.m_IsModbus = value; }
}
public bool IsPart11
{
get { return this.m_IsPart11; }
@ -2884,6 +2890,7 @@ namespace ITC81DB_0H
#region Method
public void Initialization()
{
this.IsModbus = false;
this.IsPart11 = false;
this.MULTiJETSlaveAddressCOM1 = 58;
@ -2928,7 +2935,7 @@ namespace ITC81DB_0H
public bool DummyBool26;
public bool DummyBool27;
public bool DummyBool28;
public bool DummyBool29;
public bool IsModbus;
public bool IsPart11;
public int DummyInt1;

View File

@ -25,8 +25,8 @@ namespace ITC81DB_0H.Forms
public partial class FormMain : Form
{
#region Field
public static string DisplayVersion = "3.3.0";
public static string ReleaseDate = "2024.02.01";
public static string DisplayVersion = "3.3.1";
public static string ReleaseDate = "2024.02.07";
private SmartSplash SmartSplashProgramLoad;
public bool IsCommunicationLogOpen;
@ -55,7 +55,7 @@ namespace ITC81DB_0H.Forms
// 재전송 기능
public int MissingCommIDCount;
public int CommID;
public bool FlagSerialDll = true;
public bool FlagSerialDll = false;
private string ComPortMainToLCD;
private Queue<string> QueueCommunicationRecive; // 큐 통신 데이터용
private int FlagComRetry3th; // 3회 재전송 횟수
@ -65,7 +65,6 @@ namespace ITC81DB_0H.Forms
private byte[] ClientSendDatabyteArray;
private string ClientSendDataString;
#region 통신관련
// OPT2
private SerialOPT2 CurrentOPT2COM1;
@ -95,6 +94,9 @@ namespace ITC81DB_0H.Forms
// OPC
private static int TotalBytes = 48; // 전체 bytes
// OPC
private static int ModbusTotalBytes = 80; // 전체 bytes
#endregion
// 로그온 색상
@ -203,9 +205,6 @@ namespace ITC81DB_0H.Forms
private int HMCOM4_Step;
private int HMEthernet_Step;
// OPC
private static int ModbusTotalBytes = 80; // 전체 bytes
// Ethernet
private bool IsEthernetThreadStop;
private bool IsEthernetTransferData;
@ -2052,6 +2051,9 @@ namespace ITC81DB_0H.Forms
}
catch
{
// 로그
if (this.IsCommunicationLogOpen == true)
this.smartFileCommunicationLog.WriteString(string.Format("Receive ({0:yyyy-MM-dd HH:mm:ss}): {1} : Receive Command Data CHKSUM Error", DateTime.Now, strTemp));
}
}
@ -3108,6 +3110,9 @@ namespace ITC81DB_0H.Forms
//// 통신 제대로 받으면 ACK
//this.TransferData(string.Format("{0}{1}{2}{3}", CommunicationCommand.RunWeightData, (int)Define.E_ResponseData.ACK, dataID, transferCount), CommunicationID.MainBoard);
if (this.FlagSerialDll == true)
{
if (this.CommID % 10 != int.Parse(transactionID))
{
this.MissingCommIDCount++;
@ -3120,6 +3125,10 @@ namespace ITC81DB_0H.Forms
{
this.CurrentComRespone.TransactionID = transactionID;
this.CurrentComRespone.TransferCount = transferCount;
}
else
return -1;
}
if (this.CurrentWeightData.WeightString.Trim() == "-9999" || this.CurrentWeightData.WeightString.Trim() == "9999"
|| this.CurrentWeightData.WeightString.Trim() == "99999")
@ -4023,6 +4032,7 @@ namespace ITC81DB_0H.Forms
if (this.ChildFormMainDisplay != null)
this.ChildFormMainDisplay.UpdateStartWeightDisplay(this.CurrentSystemStatus.Equipment, this.CurrentProductItem, this.CurrentWeightData);
if (this.SystemConfig1.DatabackupFormat == 1)
{
#region OPT1 - 종근당 옵션
@ -4065,7 +4075,6 @@ namespace ITC81DB_0H.Forms
default:
break;
}
}
break;
default:
break;
@ -4384,8 +4393,9 @@ namespace ITC81DB_0H.Forms
}
else
sb.Append(string.Format("{0,8}", weight.JudgmentStatus));
sValue = Helper.DoubleToString(weight.Weight, this.SystemConfig1.DecimalPlaces);
sb.Append(sValue.PadLeft(10, ' '));
sb.Append(this.PadLeft(9, Helper.DoubleToString(weight.Weight, this.SystemConfig1.DecimalPlaces)));
sb.Append(" ");
sValue = weight.TotalCount.ToString();
sb.Append(sValue.PadLeft(10, ' '));
@ -9120,7 +9130,7 @@ namespace ITC81DB_0H.Forms
structItem.DummyBool26 = false;
structItem.DummyBool27 = false;
structItem.DummyBool28 = false;
structItem.DummyBool29 = false;
structItem.IsModbus = this.SystemConfig3.IsModbus;
structItem.IsPart11 = this.SystemConfig3.IsPart11;
structItem.DummyInt1 = 0;
@ -9222,7 +9232,7 @@ namespace ITC81DB_0H.Forms
structItem.DummyBool26 = false;
structItem.DummyBool27 = false;
structItem.DummyBool28 = false;
structItem.DummyBool29 = false;
structItem.IsModbus = item.IsModbus;
structItem.IsPart11 = item.IsPart11;
structItem.DummyInt1 = 0;
@ -9302,6 +9312,7 @@ namespace ITC81DB_0H.Forms
{
structItem = (StructSystemConfigurationItem3)this.smartFileIO.ReadStructure(1, typeof(StructSystemConfigurationItem3));
this.SystemConfig3.IsModbus = structItem.IsModbus;
this.SystemConfig3.IsPart11 = structItem.IsPart11;
this.SystemConfig3.MULTiJETSlaveAddressCOM1 = structItem.MULTiJETSlaveAddressCOM1;
@ -12684,9 +12695,12 @@ namespace ITC81DB_0H.Forms
this.OpenSmartSerialPort2();
// 통신 버퍼용
if (this.FlagSerialDll == true)
{
this.smartThreadSerialPort2Read.Priority = ThreadPriority.Normal;
this.smartThreadSerialPort2Read.Start();
//this.smartThreadSerialPort2OverRun.Start();
}
#region Communication
if (this.SystemConfig1.SerialCOM1Mode != (int)Define.E_CommMode.f0_None)
@ -13147,7 +13161,28 @@ namespace ITC81DB_0H.Forms
if ((receiveDataState == SmartSerialPort.FRAMEDATAREADSTATUS.EMPTY) || (receiveDataState == SmartSerialPort.FRAMEDATAREADSTATUS.FAILDATA))
return;
if (this.FlagSerialDll == true)
this.SerialReceiveData(strTemp);
else
{
this.ReceiveData(strTemp);
// 통신 확인
if (this.CommunicationCheckCount / 3 == 1)
{
if (this.ChildFormMainDisplay != null)
this.ChildFormMainDisplay.pictureBoxCommunicationStatus.Visible = true;
this.CommunicationCheckCount = 0;
}
else
{
if (this.ChildFormMainDisplay != null)
this.ChildFormMainDisplay.pictureBoxCommunicationStatus.Visible = false;
this.CommunicationCheckCount += 1;
}
}
}
private void smartSerialPort3_OnReadQueueEvent()
{
@ -13792,7 +13827,6 @@ namespace ITC81DB_0H.Forms
byte[] readByte;
string strRecData = "";
byte[] sendDatas = new byte[57];
byte[] madeDatas = new byte[TotalBytes];
try
{
@ -13977,8 +14011,8 @@ namespace ITC81DB_0H.Forms
// 로그
if (this.IsCommunicationLogOpen == true)
{
this.smartFileCommunicationLog.WriteString(string.Format("Receive TCP ({0:yyyy-MM-dd HH:mm:ss}): {1}", DateTime.Now, BitConverter.ToString(readByte)));
this.smartFileCommunicationLog.WriteString(string.Format("Send TCP ({0:yyyy-MM-dd HH:mm:ss}): {1}", DateTime.Now, BitConverter.ToString(responseData)));
//this.smartFileCommunicationLog.WriteString(string.Format("Receive TCP ({0:yyyy-MM-dd HH:mm:ss}): {1}", DateTime.Now, BitConverter.ToString(readByte)));
//this.smartFileCommunicationLog.WriteString(string.Format("Send TCP ({0:yyyy-MM-dd HH:mm:ss}): {1}", DateTime.Now, BitConverter.ToString(responseData)));
}
}
catch

View File

@ -654,6 +654,22 @@ namespace ITC81DB_0H.Forms
if (this.labelUserID.Text != id)
this.labelUserID.Text = id;
}
public void UpdateMainTitleDisplay(ProductItem pItem)
{
string value = "";
value = pItem.Number.ToString();
if (this.buttonProductNo.Text != value)
this.buttonProductNo.Text = value;
value = pItem.Name;
if (this.labelProductName.Text != value)
this.labelProductName.Text = value;
value = pItem.LotNo;
if (this.labelLotNo.Text != value)
this.labelLotNo.Text = value;
}
public void UpdateEquipmentStatusDisplay(Define.E_EquipmentStatus status)
{
if (status == Define.E_EquipmentStatus.Start)
@ -1429,7 +1445,12 @@ namespace ITC81DB_0H.Forms
this.ParentForm.CurrentSystemStatus.CurrentDisplay = Define.E_DisplayStore.MainDisplay;
this.ParentForm.SetDisplayMode(Define.E_DisplayMode.Normal);
this.ProductChange(this.ParentForm.SystemConfig1.ProductNumber);
#region 순서변경 금지(품번 중량 변경)
this.ParentForm.TransferCurrentProductItem(this.ParentForm.CurrentProductItem);
this.RescaleControl(this.ParentForm.CurrentProductItem);
this.UpdateMainTitleDisplay(this.ParentForm.CurrentProductItem);
//this.SendCommProductChange(this.ParentForm.SystemConfig1.ProductNumber);
#endregion
// Log - smartFile Close
this.ParentForm.ChildFormMenu.FileClose();
@ -1465,8 +1486,8 @@ namespace ITC81DB_0H.Forms
//this.CurrentDisplay = Define.E_MainDisplayStore.DisplayStartBarGraph;
//this.DisplayBottomMain(this.CurrentDisplay);
//this.MainDisplayWeightBigScreen.DisplayRefresh(status);
//this.MainDisplayWeightSmall.DisplayRefresh(status);
this.MainDisplayWeightBigScreen.DisplayRefresh(status);
this.MainDisplayWeightSmall.DisplayRefresh(status);
//this.MainDisplayMenu.DisplayRefresh(status);
//this.MainDisplayStart.DisplayRefresh(status);
//this.MainDisplayFeedback.DisplayRefresh(status);

View File

@ -12,6 +12,14 @@
기본형 컨베어 고정밀센서 계량기
*/
@ Ver 3.3.1 by CJY
- 2024.02.07
- Ver 3.3.0 Modify
- Printer - Test Send 버튼 눌렀을 때 현재 중량 전송
자리수 미세 조정
- 재전송 기능 OFF 후 사용
고속형은 재전송 카운트가 올라가지 않기 때문에 그 부분 수정함
@ Ver 3.3.0 by CJY
- 2024.02.01
- Ver 3.2.0 Modify