|
@@ -1105,15 +1105,25 @@ namespace IMCS.CCS.Services
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ string currentWorkStationAddress = ToolUtils.AddressConvertDBW("DB200.332");
|
|
|
+ var currentWorkOperateResult = s7.ReadInt16(currentWorkStationAddress).Content.ToString();
|
|
|
+ string writeValue = "127";
|
|
|
+ if(currentWorkOperateResult.ToString() == "1")//工作台1
|
|
|
+ {
|
|
|
+ writeValue = "127";
|
|
|
+ }else if (currentWorkOperateResult.ToString() == "2")//工作台2
|
|
|
+ {
|
|
|
+ writeValue = "128";
|
|
|
+ }
|
|
|
|
|
|
- //查询写入地址列表
|
|
|
- List<CcsActionAddress> CcsActionAddressWrites = CcsActionAddresses.Where(o => o.Type == ActionAddressTypeEnum.WRITE.ToString()).ToList();
|
|
|
+ //查询写入地址列表
|
|
|
+ List<CcsActionAddress> CcsActionAddressWrites = CcsActionAddresses.Where(o => o.Type == ActionAddressTypeEnum.WRITE.ToString()).ToList();
|
|
|
foreach (CcsActionAddress actionAddress in CcsActionAddressWrites)
|
|
|
{
|
|
|
if (!string.IsNullOrEmpty(actionAddress.Address))
|
|
|
{
|
|
|
string Address = ToolUtils.AddressConvertDBW(actionAddress.Address);
|
|
|
- s7.Write(actionAddress.Address, Convert.ToInt16(actionAddress.Value));
|
|
|
+ s7.Write(actionAddress.Address, Convert.ToInt16(writeValue));
|
|
|
Thread.Sleep(SLEEP_TIME);
|
|
|
}
|
|
|
}
|