-
Notifications
You must be signed in to change notification settings - Fork 136
7 Modbus.Net.OPC
luosheng edited this page Jun 7, 2023
·
10 revisions
OPC是OPC基金会研发的标准实时通讯协议,拥有两种方式:基于虚拟串口的OPC DA和基于以太网tcp协议的OPC UA。
Modbus.Net.Opc有一个非常特殊的Formater叫AddressFormaterOpc。
它的参数中有一个Lambda函数,这个函数的参数是设备和地址,你应该根据这两个参数输出该地址对应的OPC标签(OPC Tag)。
下面举例
如果你的标签为"1.15.Value_Opening", 1为设备Id, 15是站号,Value_Opening是点的信息。
(baseMachine, addressUnit) => return new string[]{baseMachine.Id+"."+((XXUnitExtend)addressUnit.unitExtend).stationId+"."+addressUnit.Name};
如果OPC服务的托管程序运行在管理员权限之下,那个运行Modbus.Net.Opc获取这个OPC服务数据的程序也必须使用管理员权限运行,否则会无法连接的错误。
OPC DA 应为 "opcda://PC-Name/OPC-Software-Name"。
但是请注意,如果报IOPCServerList2不存在错误,还需要把CLSID追加在后面。
opcda://PC-Name/OPC-Software-Name/{CLSID}
OPC UA 应为 "opc.tcp://PC-Name/Opc-Software-Name"。
Modbus.Net Hangzhou Delian Science Technology Co.,Ltd. © 2023
-
2 Specification of Modbus.Net main framework
- 2.1 Modbus.Net Architecture
- 2.2 Transmission Control Layer Controller
- 2.3 Transmission Link Layer Connector
- 2.4 Concrete Protocol Layer ProtocolLinker
- 2.5 Abstract Protocol Layer Protocol
- 2.6 Protocol Presentation Layer Utility
- 2.7 Device Application Layer Machine
- 2.8 Task Application Layer MachineJob
-
3 Using Modbus.Net to implement a protocol
- 3.1 Global Tools
- 3.2 Extends Protocol and ProtocolUnit according to protocol specification
- 3.3 Extends Connector to create a link method
- 3.4 Extends Machine and Utility, creating two apis
- 3.5 Extends API methods to Machine and Utility
- 3.6 Extends Formater, Translator and Combiner, Creating Encoding,Decoding,Combining methods for address
- 3.7 Extends Controller, to control message