IPLC.cs
1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
using Hh.Mes.POJO.BllModel;
using Hh.Mes.POJO.Entity;
using HHECS.Model.PLCHelper.PLCComponent;
using System.Collections.Generic;
namespace HHECS.Model.PLCHelper.Interfaces
{
/// <summary>
/// PLC顶层接口
/// </summary>
public interface IPLC
{
string Name { get; set; }
string IP { get; set; }
PLCType PLCType { get; set; }
/// <summary>
/// 连接,通常指定PLC的初始化请在连接中进行
/// </summary>
/// <returns></returns>
BllResult Connect();
/// <summary>
/// 断开,通常在断开之前请先停止逻辑处理,延迟后再调用
/// </summary>
/// <returns></returns>
BllResult DisConnect();
/// <summary>
/// 获取连接状态
/// hack:对于使用OPC实现,此链接状态指示为client与OPC服务器的连接状态;所以使用OPC的情况下需要额外检测读写是否正确。
/// </summary>
/// <returns></returns>
BllResult GetConnectStatus();
/// <summary>
/// 读取地址
/// </summary>
/// <param name="equipmentProps"></param>
/// <returns></returns>
BllResult Reads(List<base_equipment_prop> equipmentProps);
/// <summary>
/// 写入地址
/// </summary>
/// <param name="equipmentProps"></param>
/// <returns></returns>
BllResult Writes(List<base_equipment_prop> equipmentProps);
/// <summary>
/// 读取单个地址
/// </summary>
/// <param name="equipmentProp"></param>
/// <returns></returns>
BllResult Read(base_equipment_prop equipmentProp);
/// <summary>
/// 写入单个地址
/// </summary>
/// <param name="equipmentProp"></param>
/// <returns></returns>
BllResult Write(base_equipment_prop equipmentProp);
}
}