macro_command main()
short name[5],temp[5],i=0,var=80,b[75],c[5]
bool ON=true,OFF,flag=false
GetData(name[0], "Local HMI", LW, 0, 5)
FILL(c[0],0,5)
for i=0 to 17 step 1
GetData(temp[0], "Local HMI", RW, var, 5)
if name[0]==temp[0] and name[1]==temp[1] and name[2]==temp[2] and name[3]==temp[3] and name[4]==temp[4] then
GetData(b[0], "Local HMI", RW, var+5, 75)
SetData(b[0], "Local HMI", LW, 5, 75)
flag=true
else
if i==17 then
SetData( on, "Local HMI", LB, 11, 1)
SetData(name[0], "Local HMI", LW, 200, 5)
SetData(c[0], "Local HMI", LW, 0, 5)
else
end if
var=var+80
end if
SetData(i, "Local HMI", LW, 100, 1)
SetData(var, "Local HMI", LW, 101, 1)
next i
SetData(ON, "Local HMI", LB, 9, 1)
SetData(OFF, "Local HMI", LB, 7, 1)
end macro_command
根据输入的名字比对配方库里的名字,名字一致将该名下的数据读出存到显示区