Commit 1f9a3266 authored by 潘栩锋's avatar 潘栩锋 🚴

合并

parents d00045c2 3e0f528f
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Client\FeedbackHeatServiceClient.cs" /> <Compile Include="Client\FeedbackHeatServiceClient.cs" />
......
...@@ -161,7 +161,7 @@ namespace FLY.FeedbackRenZiJia.Server ...@@ -161,7 +161,7 @@ namespace FLY.FeedbackRenZiJia.Server
public FeedbackHeat() public FeedbackHeat()
{ {
PLCep = Misc.StringConverter.ToIPEndPoint("192.168.251.9:502"); PLCep = Misc.StringConverter.ToIPEndPoint("192.168.50.60:502");
Load(); Load();
if (IsClient) if (IsClient)
plc = new PLCLink(PLCep); plc = new PLCLink(PLCep);
...@@ -169,8 +169,11 @@ namespace FLY.FeedbackRenZiJia.Server ...@@ -169,8 +169,11 @@ namespace FLY.FeedbackRenZiJia.Server
plc = new HMI(); plc = new HMI();
plc.PropertyChanged += new PropertyChangedEventHandler(hmi_PropertyChanged); plc.PropertyChanged += new PropertyChangedEventHandler(hmi_PropertyChanged);
Misc.BindingOperations.SetBinding(plc, "HasElectricity", this, "HasElectricity"); HasCheckFilmVelocity = plc.HasElectricity;
Misc.BindingOperations.SetBinding(plc, "HasFan", this, "HasFan"); HasFan = plc.HasFan;
InitBuf(); InitBuf();
...@@ -238,7 +241,7 @@ namespace FLY.FeedbackRenZiJia.Server ...@@ -238,7 +241,7 @@ namespace FLY.FeedbackRenZiJia.Server
mHeatCheck.Init(mHeatCell); mHeatCheck.Init(mHeatCell);
mHeatCheck.PropertyChanged += new PropertyChangedEventHandler(mHeatCheck_PropertyChanged); mHeatCheck.PropertyChanged += new PropertyChangedEventHandler(mHeatCheck_PropertyChanged);
Misc.BindingOperations.SetBinding(plc, "HasElectricity", mHeatCheck, "HasElectricity"); Misc.BindingOperations.SetBinding(this, "HasElectricity", mHeatCheck, "HasElectricity");
Misc.BindingOperations.SetBinding(this, "HasCheck", mHeatCheck, "Has"); Misc.BindingOperations.SetBinding(this, "HasCheck", mHeatCheck, "Has");
Misc.BindingOperations.SetBinding(mHeatCheck, "Enable", this, "CheckEnable", Misc.BindingOperations.BindingMode.TwoWay); Misc.BindingOperations.SetBinding(mHeatCheck, "Enable", this, "CheckEnable", Misc.BindingOperations.BindingMode.TwoWay);
Misc.BindingOperations.SetBinding(mHeatCheck, "CheckNo", this, "CheckNo"); Misc.BindingOperations.SetBinding(mHeatCheck, "CheckNo", this, "CheckNo");
...@@ -398,25 +401,36 @@ namespace FLY.FeedbackRenZiJia.Server ...@@ -398,25 +401,36 @@ namespace FLY.FeedbackRenZiJia.Server
mSnapShotBuf.Init(NBolts, ChannelCnt); mSnapShotBuf.Init(NBolts, ChannelCnt);
} }
void hmi_PropertyChanged(object sender, PropertyChangedEventArgs e) void hmi_PropertyChanged(object s, PropertyChangedEventArgs _e)
{ {
if (e.PropertyName == "Errno") FObjBase.PollModule.Current.Dispatcher.Invoke(
{ new PropertyChangedEventHandler(
if (plc.Errno == -1) (sender, e)=> {
{ if (e.PropertyName == "Errno")
IsConnectedWithPLC = false; {
} if (plc.Errno == -1)
else {
{ IsConnectedWithPLC = false;
IsConnectedWithPLC = true; }
//刚成功连接上 else
//重新复制数据到 PLC {
RecoverPLC(); IsConnectedWithPLC = true;
} //刚成功连接上
} //重新复制数据到 PLC
RecoverPLC();
}
}
else if (e.PropertyName == "HasElectricity")
{
HasElectricity = plc.HasElectricity;
}
else if (e.PropertyName == "HasFan")
{
HasFan = plc.HasFan;
}
}), s, _e);
} }
List<FlyData_FeedbackHeat> test_data = new List<FlyData_FeedbackHeat>(); List<FlyData_FeedbackHeat> test_data = new List<FlyData_FeedbackHeat>();
int test_index = 0; int test_index = 0;
public int TestIndex public int TestIndex
......
...@@ -288,6 +288,7 @@ namespace FLY.FeedbackRenZiJia.Server ...@@ -288,6 +288,7 @@ namespace FLY.FeedbackRenZiJia.Server
UInt16[] buf1 = new UInt16[cnt1]; UInt16[] buf1 = new UInt16[cnt1];
Array.Copy(buf, offset, buf1, 0, cnt1); Array.Copy(buf, offset, buf1, 0, cnt1);
RegWrite rw = new RegWrite(PLCAddressArea.Register, addr+offset, buf1); RegWrite rw = new RegWrite(PLCAddressArea.Register, addr+offset, buf1);
writes.Add(rw);
offset += cnt1; offset += cnt1;
cnt -= cnt1; cnt -= cnt1;
......
...@@ -257,16 +257,16 @@ namespace FLY.Modbus.WithThread ...@@ -257,16 +257,16 @@ namespace FLY.Modbus.WithThread
} }
//强制令读时,推送数据 //强制令读时,推送数据
rw.dr.isPlcValueChanged = true; rw.dr.isPlcValueChanged = true;
object plc_value = rw.dr.ToPLCObj(rw.val);
switch (rw.dr.dataArea) switch (rw.dr.dataArea)
{ {
case PLCAddressArea.Coil: case PLCAddressArea.Coil:
if (!Client.Do_0F((UInt16)rw.dr.addr, new bool[] {(bool)rw.dr.plcValue})) if (!Client.Do_0F((UInt16)rw.dr.addr, new bool[] {(bool)plc_value }))
return false; return false;
break; break;
default: default:
//case PLCAddressArea.Register: //case PLCAddressArea.Register:
if (!Client.Do_10((UInt16)rw.dr.addr, (UInt16[])rw.dr.plcValue)) if (!Client.Do_10((UInt16)rw.dr.addr, (UInt16[])plc_value))
return false; return false;
break; break;
} }
......
...@@ -46,9 +46,9 @@ ...@@ -46,9 +46,9 @@
</SoftwareItem> </SoftwareItem>
<SoftwareItem> <SoftwareItem>
<IsAutoRun>true</IsAutoRun> <IsAutoRun>true</IsAutoRun>
<Name>LP3</Name> <Name>LP2</Name>
<Path>佛山市枫莱尔自动化技术有限公司\windows\LP3</Path> <Path>佛山市枫莱尔自动化技术有限公司\windows\LP2</Path>
<Exe>FLY.LinkProxy.UI.exe</Exe> <Exe>FLY.LinkProxy.UI.Server.exe</Exe>
</SoftwareItem> </SoftwareItem>
<SoftwareItem> <SoftwareItem>
<IsAutoRun>true</IsAutoRun> <IsAutoRun>true</IsAutoRun>
......
No preview for this file type
[POU_PlusSign]
1=1
2=1
17=1
18=0
19=0
20=1
[Comm_Param]
Type=4
Port=3
Timeout=2000
ip=192.168.1.1
[POU_PlusSign]
1=1
2=1
17=1
18=0
19=0
20=1
[Comm_Param]
Type=0
Port=3
Timeout=2000
[POU_PlusSign]
1=1
2=1
17=1
18=0
19=0
20=1
[Comm_Param]
Type=4
Port=3
Timeout=2000
ip=192.168.1.1
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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