(* 呼叫编号暂存******************************************************************************)
hj[0]:=a11_hj; hj[1]:=a12_hj; hj[2]:=a13_hj; hj[3]:=a14_hj; hj[4]:=a15_hj; hj[5]:=a16_hj;
hj[6]:=b11_hj; hj[7]:=b12_hj; hj[8]:=b13_hj; hj[9]:=b14_hj; hj[10]:=b15_hj; hj[11]:=b16_hj;
(*送料满斗后,清料标志 ******************************************************************)
qingliao[0]:=a11_qingliao_finished;qingliao[1]:=a12_qingliao_finished;qingliao[2]:=a13_qingliao_finished;
qingliao[3]:=a14_qingliao_finished;qingliao[4]:=a15_qingliao_finished;qingliao[5]:=a16_qingliao_finished;
qingliao[6]:=b11_qingliao_finished;qingliao[7]:=b12_qingliao_finished;qingliao[8]:=b13_qingliao_finished;
qingliao[9]:=b14_qingliao_finished;qingliao[10]:=b15_qingliao_finished;qingliao[11]:=b16_qingliao_finished;
qingliao[12]:=c11_qingliao_finished;qingliao[13]:=c12_qingliao_finished;qingliao[14]:=c13_qingliao_finished;
qingliao[15]:=c14_qingliao_finished;qingliao[16]:=c15_qingliao_finished;qingliao[17]:=a16_qingliao_finished;
(*移位处理***********************************************************************************)
(*addr[0]存储的是最先响应的料斗编号**********************************************************)
for k:=0 to 18 by 1 do
if addr[k]=0 and addr[k+1]<>0 then
addr[k]:=addr[k+1];
addr[k+1]:=0;
end_if;
end_for;
(********************************************************************************************)
(*先呼叫,先响应。12个呼叫存储满后,禁止再储存呼叫号码。*************************************)
for i:=0 to 18 by 1 do
if j=0 then
if hj=true then
if addr[0]=0 then
addr[0]:=i+1;
j:=1;
elsif addr[1]=0 then
addr[1]:=i+1;
j:=1;
elsif addr[2]=0 then
addr[2]:=i+1;
j:=1;
elsif addr[3]=0 then
addr[3]:=i+1;
j:=1;
elsif addr[4]=0 then
addr[4]:=i+1;
j:=1;
elsif addr[5]=0 then
addr[5]:=i+1;
j:=1;
elsif addr[6]=0 then
addr[6]:=i+1;
j:=1;
elsif addr[7]=0 then
addr[7]:=i+1;
j:=1;
elsif addr[8]=0 then
addr[8]:=i+1;
j:=1;
elsif addr[9]=0 then
addr[9]:=i+1;
j:=1;
elsif addr[10]=0 then
addr[10]:=i+1;
j:=1;
elsif addr[11]=0 then
addr[11]:=i+1;
j:=1;
elsif addr[12]=0 then
addr[12]:=i+1;
j:=1;
elsif addr[13]=0 then
addr[13]:=i+1;
j:=1;
elsif addr[14]=0 then
addr[14]:=i+1;
j:=1;
elsif addr[15]=0 then
addr[15]:=i+1;
j:=1;
elsif addr[16]=0 then
addr[16]:=i+1;
j:=1;
elsif addr[17]=0 then
addr[17]:=i+1;
j:=1;
end_if;
end_if;
end_if;
(*呼叫的清除************************************************************************************)
(*外部呼叫结束:即外部下位电眼处已经有粉料,同时延时时间到达************************************)
if not hj and qingliao=true then
if addr[0]=i+1 then
addr[0]:=0;
j:=0;
elsif addr[1]=i+1 then
addr[1]:=0;
j:=0;
elsif addr[2]=i+1 then
addr[2]:=0;
j:=0;
elsif addr[3]=i+1 then
addr[3]:=0;
j:=0;
elsif addr[4]=i+1 then
addr[4]:=0;
j:=0;
elsif addr[5]=i+1 then
addr[5]:=0;
j:=0;
elsif addr[6]=i+1 then
addr[6]:=0;
j:=0;
elsif addr[7]=i+1 then
addr[7]:=0;
j:=0;
elsif addr[8]=i+1 then
addr[8]:=0;
j:=0;
elsif addr[9]=i+1 then
addr[9]:=0;
j:=0;
elsif addr[10]=i+1 then
addr[10]:=0;
j:=0;
elsif addr[11]=i+1 then
addr[11]:=0;
j:=0;
end_if;
end_if;
end_for;
(*呼叫的影应****************************************************************************************)
case addr[0] of
1: a11_yd:=true;
2: a12_yd:=true;
3: a13_yd:=true;
4: a14_yd:=true;
5: a15_yd:=true;
6: a16_yd:=true;
7: b11_yd:=true;
8: b12_yd:=true;
9: b13_yd:=true;
10: b14_yd:=true;
11: b15_yd:=true;
12: b16_yd:=true;
13: c11_yd:=true;
14: c12_yd:=true;
15: c13_yd:=true;
16: c14_yd:=true;
17: c15_yd:=true;
18: c16_yd:=true;
else
a11_yd:=false; a12_yd:=false; a13_yd:=false; a14_yd:=false; a15_yd:=false; a16_yd:=false;
b11_yd:=false; b12_yd:=false; b13_yd:=false; b14_yd:=false; b15_yd:=false; b16_yd:=false;
c11_yd:=false; c12_yd:=false; c13_yd:=false; c14_yd:=false; c15_yd:=false; c16_yd:=false;end_case;
addrr0:=addr[0];