|
|
|
|
@ -1210,11 +1210,12 @@ namespace XGLFinishPro.Views
|
|
|
|
|
plc.Connection(PlcIp);
|
|
|
|
|
if (pointsDt != null && pointsDt.Rows.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
bool writeResult = false;
|
|
|
|
|
foreach (DataRow row in pointsDt.Rows)
|
|
|
|
|
{
|
|
|
|
|
if (row["plc_point_no"].ToString() == height)
|
|
|
|
|
{
|
|
|
|
|
plc.Write(new PlcSetting()
|
|
|
|
|
writeResult = plc.Write(new PlcSetting()
|
|
|
|
|
{
|
|
|
|
|
PlcAddress = row["plc_point_address"].ToString(),
|
|
|
|
|
PlcValueLength = "2"
|
|
|
|
|
@ -1222,7 +1223,7 @@ namespace XGLFinishPro.Views
|
|
|
|
|
}
|
|
|
|
|
else if (row["plc_point_no"].ToString() == width1)
|
|
|
|
|
{
|
|
|
|
|
plc.Write(new PlcSetting()
|
|
|
|
|
writeResult = plc.Write(new PlcSetting()
|
|
|
|
|
{
|
|
|
|
|
PlcAddress = row["plc_point_address"].ToString(),
|
|
|
|
|
PlcValueLength = "2"
|
|
|
|
|
@ -1230,15 +1231,23 @@ namespace XGLFinishPro.Views
|
|
|
|
|
}
|
|
|
|
|
else if (row["plc_point_no"].ToString() == length1)
|
|
|
|
|
{
|
|
|
|
|
plc.Write(new PlcSetting()
|
|
|
|
|
writeResult = plc.Write(new PlcSetting()
|
|
|
|
|
{
|
|
|
|
|
PlcAddress = row["plc_point_address"].ToString(),
|
|
|
|
|
PlcValueLength = "2"
|
|
|
|
|
}, l);
|
|
|
|
|
}
|
|
|
|
|
LogHelper.instance.log.Info($"写入PLC尺寸信息成功新高度{h},新宽度{w},新长度{l}");
|
|
|
|
|
|
|
|
|
|
if (writeResult)
|
|
|
|
|
{
|
|
|
|
|
LogHelper.instance.log.Info($"写入PLC尺寸信息成功新高度{h},新宽度{w},新长度{l}");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
LogHelper.instance.log.Info($"写入PLC尺寸信息失败!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
isSuccess = true;
|
|
|
|
|
isSuccess = writeResult;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|