Compare commits
3 Commits
e7341bea87
...
679320311d
| Author | SHA1 | Date | |
|---|---|---|---|
| 679320311d | |||
| 6eee4eda24 | |||
| 5dedb1a632 |
@@ -39,7 +39,7 @@
|
|||||||
<HintPath>..\..\..\HslCommunication-master\HslCommunication.dll</HintPath>
|
<HintPath>..\..\..\HslCommunication-master\HslCommunication.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="MvCameraControl.Net">
|
<Reference Include="MvCameraControl.Net">
|
||||||
<HintPath>C:\Program Files (x86)\MVS\Development\DotNet\win64\MvCameraControl.Net.dll</HintPath>
|
<HintPath>..\..\XKRS2025\CheckDevice\Check.Main\bin\Debug\MvCameraControl.Net.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
using HslCommunication.ModBus;
|
using HslCommunication.ModBus;
|
||||||
using System;
|
using System;
|
||||||
using System.Net.Sockets;
|
using System.Net.Sockets;
|
||||||
|
//
|
||||||
// ModbusTcp读写服务类,线程安全,互斥锁
|
// ModbusTcp读写服务类,线程安全,互斥锁
|
||||||
namespace Check.Main.Common
|
namespace Check.Main.Common
|
||||||
{
|
{
|
||||||
@@ -12,7 +12,7 @@ namespace Check.Main.Common
|
|||||||
private readonly ModbusTcpNet _plc;
|
private readonly ModbusTcpNet _plc;
|
||||||
private readonly object _lock = new();
|
private readonly object _lock = new();
|
||||||
public bool IsConnected => _tcpClient != null && _tcpClient.Connected;//
|
public bool IsConnected => _tcpClient != null && _tcpClient.Connected;//
|
||||||
|
//
|
||||||
public ModbusTcpService(string ip, int port = 502, byte station = 1)
|
public ModbusTcpService(string ip, int port = 502, byte station = 1)
|
||||||
{
|
{
|
||||||
_plc = new ModbusTcpNet(ip, port, station)
|
_plc = new ModbusTcpNet(ip, port, station)
|
||||||
|
|||||||
Reference in New Issue
Block a user