mirror of
https://github.com/S7NetPlus/s7netplus.git
synced 2026-02-17 22:38:27 +08:00
rename PORT to Port
add a Space
This commit is contained in:
@@ -26,7 +26,7 @@ namespace S7.Net
|
||||
/// <summary>
|
||||
/// PORT Number of the PLC, default is 102
|
||||
/// </summary>
|
||||
public int PORT { get; private set; }
|
||||
public int Port { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// CPU type of the PLC
|
||||
@@ -125,7 +125,7 @@ namespace S7.Net
|
||||
/// <param name="rack">rack of the PLC, usually it's 0, but check in the hardware configuration of Step7 or TIA portal</param>
|
||||
/// <param name="slot">slot of the CPU of the PLC, usually it's 2 for S7300-S7400, 0 for S7-1200 and S7-1500.
|
||||
/// If you use an external ethernet card, this must be set accordingly.</param>
|
||||
public Plc(CpuType cpu, string ip,int port, Int16 rack, Int16 slot)
|
||||
public Plc(CpuType cpu, string ip, int port, Int16 rack, Int16 slot)
|
||||
{
|
||||
if (!Enum.IsDefined(typeof(CpuType), cpu))
|
||||
throw new ArgumentException($"The value of argument '{nameof(cpu)}' ({cpu}) is invalid for Enum type '{typeof(CpuType).Name}'.", nameof(cpu));
|
||||
@@ -135,7 +135,7 @@ namespace S7.Net
|
||||
|
||||
CPU = cpu;
|
||||
IP = ip;
|
||||
PORT = port;
|
||||
Port = port;
|
||||
Rack = rack;
|
||||
Slot = slot;
|
||||
MaxPDUSize = 240;
|
||||
@@ -161,7 +161,7 @@ namespace S7.Net
|
||||
|
||||
CPU = cpu;
|
||||
IP = ip;
|
||||
PORT = 102;
|
||||
Port = 102;
|
||||
Rack = rack;
|
||||
Slot = slot;
|
||||
MaxPDUSize = 240;
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace S7.Net
|
||||
{
|
||||
tcpClient = new TcpClient();
|
||||
ConfigureConnection();
|
||||
await tcpClient.ConnectAsync(IP, PORT);
|
||||
await tcpClient.ConnectAsync(IP, Port);
|
||||
stream = tcpClient.GetStream();
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace S7.Net
|
||||
{
|
||||
tcpClient = new TcpClient();
|
||||
ConfigureConnection();
|
||||
tcpClient.Connect(IP, PORT);
|
||||
tcpClient.Connect(IP, Port);
|
||||
stream = tcpClient.GetStream();
|
||||
}
|
||||
catch (SocketException sex)
|
||||
|
||||
Reference in New Issue
Block a user