引用
引用第1楼030403118于2020-06-05 08:13发表的 :
缺少引用的控件
怎么让它读取带小数的值了,
现在只能定义为Short能行整数
定义为double就报错
short D0, D1, D2, D3, D4, D5, D6, D7, D8, D470,D10;
try
{
this.axActUtlType.ActLogicalStationNumber = 0;
this.axActUtlType.ActPassword = null;
int rtn = this.axActUtlType.Open();
if (rtn == 0)
{
PLCcom1.Text = "PLC1链接成功";
iReturnCode = axActUtlType.ReadDeviceBlock2("D470", 1, out D470);
textBox1.Text = D470.ToString();
iReturnCode = axActUtlType.ReadDeviceBlock2("D10", 1, out D10);
textBox2.Text = D10.ToString();
PLC1conn = true;
}