Modbus 운전상태 추가
parent
adcf839554
commit
e1d0582bdf
BIN
INT89DB_26.suo
BIN
INT89DB_26.suo
Binary file not shown.
|
|
@ -620,6 +620,8 @@ namespace INT89DB_26.Forms
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.Update30000Operation();
|
||||||
|
|
||||||
this.ChildFormMainDisplay.UpdateEquipmentStatusDisplay(this.EquipmentStatus);
|
this.ChildFormMainDisplay.UpdateEquipmentStatusDisplay(this.EquipmentStatus);
|
||||||
this.ChildFormSystemSetting.UpdateEquipmentStatusDisplay(this.EquipmentStatus);
|
this.ChildFormSystemSetting.UpdateEquipmentStatusDisplay(this.EquipmentStatus);
|
||||||
this.ChildFormEquipmentTest.UpdateEquipmentStatusDisplay(this.EquipmentStatus);
|
this.ChildFormEquipmentTest.UpdateEquipmentStatusDisplay(this.EquipmentStatus);
|
||||||
|
|
@ -634,6 +636,8 @@ namespace INT89DB_26.Forms
|
||||||
data.IsStart = false;
|
data.IsStart = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.Update30000Operation();
|
||||||
|
|
||||||
this.ChildFormMainDisplay.UpdateEquipmentStatusDisplay(this.EquipmentStatus);
|
this.ChildFormMainDisplay.UpdateEquipmentStatusDisplay(this.EquipmentStatus);
|
||||||
this.ChildFormSystemSetting.UpdateEquipmentStatusDisplay(this.EquipmentStatus);
|
this.ChildFormSystemSetting.UpdateEquipmentStatusDisplay(this.EquipmentStatus);
|
||||||
this.ChildFormEquipmentTest.UpdateEquipmentStatusDisplay(this.EquipmentStatus);
|
this.ChildFormEquipmentTest.UpdateEquipmentStatusDisplay(this.EquipmentStatus);
|
||||||
|
|
@ -1866,6 +1870,12 @@ namespace INT89DB_26.Forms
|
||||||
byte[] length2Value = new byte[2];
|
byte[] length2Value = new byte[2];
|
||||||
byte[] length4Value = new byte[4];
|
byte[] length4Value = new byte[4];
|
||||||
|
|
||||||
|
int equipmentStatus;
|
||||||
|
if (this.EquipmentStatus == DataStore.EquipmentStatus.Start)
|
||||||
|
equipmentStatus = 1;
|
||||||
|
else
|
||||||
|
equipmentStatus = 0;
|
||||||
|
|
||||||
startAddressInt = Modbus.ToBigEndianAndInt(startAddressByte);
|
startAddressInt = Modbus.ToBigEndianAndInt(startAddressByte);
|
||||||
numberOfRegisterInt = Modbus.ToBigEndianAndInt(numberOfRegisterByte);
|
numberOfRegisterInt = Modbus.ToBigEndianAndInt(numberOfRegisterByte);
|
||||||
|
|
||||||
|
|
@ -1994,12 +2004,6 @@ namespace INT89DB_26.Forms
|
||||||
double deadZoneLow = this.Current30000ModbusData.DeadZoneLowLimit;
|
double deadZoneLow = this.Current30000ModbusData.DeadZoneLowLimit;
|
||||||
double deadZoneHigh = this.Current30000ModbusData.DeadZoneHighLimit;
|
double deadZoneHigh = this.Current30000ModbusData.DeadZoneHighLimit;
|
||||||
|
|
||||||
int equipmentStatus;
|
|
||||||
if (this.EquipmentStatus == DataStore.EquipmentStatus.Start)
|
|
||||||
equipmentStatus = 1;
|
|
||||||
else
|
|
||||||
equipmentStatus = 0;
|
|
||||||
|
|
||||||
for (int j = startAddressInt; j < startAddressInt + numberOfRegisterInt; j++)
|
for (int j = startAddressInt; j < startAddressInt + numberOfRegisterInt; j++)
|
||||||
{
|
{
|
||||||
switch (j)
|
switch (j)
|
||||||
|
|
@ -2010,6 +2014,16 @@ namespace INT89DB_26.Forms
|
||||||
for (int i = 0; i < 2; i++)
|
for (int i = 0; i < 2; i++)
|
||||||
madeData[madeDataIndex + i] = length2Value[1 - i];
|
madeData[madeDataIndex + i] = length2Value[1 - i];
|
||||||
break;
|
break;
|
||||||
|
case (int)ModbusDefine._30000_Modbus.Operation_High:
|
||||||
|
length4Value = GetBytes(this.Current30000ModbusData.OperationStatus);
|
||||||
|
for (int i = 0; i < 2; i++)
|
||||||
|
madeData[madeDataIndex + i] = length4Value[3 - i];
|
||||||
|
break;
|
||||||
|
case (int)ModbusDefine._30000_Modbus.Operation_Low:
|
||||||
|
length4Value = GetBytes(this.Current30000ModbusData.OperationStatus);
|
||||||
|
for (int i = 0; i < 2; i++)
|
||||||
|
madeData[madeDataIndex + i] = length4Value[1 - i];
|
||||||
|
break;
|
||||||
case (int)ModbusDefine._30000_Modbus.UnderRange_High_Float:
|
case (int)ModbusDefine._30000_Modbus.UnderRange_High_Float:
|
||||||
length4Value = GetBytes((Single)underValue);
|
length4Value = GetBytes((Single)underValue);
|
||||||
for (int i = 0; i < 2; i++)
|
for (int i = 0; i < 2; i++)
|
||||||
|
|
@ -3103,6 +3117,16 @@ namespace INT89DB_26.Forms
|
||||||
for (int i = 0; i < 2; i++)
|
for (int i = 0; i < 2; i++)
|
||||||
madeData[madeDataIndex + i] = length2Value[1 - i];
|
madeData[madeDataIndex + i] = length2Value[1 - i];
|
||||||
break;
|
break;
|
||||||
|
case (int)ModbusDefine._30000_Modbus.Operation_High:
|
||||||
|
length4Value = GetBytes(this.Current30000ModbusData.OperationStatus);
|
||||||
|
for (int i = 0; i < 2; i++)
|
||||||
|
madeData[madeDataIndex + i] = length4Value[3 - i];
|
||||||
|
break;
|
||||||
|
case (int)ModbusDefine._30000_Modbus.Operation_Low:
|
||||||
|
length4Value = GetBytes(this.Current30000ModbusData.OperationStatus);
|
||||||
|
for (int i = 0; i < 2; i++)
|
||||||
|
madeData[madeDataIndex + i] = length4Value[1 - i];
|
||||||
|
break;
|
||||||
case (int)ModbusDefine._30000_Modbus.UnderRange_High_Float:
|
case (int)ModbusDefine._30000_Modbus.UnderRange_High_Float:
|
||||||
length4Value = GetBytes((Single)underValue);
|
length4Value = GetBytes((Single)underValue);
|
||||||
for (int i = 0; i < 2; i++)
|
for (int i = 0; i < 2; i++)
|
||||||
|
|
@ -4438,6 +4462,13 @@ namespace INT89DB_26.Forms
|
||||||
return judgmentStatus;
|
return judgmentStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Update30000Operation()
|
||||||
|
{
|
||||||
|
if (this.EquipmentStatus == DataStore.EquipmentStatus.Start)
|
||||||
|
this.Current30000ModbusData.OperationStatus = 1;
|
||||||
|
else
|
||||||
|
this.Current30000ModbusData.OperationStatus = 0;
|
||||||
|
}
|
||||||
public void Update30000DecimalPoint()
|
public void Update30000DecimalPoint()
|
||||||
{
|
{
|
||||||
this.Current30000ModbusData.DecimalPoint = short.Parse(this.SystemConfig.DecimalPlaces.ToString());
|
this.Current30000ModbusData.DecimalPoint = short.Parse(this.SystemConfig.DecimalPlaces.ToString());
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,8 @@ namespace INT89DB_26.Int_Modbus
|
||||||
public enum _30000_Modbus
|
public enum _30000_Modbus
|
||||||
{
|
{
|
||||||
DecimalPoint = 0,
|
DecimalPoint = 0,
|
||||||
|
Operation_High = 40,
|
||||||
|
Operation_Low = 41,
|
||||||
UnderRange_High_Float = 1010,
|
UnderRange_High_Float = 1010,
|
||||||
UnderRange_Low_Float = 1011,
|
UnderRange_Low_Float = 1011,
|
||||||
PassRange_High_Float = 1012,
|
PassRange_High_Float = 1012,
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ namespace INT89DB_26.Int_Modbus
|
||||||
{
|
{
|
||||||
#region Field
|
#region Field
|
||||||
private short m_DecimalPoint;
|
private short m_DecimalPoint;
|
||||||
|
private int m_OperationStatus;
|
||||||
private double m_UnderValue;
|
private double m_UnderValue;
|
||||||
private double m_PassValue;
|
private double m_PassValue;
|
||||||
private double m_OverValue;
|
private double m_OverValue;
|
||||||
|
|
@ -37,6 +38,11 @@ namespace INT89DB_26.Int_Modbus
|
||||||
get { return this.m_DecimalPoint; }
|
get { return this.m_DecimalPoint; }
|
||||||
set { this.m_DecimalPoint = value; }
|
set { this.m_DecimalPoint = value; }
|
||||||
}
|
}
|
||||||
|
public int OperationStatus
|
||||||
|
{
|
||||||
|
get { return this.m_OperationStatus; }
|
||||||
|
set { this.m_OperationStatus = value; }
|
||||||
|
}
|
||||||
public double UnderValue
|
public double UnderValue
|
||||||
{
|
{
|
||||||
get { return this.m_UnderValue; }
|
get { return this.m_UnderValue; }
|
||||||
|
|
@ -58,7 +64,14 @@ namespace INT89DB_26.Int_Modbus
|
||||||
set { this.m_TareValue = value; }
|
set { this.m_TareValue = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string HexStringOperationStatus
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
string hexString = this.OperationStatus.ToString("X8");
|
||||||
|
return hexString;
|
||||||
|
}
|
||||||
|
}
|
||||||
public string HexStringUnderValue
|
public string HexStringUnderValue
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|
@ -150,6 +163,7 @@ namespace INT89DB_26.Int_Modbus
|
||||||
public void Initialization()
|
public void Initialization()
|
||||||
{
|
{
|
||||||
this.DecimalPoint = 1;
|
this.DecimalPoint = 1;
|
||||||
|
this.OperationStatus = 0;
|
||||||
this.UnderValue = 100.0;
|
this.UnderValue = 100.0;
|
||||||
this.PassValue = 200.0;
|
this.PassValue = 200.0;
|
||||||
this.OverValue = 300.0;
|
this.OverValue = 300.0;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue