添加项目文件。
This commit is contained in:
27
BenchMovementModule/HardwareDrive/GantryControlTcp.cs
Normal file
27
BenchMovementModule/HardwareDrive/GantryControlTcp.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user