西门子S7200SmartTCP通讯节制shortre=0;stringrestr="";re=PLC.EntLink(txtLocalIP.Text.Trim(),Convert.ToUInt16(txtLocalPort.Text),txtRemoteIP.Text.Trim(),Convert.ToUInt16(txtRemotePort.Text),Convert.ToUInt16(0),Convert.ToUInt16(2),"DEMO",refHandle1);txtReLink.Text=re.ToString();if(re==0){EntLink=true;MessageBox.Show("PLC联接成功!");}else{EntLink=false;MessageBox.Show("PLC联接失败:"+restr);}
1