35 lines
916 B
C#
35 lines
916 B
C#
using Common.Attributes;
|
|
using DeviceCommand.Base;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace DeviceCommand.Device
|
|
{
|
|
[BOBCommand]
|
|
public class IOBoard : ModbusTcp
|
|
{
|
|
public IOBoard(string Ip地址, int 端口, int 发送超时, int 接收超时)
|
|
{
|
|
ConfigureDevice(Ip地址, 端口, 发送超时, 接收超时);
|
|
}
|
|
|
|
public IOBoard()
|
|
{
|
|
|
|
}
|
|
|
|
public virtual async Task 写单一输出(byte 从站地址, ushort 起始地址, ushort 值)
|
|
{
|
|
await WriteSingleRegisterAsync(从站地址, 起始地址, 值);
|
|
}
|
|
|
|
public virtual async Task 写多输出(byte 从站地址, ushort 起始地址, ushort[] 值数组)
|
|
{
|
|
await WriteMultipleRegistersAsync(从站地址, 起始地址, 值数组);
|
|
}
|
|
}
|
|
}
|