var melsec = new MelsecMcNet("192.168.0.7",6000); // 访问的是本机的服务器信息
OperateResult<short> read = melsec.ReadInt16("D50"); // 对应PLC是 MW100
if (read.IsSuccess)
{
textBox1.Text = read.Content.ToString();
var a1 = read.Content * 1.5;
label2.Text = a1.ToString();
}
else
{
MessageBox.Show("Read Failed:" + read.ToMessageShowString()); // 读取失败时显示的信息
}
OperateResult<short> read1 = melsec.ReadInt16("D51"); // 对应PLC是 MW100
if (read.IsSuccess)
{
textBox1.Text = read1.Content.ToString();
var a2 = read1.Content * 3;
label3
三菱Q02PLC设置连接和读取数据Python3.7
最新推荐文章于 2024-08-23 21:57:44 发布