環(huán)境:VS2008 C#.NET,MX Component3.00A ,PLC型號(hào):FX3U-16MT
在項(xiàng)目中引用了ACTPCCOMLib , 代碼如下:
private void btnRead_Click(object sender, EventArgs e)
{
ACTPCCOMLib.ActFXCPUClass act = new ACTPCCOMLib.ActFXCPUClass();
int val = act.Open();
if (val != 0)
{
MessageBox.Show("PLC通訊打開失。");
return;
}
int B;
val = act.ReadDeviceBlock("D0", 10, out B);
memoEdit1.Text = "返回代碼:" + val.ToString();
}
在執(zhí)行ReadDeviceBlock函數(shù)時(shí),報(bào)錯(cuò),請(qǐng)教一下哪里的問題?
多謝!