Files
WMS/HHWMS.Web/Support/PLC/IPlcDevice.cs
T

34 lines
1.2 KiB
C#

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);
}
}