大体程序是这样的,是一个配方数据保存调用的程序,能帮忙价格注释吗?
macro_command main()
short D,X,Y=1,Z=0,E=100,F=31950,G,H[4]={0,0,0},U
bool W=false
GetData(U, "Local HMI", LW, 9050, 1)//U变量是当前窗口编号
GetData(X, "Panasonic FP", DT, 99, 1)//X变量是当前配方编号
if X==0 then
SetData(H[0], "Panasonic FP", DT, 47, 3)
SetData(H[2], "Panasonic FP", R, 21A, 1)
else
SetData(E, "Panasonic FP", DT, 47, 1)
SetData(F, "Panasonic FP", DT, 48, 1)
SetData(G, "Panasonic FP", DT, 49, 1)
SetData(Y, "Panasonic FP", R, 21A, 1)
SetData(D, "Local HMI", LW, 9200, 1)//赎值1给地址索引寄存器0#
end if
if X==1 then
G=100
D=0
SetData(Y, "Panasonic FP", R, 320, 1)
else
SetData(Z, "Panasonic FP", R, 320, 1)
end if
if X==2 then
G=200
D=100
SetData(Y, "Panasonic FP", R, 321, 1)
else
SetData(Z, "Panasonic FP", R, 321, 1)
end if
if X==3 then
G=300
D=200
SetData(Y, "Panasonic FP", R, 322, 1)
else
SetData(Z, "Panasonic FP", R, 322, 1)
end if
if X==4 then
G=400
D=300
SetData(Y, "Panasonic FP", R, 323, 1)
else
SetData(Z, "Panasonic FP", R, 323, 1)
end if
if X==5 then
G=500
D=400
SetData(Y, "Panasonic FP", R, 324, 1)
else
SetData(Z, "Panasonic FP", R, 324, 1)
end if
if X==6 then
G=600
D=500
SetData(Y, "Panasonic FP", R, 325, 1)
else
SetData(Z, "Panasonic FP", R, 325, 1)
end if
if X==7 then
G=700
D=600
SetData(Y, "Panasonic FP", R, 326, 1)
else
SetData(Z, "Panasonic FP", R, 326, 1)
end if
if X==8 then
G=800
D=700
SetData(Y, "Panasonic FP", R, 327, 1)
else
SetData(Z, "Panasonic FP", R, 327, 1)
end if
if X==9 then
G=900
D=800
SetData(Y, "Panasonic FP", R, 328, 1)
else
SetData(Z, "Panasonic FP", R, 328, 1)
end if
if X==10 then
G=1000
D=900
SetData(Y, "Panasonic FP", R, 329, 1)
else
SetData(Z, "Panasonic FP", R, 329, 1)
end if |