Ethernet / Modbus쪽 버그 수정

master
CJY 2025-12-11 14:45:58 +09:00
parent cabbcf0fe4
commit 0de1af69d0
1 changed files with 84 additions and 45 deletions

View File

@ -886,7 +886,7 @@ namespace INT69DC_7C.Forms
this.CollectionWeightData[index].WeightString = receiveData.Substring(2, 5);
this.CollectionWeightData[index].ADCValue = receiveData.Substring(7, 5);
if (this.SystemConfig.EthernetOperationMode == 3)
if (this.SystemConfig.EthernetMode == 3)
this.Update30000ModbusData(index);
}
else
@ -898,7 +898,7 @@ namespace INT69DC_7C.Forms
this.CollectionWeightData[index2].WeightString = receiveData.Substring(2, 5);
this.CollectionWeightData[index2].ADCValue = receiveData.Substring(7, 5);
if (this.SystemConfig.EthernetOperationMode == 3)
if (this.SystemConfig.EthernetMode == 3)
this.Update30000ModbusData(index2);
}
}
@ -2016,10 +2016,13 @@ namespace INT69DC_7C.Forms
}
else if (this.SystemConfig.EthernetMode == 3)
{
#region Modus
byte[] etherByteData = this.Modbus.WriteMultipleRegisterTCP(
this.Protocol_Modbus_Client_Write_Lane_Data(0), this.SystemConfig.ModbusTcpStartAddress + (1 * 50) + 140);
this.EthernetWeightDataForModbus(etherByteData);
#region Modbus
if (this.SystemConfig.EthernetOperationMode == 2) // Client
{
byte[] etherByteData = this.Modbus.WriteMultipleRegisterTCP(
this.Protocol_Modbus_Client_Write_Lane_Data(0), this.SystemConfig.ModbusTcpStartAddress + (1 * 50) + 140);
this.EthernetWeightDataForModbus(etherByteData);
}
#endregion
}
else if (this.SystemConfig.EthernetMode == 4)
@ -2343,9 +2346,12 @@ namespace INT69DC_7C.Forms
else if (this.SystemConfig.EthernetMode == 3)
{
#region Modbus
byte[] etherByteData = this.Modbus.WriteMultipleRegisterTCP(
this.Protocol_Modbus_Client_Write_Lane_Data(1), this.SystemConfig.ModbusTcpStartAddress + (2 * 50) + 140);
this.EthernetWeightDataForModbus(etherByteData);
if (this.SystemConfig.EthernetOperationMode == 2) // Client
{
byte[] etherByteData = this.Modbus.WriteMultipleRegisterTCP(
this.Protocol_Modbus_Client_Write_Lane_Data(1), this.SystemConfig.ModbusTcpStartAddress + (2 * 50) + 140);
this.EthernetWeightDataForModbus(etherByteData);
}
#endregion
}
else if (this.SystemConfig.EthernetMode == 4)
@ -2651,9 +2657,12 @@ namespace INT69DC_7C.Forms
else if (this.SystemConfig.EthernetMode == 3)
{
#region Modbus
byte[] etherByteData = this.Modbus.WriteMultipleRegisterTCP(
this.Protocol_Modbus_Client_Write_Lane_Data(2), this.SystemConfig.ModbusTcpStartAddress + (3 * 50) + 140);
this.EthernetWeightDataForModbus(etherByteData);
if (this.SystemConfig.EthernetOperationMode == 2) // Client
{
byte[] etherByteData = this.Modbus.WriteMultipleRegisterTCP(
this.Protocol_Modbus_Client_Write_Lane_Data(2), this.SystemConfig.ModbusTcpStartAddress + (3 * 50) + 140);
this.EthernetWeightDataForModbus(etherByteData);
}
#endregion
}
else if (this.SystemConfig.EthernetMode == 4)
@ -2959,9 +2968,12 @@ namespace INT69DC_7C.Forms
else if (this.SystemConfig.EthernetMode == 3) // Modbus
{
#region Modbus
byte[] etherByteData = this.Modbus.WriteMultipleRegisterTCP(
this.Protocol_Modbus_Client_Write_Lane_Data(3), this.SystemConfig.ModbusTcpStartAddress + (4 * 50) + 140);
this.EthernetWeightDataForModbus(etherByteData);
if (this.SystemConfig.EthernetOperationMode == 2) // Client
{
byte[] etherByteData = this.Modbus.WriteMultipleRegisterTCP(
this.Protocol_Modbus_Client_Write_Lane_Data(3), this.SystemConfig.ModbusTcpStartAddress + (4 * 50) + 140);
this.EthernetWeightDataForModbus(etherByteData);
}
#endregion
}
else if (this.SystemConfig.EthernetMode == 4)
@ -3267,9 +3279,12 @@ namespace INT69DC_7C.Forms
else if (this.SystemConfig.EthernetMode == 3)
{
#region Modbus
byte[] etherByteData = this.Modbus.WriteMultipleRegisterTCP(
this.Protocol_Modbus_Client_Write_Lane_Data(4), this.SystemConfig.ModbusTcpStartAddress + (5 * 50) + 140);
this.EthernetWeightDataForModbus(etherByteData);
if (this.SystemConfig.EthernetOperationMode == 2) // Client
{
byte[] etherByteData = this.Modbus.WriteMultipleRegisterTCP(
this.Protocol_Modbus_Client_Write_Lane_Data(4), this.SystemConfig.ModbusTcpStartAddress + (5 * 50) + 140);
this.EthernetWeightDataForModbus(etherByteData);
}
#endregion
}
else if (this.SystemConfig.EthernetMode == 4)
@ -3575,9 +3590,12 @@ namespace INT69DC_7C.Forms
else if (this.SystemConfig.EthernetMode == 3)
{
#region Modbus
byte[] etherByteData = this.Modbus.WriteMultipleRegisterTCP(
this.Protocol_Modbus_Client_Write_Lane_Data(5), this.SystemConfig.ModbusTcpStartAddress + (6 * 50) + 140);
this.EthernetWeightDataForModbus(etherByteData);
if (this.SystemConfig.EthernetOperationMode == 2) // Client
{
byte[] etherByteData = this.Modbus.WriteMultipleRegisterTCP(
this.Protocol_Modbus_Client_Write_Lane_Data(5), this.SystemConfig.ModbusTcpStartAddress + (6 * 50) + 140);
this.EthernetWeightDataForModbus(etherByteData);
}
#endregion
}
else if (this.SystemConfig.EthernetMode == 4)
@ -3883,9 +3901,12 @@ namespace INT69DC_7C.Forms
else if (this.SystemConfig.EthernetMode == 3)
{
#region Modbus
byte[] etherByteData = this.Modbus.WriteMultipleRegisterTCP(
this.Protocol_Modbus_Client_Write_Lane_Data(6), this.SystemConfig.ModbusTcpStartAddress + (7 * 50) + 140);
this.EthernetWeightDataForModbus(etherByteData);
if (this.SystemConfig.EthernetOperationMode == 2) // Client
{
byte[] etherByteData = this.Modbus.WriteMultipleRegisterTCP(
this.Protocol_Modbus_Client_Write_Lane_Data(6), this.SystemConfig.ModbusTcpStartAddress + (7 * 50) + 140);
this.EthernetWeightDataForModbus(etherByteData);
}
#endregion
}
else if (this.SystemConfig.EthernetMode == 4)
@ -4189,9 +4210,12 @@ namespace INT69DC_7C.Forms
else if (this.SystemConfig.EthernetMode == 3)
{
#region Modbus
byte[] etherByteData = this.Modbus.WriteMultipleRegisterTCP(
this.Protocol_Modbus_Client_Write_Lane_Data(7), this.SystemConfig.ModbusTcpStartAddress + (8 * 50) + 140);
this.EthernetWeightDataForModbus(etherByteData);
if (this.SystemConfig.EthernetOperationMode == 2) // Client
{
byte[] etherByteData = this.Modbus.WriteMultipleRegisterTCP(
this.Protocol_Modbus_Client_Write_Lane_Data(7), this.SystemConfig.ModbusTcpStartAddress + (8 * 50) + 140);
this.EthernetWeightDataForModbus(etherByteData);
}
#endregion
}
else if (this.SystemConfig.EthernetMode == 4)
@ -4492,9 +4516,12 @@ namespace INT69DC_7C.Forms
else if (this.SystemConfig.EthernetMode == 3)
{
#region Modbus
byte[] etherByteData = this.Modbus.WriteMultipleRegisterTCP(
this.Protocol_Modbus_Client_Write_Lane_Data(8), this.SystemConfig.ModbusTcpStartAddress + (9 * 50) + 140);
this.EthernetWeightDataForModbus(etherByteData);
if (this.SystemConfig.EthernetOperationMode == 2) // Client
{
byte[] etherByteData = this.Modbus.WriteMultipleRegisterTCP(
this.Protocol_Modbus_Client_Write_Lane_Data(8), this.SystemConfig.ModbusTcpStartAddress + (9 * 50) + 140);
this.EthernetWeightDataForModbus(etherByteData);
}
#endregion
}
else if (this.SystemConfig.EthernetMode == 4)
@ -4794,9 +4821,12 @@ namespace INT69DC_7C.Forms
else if (this.SystemConfig.EthernetMode == 3)
{
#region Modbus
byte[] etherByteData = this.Modbus.WriteMultipleRegisterTCP(
this.Protocol_Modbus_Client_Write_Lane_Data(9), this.SystemConfig.ModbusTcpStartAddress + (10 * 50) + 140);
this.EthernetWeightDataForModbus(etherByteData);
if (this.SystemConfig.EthernetOperationMode == 2) // Client
{
byte[] etherByteData = this.Modbus.WriteMultipleRegisterTCP(
this.Protocol_Modbus_Client_Write_Lane_Data(9), this.SystemConfig.ModbusTcpStartAddress + (10 * 50) + 140);
this.EthernetWeightDataForModbus(etherByteData);
}
#endregion
}
else if (this.SystemConfig.EthernetMode == 4)
@ -5094,9 +5124,12 @@ namespace INT69DC_7C.Forms
else if (this.SystemConfig.EthernetMode == 3)
{
#region Modbus
byte[] etherByteData = this.Modbus.WriteMultipleRegisterTCP(
this.Protocol_Modbus_Client_Write_Lane_Data(10), this.SystemConfig.ModbusTcpStartAddress + (11 * 50) + 140);
this.EthernetWeightDataForModbus(etherByteData);
if (this.SystemConfig.EthernetOperationMode == 2) // Client
{
byte[] etherByteData = this.Modbus.WriteMultipleRegisterTCP(
this.Protocol_Modbus_Client_Write_Lane_Data(10), this.SystemConfig.ModbusTcpStartAddress + (11 * 50) + 140);
this.EthernetWeightDataForModbus(etherByteData);
}
#endregion
}
else if (this.SystemConfig.EthernetMode == 4)
@ -5389,9 +5422,12 @@ namespace INT69DC_7C.Forms
else if (this.SystemConfig.EthernetMode == 3) // Modbus
{
#region Modbus
byte[] etherByteData = this.Modbus.WriteMultipleRegisterTCP(
this.Protocol_Modbus_Client_Write_Lane_Data(11), this.SystemConfig.ModbusTcpStartAddress + (12 * 50) + 140);
this.EthernetWeightDataForModbus(etherByteData);
if (this.SystemConfig.EthernetOperationMode == 2) // Client
{
byte[] etherByteData = this.Modbus.WriteMultipleRegisterTCP(
this.Protocol_Modbus_Client_Write_Lane_Data(11), this.SystemConfig.ModbusTcpStartAddress + (12 * 50) + 140);
this.EthernetWeightDataForModbus(etherByteData);
}
#endregion
}
else if (this.SystemConfig.EthernetMode == 4)
@ -5603,7 +5639,7 @@ namespace INT69DC_7C.Forms
this.CollectionWeightData[i].WeightString = receiveData.Substring(i * 12 + 2, 5);
this.CollectionWeightData[i].ADCValue = receiveData.Substring(i * 12 + 7, 5);
if (this.SystemConfig.EthernetOperationMode == 3)
if (this.SystemConfig.EthernetMode == 3)
this.Update30000ModbusData(i);
}
#endregion
@ -5643,7 +5679,7 @@ namespace INT69DC_7C.Forms
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);
if (this.SystemConfig.EthernetOperationMode == 3)
if (this.SystemConfig.EthernetMode == 3)
this.Update30000ModbusData(this.CollectionWeightData.Count - i);
}
#endregion
@ -5736,11 +5772,14 @@ namespace INT69DC_7C.Forms
else if (this.SystemConfig.EthernetMode == 3)
{
#region Modbus
for (int i = 0; i < this.SystemConfig.EquipmentColumns; i++)
if (this.SystemConfig.EthernetOperationMode == 2) // Client
{
byte[] etherByteData = this.Modbus.WriteMultipleRegisterTCP(
this.Protocol_Modbus_Client_Write_Lane_Data(i), this.SystemConfig.ModbusTcpStartAddress + ((i + 1) * 50) + 140);
this.EthernetWeightDataForModbus(etherByteData);
for (int i = 0; i < this.SystemConfig.EquipmentColumns; i++)
{
byte[] etherByteData = this.Modbus.WriteMultipleRegisterTCP(
this.Protocol_Modbus_Client_Write_Lane_Data(i), this.SystemConfig.ModbusTcpStartAddress + ((i + 1) * 50) + 140);
this.EthernetWeightDataForModbus(etherByteData);
}
}
#endregion
}