51 lines
2.1 KiB
C#
51 lines
2.1 KiB
C#
|
||
using Cowain.Bake.BLL;
|
||
using Cowain.Bake.Common;
|
||
using Cowain.Bake.Common.Models;
|
||
using Cowain.Bake.Model.Entity;
|
||
using Cowain.Bake.Model.Models;
|
||
using HslCommunication;
|
||
using Opc.Ua;
|
||
using Prism.Commands;
|
||
using System;
|
||
using System.Collections.Generic;
|
||
using System.Collections.ObjectModel;
|
||
using System.Linq;
|
||
using System.Text;
|
||
using System.Threading.Tasks;
|
||
|
||
namespace Cowain.Bake.Communication.Interface
|
||
{
|
||
public interface IPLCDevice//接口Plc
|
||
{
|
||
bool IsConnect { get; set; }//是否连接
|
||
int Id { get; set; }//id
|
||
string Name { get; set; }//名称
|
||
string DeviceName { get; set; }//设备名称
|
||
int ReadUseTime { get; set; }//读取使用时间
|
||
//字典
|
||
Dictionary<int, Variable> VariableDic { get; set; } //key:plc地址,value:这个地址的相关信息,可以删除,基本不用
|
||
List<TagEntity> TagList { get; set; } //数据库中查询出来的
|
||
ObservableCollection<Variable> VariableList { get; set; } //一个PLC中的所有(界面显示) 与Storages的VariableList是同一块内存
|
||
List<StorageArea> Storages { get; set; } //Storages里也有一个VariableList,一个PLC分成若干个VariableList组,分组读取数据
|
||
|
||
void Heartbeat();
|
||
void Connect();//连接
|
||
void Close();//关闭
|
||
void StartRead();//开始读取
|
||
void AnalysisAddress();
|
||
void GetStorageArea();
|
||
void GetJsonParam(string param);
|
||
void ReadStorageArea();
|
||
List<DataValue> Reads(NodeId[] nodeIds);
|
||
OperateResult<T> Read<T>(string tag);
|
||
OperateResult<T> GetValue<T>(string paramName);
|
||
OperateResult<T> GetValue<T>(string paramName, int machineId, int number = 1);
|
||
Variable GetVariable(string paramName, int machineId, int number = 1);
|
||
//OperateResult Write<T>(string paramName, int machineId, int number, T data);
|
||
|
||
OperateResult Write<T>(string address, T data, int maxCount = Global.MAX_READS);
|
||
OperateResult Writes(string[] tags, object[] values, int maxCount = Global.MAX_READS);
|
||
}
|
||
}
|