|
|
@ -689,13 +689,10 @@ namespace OpcServerHost.Init |
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 捕获条码扫描完成标记
|
|
|
|
if (currentPC.COLUMNCODE == "PLC_Scan_Ok_t") |
|
|
|
{ |
|
|
|
if (currentPC.COLUMNTYPE == OpcEnumGeter.COLUMNTYPE.EQUIPSCANFLAG.GetHashCode().ToString()) |
|
|
|
{ |
|
|
|
|
|
|
|
#region 提示扫描条码完成
|
|
|
|
|
|
|
|
if (itemValue == null) |
|
|
@ -743,21 +740,24 @@ namespace OpcServerHost.Init |
|
|
|
{ |
|
|
|
string item = parameter.MACHINECODDE + ":" + parameter.MOLDNUMBER + ":" + parameter.COLUMNCODE; |
|
|
|
|
|
|
|
var result = opcplcConnection.ReadtagValue(opcItemDict[item]); |
|
|
|
//var result = (object)"[0.25.68.48.52.67.82.69.87.85.70.76.50.49.49.50.49.53.48.48.49.83.68.48.48.48.49]";
|
|
|
|
|
|
|
|
if (result != null) |
|
|
|
var result = opcplcConnection.ReadtagValue(opcItemDict[item]); |
|
|
|
|
|
|
|
if (result != null) |
|
|
|
{ |
|
|
|
ASCIIEncoding asciiEncoding = new ASCIIEncoding(); |
|
|
|
var product_str = result.ToString().Replace("[","").Replace("]", "").Split('.'); |
|
|
|
var count = Convert.ToInt32(product_str[1]) - 1; |
|
|
|
var productCode = ""; |
|
|
|
for (int c = 0; c <= count; c++) |
|
|
|
{ |
|
|
|
byte[] byteArray = new byte[] { Convert.ToByte(product_str[c + 2]) }; |
|
|
|
productCode += asciiEncoding.GetString(byteArray); |
|
|
|
} |
|
|
|
parameter.PARAVALUE = productCode; |
|
|
|
ASCIIEncoding asciiEncoding = new ASCIIEncoding(); |
|
|
|
|
|
|
|
var arraysList = (Array[])result; |
|
|
|
|
|
|
|
var count = Convert.ToInt32(arraysList[1]) - 1; |
|
|
|
//var count = 24;
|
|
|
|
|
|
|
|
var productCode = ""; |
|
|
|
for (int c = 0; c <= count; c++) |
|
|
|
{ |
|
|
|
byte[] byteArray = new byte[] { Convert.ToByte(arraysList[c + 2]) }; |
|
|
|
productCode += asciiEncoding.GetString(byteArray); |
|
|
|
} |
|
|
|
parameter.PARAVALUE = productCode; |
|
|
|
} |
|
|
|
|
|
|
|
Console.WriteLine(System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "Get Barcode " + " " + parameter.MACHINECODDE + ":" + parameter.MOLDNUMBER + ":" + parameter.COLUMNCODE + " " + ((result == null) ? " " : result.ToString()), currentPC.MACHINECODDE); |
|
|
@ -813,7 +813,6 @@ namespace OpcServerHost.Init |
|
|
|
#endregion
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region 中断
|
|
|
|