|
|
@@ -120,7 +120,20 @@ public class plc_shiyou3227 : IHttpHandler
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- s7.Write<short>(PLC.dbResult, Convert.ToInt16(3));
|
|
|
+ DataTable goodsType = GetGoodinfo(barCode);
|
|
|
+
|
|
|
+ if (goodsType != null && goodsType.Rows.Count > 0)
|
|
|
+ {
|
|
|
+ bool goodscodeflag = PlcWriteRepeat<short>(PLC.dbGoodsCode, Convert.ToInt16(goodsType.Rows[0]["SEATCOVERCODE"].ToString()));
|
|
|
+ bool goodstypeflag = PlcWriteRepeat<short>(PLC.dbGoodsType, Convert.ToInt16(goodsType.Rows[0]["GOODSTYPENAME"].ToString()));
|
|
|
+ bool barcodeflag = PlcWriteRepeat<string>(PLC.dbBarcode, barCode);
|
|
|
+ bool resultflag = PlcWriteRepeat<short>(PLC.dbResult, Convert.ToInt16(3));
|
|
|
+ result.Add(new JObject(new JProperty("PLC读出(核对)", PLC.dbResult + " = " + s7.Read<short>(PLC.dbResult) + ";" + PLC.dbGoodsCode + " = " + s7.Read<short>(PLC.dbGoodsCode) + ";"+ PLC.dbGoodsType + " = " + s7.Read<short>(PLC.dbGoodsType) + ";" + PLC.dbBarcode + " = " + s7.Read<string>(PLC.dbBarcode, 11))));
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ s7.Write<short>(PLC.dbResult, Convert.ToInt16(2));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
}
|