OPC 谈英姿 东南大学自控系工业自动化教研室

Download Report

Transcript OPC 谈英姿 东南大学自控系工业自动化教研室

OPC接口技术
谈英姿
[email protected]
东南大学自控系工业自动化教研室
内容提要
• 概述
• OPC基本原理
• OPC自定义接口
业务部门
Internet/Ethernet
OPC
Windows NT
HMI/SCADA
Data Acquisition
产品制造
工程部门
测试/质管部门
Ethernet
OPC
维护部门
Windows NT
DeviceNet
FOUNDATON
PROFIBUS
N
分布式 I/O
N
N
N
数据采集
可视监控
运动控制
N
PLC
N
数据采集
HMI
Excel
OPC Client
Internet
OPC Client
OPC Client
OPC Server
OPC Server
OPC Server
HMI
SCADA
SCADA
Fieldbus
System
Measurement
-Pressure
-Temp
-Flow
-Level
Valves
Positioners
PID Control
N
N
N
N
N
N
N
N
N
FieldPoint
System
PLC System
为什么需要OPC
Display
Application
Software
Driver
Trend
Application
Software
Driver
Software
Driver
Report
Application
Software
Driver
OPC的解决方案
Display
Application
Trend
Application
Report
Application
OPC
OPC
OPC
OPC
Software
Driver
OPC
Software
Driver
OPC
Software
Driver
OPC
Software
Driver
概述
• OLE for Process Control
(Object linking and embedding)
•
•
•
•
now: Open Process Control
Openess Productivity and Conectivity
OPC(用于过程控制的OLE)是一个工业标准。
OPC由一些世界上占领先地位的自动化系统和硬件、
软件公司与微软(Microsoft)紧密合作而建立的。
OPC定义了应用Microsoft操作系统在基于PC 的客
户机之间交换自动化实时数据的方法。
管理这个标准的国际组织是OPC基金会。
OPC的宗旨
• OPC的宗旨是在Microsoft COM、
DCOM和Active X技术的功能规程基础
上开发一个开放的和互操作的接口标准。
• 这个标准的目标是促使自动化/控制应用、
现场系统/设备和商业/办公室应用之间
具有更强大的互操作能力。
Before OPC
visualization
history
data
base
MasterBus
MMS driver
ABB PLCs
XWAY
driver
Profinet
driver
Télémécanique
PLCs
Siemens PLCs
With OPC: ABB Operator Workplace Connection
OperatorIT
Historian
(Information
Manager)
application software is
written independently
from the type of
controller
the drivers still exist,
but the clients do not
see them anymore
ABB AC800M
AC800M
OPC server
Schneider
OPC server
Siemens
OPC server
MMS
XWAY
ProfiNet
Télémécanique TSX
Siemens S7
OPC技术基础
• OPC技术基于微软的OLE (现在的Active X)、
COM (部件对象模型)和DCOM (分布式部件
对象模型)技术。
• OPC包括一整套接口、属性和方法的标准集,
用于过程控制和制造业自动化系统。
• Active X/COM技术定义各种不同的软件部件
如何交互使用和分享数据。
• 不论过程中采用什么软件或设备,OPC为多种
多样的过程控制设备之间进行通信提供了公用
的接口。
OPC技术基础构成
ActiveX
Object Linking and
Embedding (OLE)
OLE for Process
Control (OPC)
(Distributed) Component Object Model
(COM / DCOM)
only between
nodes
Transport
(TCP-IP, UDP, Queued)
Ethernet
OPC基金会
• 管理OPC标准的组织是OPC基金会。其
前身由一个Fisher-Rosemount、
Rockwell Software、Siemens、
Opto22、Intellution和Intuitive
Technology等著名大公司组成专门的工
作组,仅仅用了短短的一年时间便开发
出一个基本的可运行的OPC技术规范。
在1996年8月发布了简化的、一步到位
的解决方案。
OPC基金会
• OPC基金会的工作比其他许多标准化集团能够
更高速运转。原因十分简单,只是由于OPC是
建立在已普遍使用的Mricrosoft标准基础上。
而其他标准化集团必经完全从最基本开始定义
标准,因此在其工作范围内达成一致的意见往
往是费时费力,自然其工作效率是不能和OPC
基金会比拟的。
• Micosoft是OPC基金会的一个成员,已给予
OPC基金会强有力的支持。但Microsoft在
OPC中的作用主要在于其强大的后援支持,而
让具有丰富的行业经验的成员公司指导OPC基
金会的工作。
OPC基金会组织结构
OPC中国基金会
• OPC中国基金会的宗旨是在中国推广OPC,以
消除中国与其它发达国家的信息差距。
• 通过定期召开中国基金会会员大会、制定相应
的规章制度,同时针对中国市场建立相应的市
场营销体系,提供培训、信息以及展会的组织,
以进一步加强各会员的利益,以本地化的形式
加强与OPC基金会的联系。
• http://www.opcchina.org/
OPC 特性
• 任何客户机都可以与服务器连接
•
•
•
•
•
•
即插即用的互操作性是其目标
该标准已被公开并出版\
OPC 基金会是管理此工业标准的组织\
灵活性 接纳所有类型的客户机及服务器\
高效性 优化快速传输数据\
可以支持所有编程语言\
C, C++, VB, Java, HTML, DHTML \
可利用Internet \
OPC as a hub
source: Siemens
WinCC
OPC connection to databases
Tools allow to build an OPC DA interface to any ODBC equipped database.
The database internal structure (exposed through queries)
is reflected as a hierarchy of OPC items.
This allows to give a unified access to simple items.
application
(OPC client)
OPC server
ODBC
DB
OPC for internal communication: AIP as example
AIP
aspects
aspects
aspects
aspects
Asset
Optimizer
Enterprise
Historian
OPC server
aspect
directory
OPC
connections
OPC client
AC800M
OPC server
Schneider
OPC server
Siemens
OPC server
OPC Connection to ERP
Direct and Fieldbus access
direct connection
client application
(OPC client)
(local)
OPC
server
fieldbus connection
client application
(OPC client)
clients and
servers run
as parallel
processes
(local)
OPC server
FB Manager
fieldbus
I/O devices
The OPC server is running
all the time, as soon as at
least one client is present
proprieta
ry
protocol
can also be
a point-topoint link
fieldbus
fieldbus
FB agent
FB agent
PLC
PLC
Accessing a server in another node
client application
(OPC client)
stub
DCOM
TCP/IP
DCOM
Limitation:
does not work over firewalls.
Solution:
OPC XML (see later)
TCP/IP
TCP/IP
DCOM
DCOM
OPC
server
OPC server
FB Manager
fieldbus
COM/DCOM across multiple nodes
connectivity node
app3 TCP/IP
OPC server
for BrandZ
Ethernet
TCP/IP
node 1
application 2
(OPC client)
OPC server
for BrandY
Fieldbus
Y
input / output to plant
application 1
(OPC client)
panel
OPC server OPC server
for BrandX for simulation
Fieldbus
X
drivers
OPC基本原理
• 通用OPC结构及组成
• 对象及接口概述
• 必需的接口定义
• 可选的接口定义
• 服务器地址空间及配置
• 时间同步与顺序发送机制
• 永久存储机制
• EnumOPC对象属性条目
通用OPC结构及组成
• OPC数据访问规范
• OPC报警和事件规范
• OPC数据交换规范
• OPC历史数据访问规范
• OPC批处理规范
• OPC安全性规范
• OPC XML规范
OPC标准的发展历史
标准
版本
内容
Data Access
3.0,2.0,1.0
数据访问规范
Alarms and Events
1.10,1.00
报警和事件规范
Historical Data Access
1.0
历史数据存取规范
Batch
2.0,1.0
批量过程规范
Security
1.0
安全性规范
Compliance
2.00.2
数据访问标准的测试工具
OPC XML
1.00,0.18
过程数据的XML规范
OPC eXchange
1.0
数据交换规范
OPC Commands
正在开发
命令规范
OPC Common I/O
正在开发
公共I/O规范
OPC Complex Data
正在开发
复杂数据规范
OPC
Batch
OPC
HDA
batch
system
history
data base
OPC
DX
OPC
Data Access
OPC
Alarms & Events
OPC
UA
Unified Architecture规范
OPC数据访问规范
OPC DA 的适用领域
OPC (通过DCOM)可以
使用在各个子系统与
管理终端之间
OPC处于数据监视应用程序
和专用的IO驱动软件之间
Data Monitor
Sub-System
OPC
Device Specific
I/O Control
底层传感器往往
使用专用接口和协议
OPC数据访问规范特点
• 基于COM 技术技术
• 灵活支持多类应用程序支持多类应用
• 高效与可扩展性支持大型应用程序支
• 高性能支持网络操作支持网络操作
• 易于理解易于理解
• 被广泛接受被广泛接受
OPC DA 能提供那类数据?
• 传感器的实时数据:温度、压力和流量
• 控制参数:打开、关闭、运行和停如
• 状态信息状态信息
硬件连接状态硬件连接状态
软件和子系统的状态软件和子系统的状态
总之, OPC DA 可以提供任何类型数据
OPC DA
• 每个OPC DA 服务器是一个独立的对象服一对
• OPC DA 服务器提供了到现场数据源的服务供
一个窗口窗口”
• 数据通过对应的Tag 访问
• (Tag 的定义由生产商和硬件有关生产商有关)
• 数据可以周期性轮询或单次读写数据可以周期
性轮询或单次读写
OPC报警和事件规范
OPC AE
• OPC提供了OPC服务器发生异常时,以
及OPC服务器设定事件到来时向OPC客
户发送通知的一种机制,通过使用OPC
技术,能够更好的捕捉控制过程中的各
种报警和事件并给予相应的处理。
OPC历史数据访问规范
• OPC提供了读取存储在过程数据存档文
件、数据库或远程终端设备中的历史数
据以及对其操作、编辑的方法。
.
HDA for Historical Data Access
OPC数据交换规范
• 什么是OPC DX? OPC DX?
• 将确定穿过以太网的现场总线网络进行
服务器到服务器的通信远程组态配置和
管理服务远程组态配置和管理服务
• 延伸OPC DA 标准标准
• OPC DX 将不影响现有的现场总线规将
范范
OPC数据交换规范
谁需要OPC DX? OPC DX?
• 自动化用户自动化用户
希望有一套开放性的标准有以把各家以太网
上的设备和控制器的数据进行交换并予以集
成。并予以集成。
• 自动化设备供应商自动化设备供应商
期望提供符合开放性工业标准的产品,使之
能互操作以及进行数据交换使之能互操作以
及进行数据
OPC DX 应用
OPC批处理规范
• OPC Batch 的目的是使异构计算环境下
不同的生产控制方案等有效地协同工作.
• 一个批处理服务器可以从其他OPC数据
访问服务器或专用的批处理过程控制软
件获得数据.
OPC Batch
Procedure
Based on:
IEC 61512-1 Batch Control – Part 1: Models and
consists of an
ordered set of
Terminology
Unit
(ANSI/ISA S88.01 1995)
Procedure
ISA-dS88.02-2000 draft 17 of May 2000
consists of an
ordered set of
Allows to access:
• equipment capabilities,
• current operating conditions,
• historical contents
• recipe contents
Operation
consists of an
ordered set of
Phase
OPC安全性规范
• OPC 安全性规范提供了一种专门的机制
来保护敏感的数据.
• 该安全机制是通过在OPC服务器对象上
增加IOPCSecruityNT接口和
IOPCSecruityPrivate接口来实现的。
OPC XML规范
• OPC XML 的应用领域的应用领域
通过Internet实现数据访问实现数据访问
跨平台(非微软)的OPC 应用应用
基于.NET 技术的应用技术的应用
• OPC XML 的技术背景的技术背景
• OPC DA(数据存取)功能功能
数据订阅数据订阅
数据浏览数据浏览
Web Service Web Service
SOAP( (简单对象访问协议) 访问协议)
OPC XML规范
对象及接口概述
• OPC对象
OPC对象有三个:服务器(OPC Server)、组(OPC
Group)和项(OPC Item)
• OPC接口
“Automation” vs. “Custom” interface
"Automation" client
(Visual Basic, Excel,…)
OPC Automation
wrapper
"Custom" client
(C++,….)
custom interface
custom interface
server
server
必需的接口定义
• OPC服务器必需的接口有
Iunknown
IOPCServer
IOPCCommer
IConnectionPointContainer
标准OPC服务器对象
标准OPC组对象