You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
97 lines
2.8 KiB
C#
97 lines
2.8 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
|
|
namespace SlnMesnac.Plc
|
|
{
|
|
public interface IPlc
|
|
{
|
|
/// <summary>
|
|
/// 连接标识
|
|
/// </summary>
|
|
bool IsConnected { get; set; }
|
|
|
|
/// <summary>
|
|
/// 建立连接
|
|
/// </summary>
|
|
/// <param name="IP"></param>
|
|
/// <param name="port"></param>
|
|
/// <returns></returns>
|
|
bool Connect(string IP, int port);
|
|
|
|
/// <summary>
|
|
/// 断开连接
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
bool DisConnect();
|
|
|
|
/// <summary>
|
|
/// 通过地址和长度读取PLC数据
|
|
/// </summary>
|
|
/// <param name="len"></param>
|
|
/// <param name="address"></param>
|
|
/// <returns></returns>
|
|
byte[] readValueByAddress(int len, string address);
|
|
|
|
/// <summary>
|
|
/// 通过PLC地址写入int类型数据
|
|
/// </summary>
|
|
/// <param name="address"></param>
|
|
/// <param name="value"></param>
|
|
/// <returns></returns>
|
|
bool writeValueByAddress(string address,int value);
|
|
|
|
/// <summary>
|
|
/// 通过PLC地址读取int16类型数据
|
|
/// </summary>
|
|
/// <param name="address"></param>
|
|
/// <returns></returns>
|
|
int readInt16ByAddress(string address);
|
|
|
|
/// <summary>
|
|
/// 通过PLC地址写入Short类型数据
|
|
/// </summary>
|
|
/// <param name="address"></param>
|
|
/// <param name="value"></param>
|
|
/// <returns></returns>
|
|
bool writeShortByAddress(string address, int value);
|
|
|
|
/// <summary>
|
|
/// 通过PLC地址读取string类型数据
|
|
/// </summary>
|
|
/// <param name="address"></param>
|
|
/// <returns></returns>
|
|
string readStringByAddress(string address, ushort length);
|
|
|
|
/// <summary>
|
|
/// 通过PLC地址写入String类型数据
|
|
/// </summary>
|
|
/// <param name="address"></param>
|
|
/// <param name="SFC"></param>
|
|
/// <returns></returns>
|
|
bool writeStringByAddress(string address, string value);
|
|
|
|
/// <summary>
|
|
/// 通过PLC地址读取Bool类型数据
|
|
/// </summary>
|
|
/// <param name="address"></param>
|
|
/// <returns></returns>
|
|
bool readBoolByAddress(string address);
|
|
|
|
/// <summary>
|
|
/// 通过PLC地址写入Bool类型数据
|
|
/// </summary>
|
|
/// <param name="address"></param>
|
|
/// <returns></returns>
|
|
bool writeBoolByAddress(string address, bool value);
|
|
|
|
/// <summary>
|
|
/// 通过PLC地址写入Double类型数据
|
|
/// </summary>
|
|
/// <param name="address"></param>
|
|
/// <param name="value"></param>
|
|
/// <returns></returns>
|
|
bool writeDoubleByAddress(string address, int value);
|
|
}
|
|
}
|