35 lines
917 B
C#
35 lines
917 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 IpAddress, int port, int SendTimeout, int ReceiveTimeout)
|
|
{
|
|
ConfigureDevice(IpAddress, port, SendTimeout, ReceiveTimeout);
|
|
|
|
}
|
|
public IOBoard()
|
|
{
|
|
|
|
}
|
|
public virtual async Task WriteOutput(byte slaveId, ushort startAddress, ushort value)
|
|
{
|
|
await WriteSingleRegisterAsync(slaveId, startAddress, value);
|
|
}
|
|
|
|
public virtual async Task WriteOutputsBatch(byte slaveId, ushort startAddress, ushort[] values)
|
|
{
|
|
await WriteMultipleRegistersAsync(slaveId, startAddress, values);
|
|
}
|
|
|
|
}
|
|
}
|