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

合并

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