mirror of
https://github.com/S7NetPlus/s7netplus.git
synced 2026-02-17 22:38:27 +08:00
Removed the Controls project and existing Test projects. Added new Test project and references to NUnit and Should projects for testing. Extracted IPlc interface to help test projects that reference this library. Also implemented the IDisposable interface on the Plc object so that references to mSocket would be cleaned up appropriately when the object is blown away.
26 lines
978 B
C#
26 lines
978 B
C#
using System;
|
|
|
|
namespace S7
|
|
{
|
|
public interface IPlc : IDisposable
|
|
{
|
|
string IP { get; set; }
|
|
bool IsConnected { get; }
|
|
CPU_Type CPU { get; set; }
|
|
Int16 Rack { get; set; }
|
|
Int16 Slot { get; set; }
|
|
string Name { get; set; }
|
|
object Tag { get; set; }
|
|
bool IsAvailable { get; }
|
|
ErrorCode Open();
|
|
void Close();
|
|
byte[] ReadBytes(DataType DataType, int DB, int StartByteAdr, int count);
|
|
object Read(DataType DataType, int DB, int StartByteAdr, VarType VarType, int VarCount);
|
|
object Read(string variable);
|
|
object ReadStruct(Type structType, int DB);
|
|
ErrorCode WriteBytes(DataType DataType, int DB, int StartByteAdr, byte[] value);
|
|
object Write(DataType DataType, int DB, int StartByteAdr, object value);
|
|
object Write(string variable, object value);
|
|
ErrorCode WriteStruct(object structValue, int DB);
|
|
}
|
|
} |