用C#写了一段很简单的代码,想读出D0的值,可以通讯上,为啥读不出值?小弟不是很懂,请各位指导一下。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using AxACTETHERLib;
namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
object iret;
object idata;
axActMLQJ71E71TCP1.ActHostAddress = "192.168.0.50 5002";
iret=axActMLQJ71E71TCP1.GetDevice2("D0",
out idata);
idata = textBox1;
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
//textBox1.ReadOnly = true;//修改属性为只读
}
private void button1_Click(object sender, EventArgs e)
{
axActMLQJ71E71TCP1.Open();
}
private void button2_Click(object sender, EventArgs e)
{
axActMLQJ71E71TCP1.Close();
}
}
}