嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):78630559
本次赞助数额为: 3 元微信扫码支付:3 元
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
工业自动化控制输入数组应用,管理输入输出端口通讯
int index = -1;
foreach (Label _label in groupBox2.Controls)
{
if (_label == sender)
{
index = Convert.ToInt32(_label.Text);
break;
}
}
if (index > -1)
{
short s = LTDMC.dmc_read_outbit(_CardID, (ushort)index);
if (s == 1)
{
LTDMC.dmc_write_outbit(_CardID, (ushort)index, 0); // 设置 输出点
}
else
{
LTDMC.dmc_write_outbit(_CardID, (ushort)index, 1);// 设置 输出点
}
}
int CANindex = -1;
foreach (Label _label in groupBox6.Controls)
{
if (_label == sender)
{
CANindex = Convert.ToInt32(_label.Text);
break;
}
}
if (CANindex > -1)
{
short s = LTDMC.dmc_read_can_outbit(_CardID, 1, (ushort)CANindex);
if (s == 1)
{
LTDMC.nmc_write_outbit(_CardID, 1, (ushort)CANindex, 0);//设置节点号为1的扩展模块的输入口的电平为低电平
}
else
{
LTDMC.nmc_write_outbit(_CardID, 1, (ushort)CANindex, 1);
}
}