28 lines
775 B
C#
28 lines
775 B
C#
using DeviceCommand.Base;
|
|
using Model.Models;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace BenchMovementModule.HardwareDrive
|
|
{
|
|
public class GantryControlTcp : GantryControlBase
|
|
{
|
|
// 暴露出底层的 ModbusTcp 实例以便修改网络配置
|
|
public ModbusTcp TcpDevice => (ModbusTcp)_device;
|
|
|
|
public GantryControlTcp(TcpConfig config, byte slaveAddress = 1)
|
|
: base(new ModbusTcp(config), slaveAddress)
|
|
{
|
|
}
|
|
|
|
public GantryControlTcp(string ipAddress, int port = 502, byte slaveAddress = 1)
|
|
: base(new ModbusTcp(), slaveAddress)
|
|
{
|
|
TcpDevice.ConfigureDevice(ipAddress, port);
|
|
}
|
|
}
|
|
}
|