Commit e35bd63d authored by 潘栩锋's avatar 潘栩锋 🚴

1.修改 AD盒模拟 涂布自控 地址

parent 98f6c4b2
...@@ -9,16 +9,16 @@ namespace FLY.Simulation.Coating ...@@ -9,16 +9,16 @@ namespace FLY.Simulation.Coating
{ {
public class HMI : INotifyPropertyChanged public class HMI : INotifyPropertyChanged
{ {
const UInt16 ADDR_D_PumpSet=0;//泵速设置 & 泵速显示 const UInt16 ADDR_D_PumpSet=0;//泵速设置 & 泵速显示, float
const UInt16 ADDR_D_LeftSet=2;//uint16 65535-> 6553.5 const UInt16 ADDR_D_LeftSet=10;//uint16 65535-> 6553.5
const UInt16 ADDR_D_Left=3; const UInt16 ADDR_D_Left=12;
const UInt16 ADDR_D_RightSet=4;//uint16 65535-> 6553.5 const UInt16 ADDR_D_RightSet=14;//uint16 65535-> 6553.5
const UInt16 ADDR_D_Right=5; const UInt16 ADDR_D_Right=16;
const UInt16 ADDR_D_FilmVelocity=6; const UInt16 ADDR_D_FilmVelocity=6;//float
const UInt16 ADDR_C_STATE = 0;//涂布状态 bit 0 const UInt16 ADDR_C_STATE = 0;//涂布状态 bit 0
...@@ -33,13 +33,13 @@ namespace FLY.Simulation.Coating ...@@ -33,13 +33,13 @@ namespace FLY.Simulation.Coating
public double PumpSet public double PumpSet
{ {
get { get {
UInt16 p = mPLCRegister.GetUInt16(ADDR_D_PumpSet); float p = mPLCRegister.GetFloat(ADDR_D_PumpSet);
return p / 10.0; return p;
} }
set { set {
if (PumpSet != value) if (PumpSet != value)
{ {
mPLCRegister.SetUInt16(ADDR_D_PumpSet, (UInt16)(value * 10)); mPLCRegister.SetFloat(ADDR_D_PumpSet, (float)value);
NotifyPropertyChanged("PumpSet"); NotifyPropertyChanged("PumpSet");
} }
} }
...@@ -113,14 +113,14 @@ namespace FLY.Simulation.Coating ...@@ -113,14 +113,14 @@ namespace FLY.Simulation.Coating
{ {
get get
{ {
UInt16 p = mPLCRegister.GetUInt16(ADDR_D_FilmVelocity); float p = mPLCRegister.GetFloat(ADDR_D_FilmVelocity);
return p / 10.0; return p;
} }
set set
{ {
if (FilmVelocity != value) if (FilmVelocity != value)
{ {
mPLCRegister.SetUInt16(ADDR_D_FilmVelocity, (UInt16)(value * 10)); mPLCRegister.SetFloat(ADDR_D_FilmVelocity, (float)value );
NotifyPropertyChanged("FilmVelocity"); NotifyPropertyChanged("FilmVelocity");
} }
} }
...@@ -147,7 +147,7 @@ namespace FLY.Simulation.Coating ...@@ -147,7 +147,7 @@ namespace FLY.Simulation.Coating
{ {
mCoatingCtrl = cc; mCoatingCtrl = cc;
mPLCRegister = new ModbusModule.PLCRegister(20, 10); mPLCRegister = new ModbusModule.PLCRegister(200, 200);
mbServer = new FLY.ModbusModule.ServerTCP(mPLCRegister, (UInt16)port); mbServer = new FLY.ModbusModule.ServerTCP(mPLCRegister, (UInt16)port);
mPLCRegister.RegChanged += new ModbusModule.PLCRegister.RegChangedEventHandler(plcregister_RegChanged); mPLCRegister.RegChanged += new ModbusModule.PLCRegister.RegChangedEventHandler(plcregister_RegChanged);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment