添加HSL,并创建工具类,在IWCS写测试
This commit is contained in:
1 parent
2c178b1810
commit
b0a6dcc035
10 files changed
+1381
-4
No files matched your search
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using HslCommunication;
|
||||
|
||||
namespace HHWMS.Web.Support.PLC
|
||||
{
|
||||
public interface IPlcDevice : IDisposable
|
||||
{
|
||||
bool Connect(string ipAddress, byte rack = 0, byte slot = 1);
|
||||
void Disconnect();
|
||||
bool IsConnected { get; }
|
||||
|
||||
// 基本类型读写
|
||||
short ReadInt16(string address);
|
||||
bool WriteInt16(string address, short value);
|
||||
int ReadInt32(string address);
|
||||
bool WriteInt32(string address, int value);
|
||||
long ReadInt64(string address);
|
||||
bool WriteInt64(string address, long value);
|
||||
float ReadFloat(string address);
|
||||
bool WriteFloat(string address, float value);
|
||||
double ReadDouble(string address);
|
||||
bool WriteDouble(string address, double value);
|
||||
bool ReadBool(string address);
|
||||
bool WriteBool(string address, bool value);
|
||||
string ReadString(string address, ushort length);
|
||||
bool WriteString(string address, string value, ushort length);
|
||||
|
||||
// 批量读写
|
||||
short[] ReadInt16Array(string address, ushort length);
|
||||
bool WriteInt16Array(string address, short[] values);
|
||||
bool[] ReadBoolArray(string address, ushort length);
|
||||
bool WriteBoolArray(string address, bool[] values);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user