//********配方系統(tǒng)變量的定義******
short Formula_Selection //選中配方的編號
short Formula_Count //配方大小
char Formula_QR[20] //配方中產品的二維碼
char null[20] = " "
GetData(Formula_Count, "Local HMI", RECIPE, "DATA1.Count")
GetData(Formula_Selection, "Local HMI", RECIPE, "DATA1.Selection")
GetData(search, "Local HMI", LB, 500, 1)
if search == true then
StringGet(QR[0], "Local HMI", LW, 500, 10)
/////********************************搜索配方中是否存在相同產品的二維碼信息******************
if Formula_Count > 0 then
index_dis = 0
for index_qr = 0 to Formula_Count step 1
QR_Same = true
SetData(index_qr, "Local HMI", RECIPE, "DATA1.Selection")
StringGet(Formula_QR[0], "Local HMI", RECIPE, "DATA1.ProdInfo")
for index = 0 to 1 step 1
if QR[0] <> Formula_QR [0] then
QR_Same = false
break
end if
next
if QR_Same == true then
//搜索到相同的數(shù)據,打印
StringGet(Mode[0], "Local HMI", RECIPE, "DATA1.Mode")
GetData(QR[0], "Local HMI", RECIPE, "DATA1.ProdInfo")
//StringGet(QR[0], "Local HMI", RECIPE, "DATA1.ProdInfo")
StringGet(date[0], "Local HMI", RECIPE, "DATA1.Date1")
GetData(AirP, "Local HMI", RECIPE, "DATA1._Result")
StringGet(date2[0], "Local HMI", RECIPE, "DATA1.Date2")
GetData(TestP, "Local HMI", RECIPE, "DATA1.TestP")
GetData(Leap, "Local HMI", RECIPE, "DATA1.Leak")
StringGet(Result1[0], "Local HMI", RECIPE, "DATA1.T_Result")
StringSet(Mode[0], "Local HMI", LW, 1000 + index_dis*100, 1)
StringSet(QR[0], "Local HMI", LW, 1001 + index_dis*100, 20)
StringSet(date[0], "Local HMI", LW, 1022 + index_dis*100, 11)
SetData(AirP, "Local HMI", LW, 1040+ index_dis*100, 1)
if date2[0] == ' ' then
StringSet(null[0], "Local HMI", LW, 1042 + index_dis*100, 11)
else
StringSet(date2[0], "Local HMI", LW, 1042 + index_dis*100, 11)
end if
SetData(TestP, "Local HMI", LW, 1060+ index_dis*100, 1)
SetData(Leap, "Local HMI", LW, 1062+ index_dis*100, 1)
StringSet(Result1[0], "Local HMI", LW, 1064 + index_dis*100, 4)
if index_dis < 9 then
index_dis = index_dis + 1
disFull = false
else
disFull = true
end if
//break
end if
//DELAY(3000)
next
if disFull == false then
for index = index_dis to 9 step 1
StringSet(null[0], "Local HMI", LW, 1000 + index*100, 1)
StringSet(null[0], "Local HMI", LW, 1001 + index*100, 20)
StringSet(null[0], "Local HMI", LW, 1022 + index*100, 11)
SetData(F_Zero, "Local HMI", LW, 1040+ index*100, 1)
StringSet(null[0], "Local HMI", LW, 1042 + index*100, 11)
SetData(F_Zero, "Local HMI", LW, 1060+ index*100, 1)
SetData(F_Zero, "Local HMI", LW, 1062+ index*100, 1)
StringSet(null[0], "Local HMI", LW, 1064 + index*100, 4)
next
end if
end if
end if