引用
引用第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;
}