Files
6098/Cowain.Bake.Communication/Interface/IPLCDevice.cs

51 lines
2.1 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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);
}
}