Add PLCIpAddress property to S7Client

This commit is contained in:
Tolga Çakır
2021-02-04 14:26:24 +03:00
parent 3c6fdf0246
commit 2bc47b1b14

View File

@@ -698,6 +698,7 @@ namespace Sharp7
public int ConnectTo(string Address, int Rack, int Slot) public int ConnectTo(string Address, int Rack, int Slot)
{ {
PLCIpAddress = Address;
UInt16 RemoteTSAP = (UInt16)((ConnType << 8) + (Rack * 0x20) + Slot); UInt16 RemoteTSAP = (UInt16)((ConnType << 8) + (Rack * 0x20) + Slot);
SetConnectionParams(Address, 0x0100, RemoteTSAP); SetConnectionParams(Address, 0x0100, RemoteTSAP);
return Connect(); return Connect();
@@ -2268,6 +2269,8 @@ namespace Sharp7
} }
} }
public string PLCIpAddress { get; private set; }
public int PLCPort public int PLCPort
{ {
get => _PLCPort; get => _PLCPort;