如何通过OPC UA实现两台WinCC SCADA电脑间的客户端服务器通讯
工业物联网应用,使用OPC-UA在两台PC间交换数据

组态王7.5sp2破解补丁Patch QQ525755708 组态王7.5sp1破解补丁KingSCADA3.53破解补丁PatchQQ525755708KingSCADA3.52SP1破解补丁...........................................................................使用OPC UA在两台PC间交换数据OPC UA不需要使用DCOM来远程连接。
防火墙配置简单化,完全消除了DCOM 配置时的问题。
OPC通道本身不是一个产品,它要求在client端和server端都支持OPC UA。
OPC UA server打包在OPC DA、native interface、一些情况下在DDE server中。
要使用OPC UA实现远程连接只需做很少的配置。
OPC UA client是一个驱动,能在其下添加其他的设备channel。
*在下文中:“server PC”指作为OPC UA server端的PC机“client PC”指作为OPC UA client端的PC机系统结构图1、Security 设置1》 OPC UA configuration在server PC端操作运行KEPServerEX5,在桌面右下角右键单击“”打开“OPC UA Configuration”,选中标签“Trusted Client”,如下图若是红色“X”,则右键点击“trust”再选中标签“Trusted Server”,像上图中一样查看。
然后单击“close”关闭。
2》交换证书(方法1)第一步:在server PC 上操作,右键桌面右下角小图标——选择“settings”——弹出右下对话框。
选中标签“Configuration”,勾选“Allow runtime to……”单击“确定”。
打开防火墙,开端口。
“开始”——“运行”——“firewall.cpl”选中标签“例外”,其中单击“添加端口”,弹出下图对话框。
Kepware opcua两个电脑间的通讯设置

OPC Unified Architecture - Connectivity GuideJanuary, 2010Ref. 01.02©Kepware TechnologiesTable of Contents1. Overview (1)2. Prerequisites (1)3. Security (2)3.1 Automatic (2)3.2 Exchange (3)3.3 Manual (7)4. Setting up the Server (11)4.1 Endpoints (11)4.2 Firewall (13)5. Setting up a Discovery Service (Optional) (15)5.1 Server (15)5.2 OPC Foundation (17)6. Setting up the Client (22)6.1 OPC UA Client Channel (22)6.2 OPC UA Client Device (26)6.3 Verification (28)7. Summary (28)1.O verviewThe idea of setting up a remote OPC connection can even bring fear to those who are vastly familiar with DCOM and classic remote OPC. Out of desperation, it may even be common practice to disable firewalls and also expose the computer to unauthorized or anonymous users. Even if a firewall is in place, DCOM requires that port 135 be added to the exception list by default. This port is used for Microsoft’s Remote Procedure Call and has been the target of many malicious attacks. So how can a safe and secure remote OPC connection be established?The solution comes in the form of a new specification known as OPC Unified Architecture (OPC UA). OPC UA does not require callbacks and the use of DCOM for remote connections. This greatly simplifies firewall configuration and completely eliminates the headache known as DCOM.The OPC Tunnel is not a product in itself, but rather a feature that is created out of existing components that are available. The tunnel requires the same client-server architecture as any OPC product; however, the client and server both need to have OPC UA support. In this case, it happens that the client and the server are part of the same product package.The OPC UA server is packaged in with the OPC DA, native interface and, in some cases, DDE servers. By default, the OPC UA server is running and waiting for local connections immediately after the product has been installed. Minor configuration changes are required to allow remote connections. The OPC UA client is actually a driver channel that can be added along with any other device channel. If required, an OPC UA client and an OPC UA server can both be running on the same computer and be sharing data with a remote computer with the same configuration. The result is a connection between two remote servers with the ability to easily share items in a secure way. 2.P rerequisitesInstall the server application on the client computer and include OPC UA Client on the Select Features page under Communication Drivers.Install the server application on the server computer. Since UA functionality is included, no additional features need to be selected during the install.Some situations are going to require that each computer act as a server as well as a client. If so, install the OPC UA Client driver on each computer that needs to access items remotely.3.S ecurityIn place of relying on the computer’s operating system to secure the applications, OPCUA uses X.509 authentication technology. This technology consists of a set of public andprivate keys for each entity wishing to establish a trust. The private key is protected while the public key is placed into a certificate for distribution. In order to establish asecure connection between a client and the server, their certificates must first be “swapped” and also “trusted”. The swap is only required to be done once for the lifetime of the certificate.There are a few options when deciding how to swap certificates: automatic, exchange,and manual. The automatic trust can be established during runtime when the client first attempts to connect to the server. Several UA client and server applications support this feature and most present a dialog requesting that the user trust or reject the incoming certificate. Because the Runtime doesn’t interact with the desktop, an extra step may be required on the server to “Trust” the certificate once it has been swapped. The exchange is preformed from the client side and only takes an instant to complete; however, the server computer must have an open port in the firewall and the Runtime must be allowed to accept remote configuration on that port. The manual method consists of exporting and importing a certificate file on each computer using removable media or another form of file transfer for the exchange to take place. The manual process also allows for swapping certificates between client and server applications that do not support automatic exchange.If security is not necessary, the certificate swap can be skipped. The level of security is set by the server when defining the endpoints. If None, None is selected as the a Security Policy, certificates are not checked for validation. For unsecure connections, move on to Setting up the Server.3.1AutomaticThe automatic swapping of the certificates only happens when it is required. For instance, adding an OPC UA Client channel and selecting a secure serverendpoint will prompt the user to allow the server to be trusted. Once a device is added to the OPC UA Client and user attempts to import items, the server willfirst need to trust the client. By design, this server cannot post a dialog to thedesktop so a method of trusting swapped certificates was implemented.First, let’s assume the project was already configured for this application’s ownclient and server. The client has attempted to connect for the first time so thecertificates have swapped, but are not yet trusted.1.Right-click on the Administration icon and select OPC UA Configuration.2.View the Trusted Servers tab.3.If the server’s certificate appears with a red ‘X’ it is also not yet trusted.Right-click on the certificate and select Trust.4.View the Trusted Clients tab.5.If the client’s certificate appears with a red ‘X’ it is not yet trusted. Right-clickon the certificate and select Trust.3.2Exchange1.Right-click on the Administration icon, select Settings and choose theConfiguration tab.2.Enable remote configuration by checking Allow runtime to accept remoteconnections. The change will only be applied when the Configurationinterface is shutdown since it is using the same port to configure the Runtime locally.3.Add an exception to the windows firewall for port that is specified inCommunicate using port property on the Configuration tab. Anotheroption is to temporarily turn off the firewall before the exchange is performed and return the firewall back to its secure state when the process is complete.This method also prevents unauthorized users from exchanging certificates in the future.4.Enable the exception in the windows firewall for File and Printer Sharing.5.From the client computer, launch the OPC UA Configuration Manager byright-clicking on the Administration icon and selecting OPC UAConfiguration.6.Select the Trusted Servers tab.7.Select Exchange.8.When the Server Instance dialog appears, click the Browse icon to theright of the Remote host field. Some newer operating systems will be required to have discovery and file sharing enabled.9.Browse to the server by navigating the tree.10.Select the computer name and select OK.11.Verify that the correct port is identified in the Remote port field. This valueshould be the same as what was viewed on the server computer when the exception was made to the firewall. This port is used for remote configuration of the server.12.Select OK.13.A message will appear stating that the exchange was successful. The servercertificate should appear in the Trusted Servers window and can beidentified by the URI.unch the OPC UA Configuration Manager on the server computer. Theclient certificate should already in the Trusted Clients window and can beidentified by the URI.3.3Manualunch the OPC UA Configuration Manager on the server computer byright-clicking on the Administration icon and selecting OPC UAConfiguration.2.Select the Instance Certificate tab.3.Under the Server group, select Export server certificate.4.Select a location for the certificate file so that it can be easily located. Thedefault file name is the thumbprint that identifies the certificate, but it may be changed to make managing the files easier.5.Manually copy the server certificate file from the server computer and moveit onto the client computer.unch the OPC UA Configuration Manager on the client computer.7.Select the Trusted Servers tab.8.Select Import and locate the server certificate file.9.Select Open.10.The server certificate should appear in the Trusted Servers window and canbe identified by the URI.11.Select the Instance Certificate tab.12.Under the Client Driver group, select Export client driver certificate.13.Select a location for the certificate file so that it can be easily located. Again,the file name can be changed if desired.14.Manually copy the client certificate file from the client computer and return itto the server computer.unch the OPC UA Configuration Manager on the server computer.16.Select the Trusted Clients tab.17.Select Import and locate the client certificate file.18.Select Open.19.The client certificate should appear in the Trusted Clients window and canbe identified by the URI.4.S etting up the Server4.1EndpointsIn order for an OPC UA client to connect to an OPC UA server, the client needs to know the server location and security requirements. In its complex form, theclient will use a location and port number, called a Discovery Endpoint, todiscover information about the server. The server will, in turn, return all configured endpoints along with security requirements that are available to the client.To simplify the process, the Discovery Endpoint and the Server Endpoint can be the same location as is the case for this server application.During the install of the server application, an initial endpoint is created for local connections. Minor configuration changes are required to allow remote clients to discover and connect to the server. To become familiar with this configuration or to add and make changes to the existing endpoints, follow these steps:unch the OPC UA Configuration Manager by right-clicking on theAdministration icon and selecting OPC UA Configuration.2.Select the Server Endpoints tab.3.Select the default endpoint that was created during the install for non-localconnections.4.Select Edit.5.Make note of the port number so that it can be added to the firewall.6.If necessary, modify the settings in the Security Policies group. Since thesesettings are for the server, this particular endpoint will allow all connectionswith the enabled policies. I.e. the default endpoint will only allow secureconnections using signing and encryption. If security is not required, selectNone and you may also want to disable the security policies completely.7.With the policies adjusted accordingly, select OK.8.Enable the endpoint by selecting it in the list and checking the Enable box.9.Apply the changes to the server Runtime by right-clicking on theAdministration icon and selecting Reinitialize or if the server is notrunning, select Start Runtime.4.2FirewallThe purpose of a firewall is to drop incoming traffic that is not expected(unsolicited traffic) or traffic that does not correspond to the exceptions(excepted traffic) that are set within the firewall. Since OPC UA does not require callbacks, only the server computer needs to have the exception.To add the exception, follow these steps on the server computer:unch the Windows Firewall by selecting Start | Run and then typingfirewall.cpl.2.Windows Vista or Windows Server 2008 will not directly display the settingsdialog. To view the dialog, select Change Settings.3.Select the General tab.4.Verify that the firewall is enabled by choosing On.5.Select the Exceptions tab.6.Click Add port.7.Enter UA Endpoint in the Name field.8.Enter the port number that is assigned to the endpoint in the Port numberfield.9.Verify that the correct Protocol is selected. The default is TCP.10.Click OK.11.If multiple endpoints are assigned to the server, continue to add them now.12.When done, click OK to close the settings dialog.5.S etting up a Discovery Service (Optional)Those who are familiar with Classic OPC are familiar with an application called OPCEnum. This application runs locally on the serving computer and exposes available Classic OPC servers to the remotely connecting client(s). A client simply needs to know the serving computer’s location on the network.Unfortunately, OPC UA lost this luxury in exchange for its platform independence. However, to provide the same usability, a service was created that allows OPC UA servers to be discovered at a “well-know” location. This service, called the Local Discovery Service (LDS), is expected to be installed on every computer that is running an OPC UA server (the same way OPCEnum is installed alongside most Classic OPC servers). However, the development and implementation of the LDS is not as far along as OPC UA itself so the actual usage or the service will vary.This server application does not provide a LDS, but can be register for discovery by exchanging certificates with one provided by the OPC Foundation.5.1Serverunch the OPC UA Configuration Manager by right-clicking on theAdministration icon and selecting OPC UA Configuration.3.Under the Server group, select Export server certificate.4.Select a location for the certificate file so that it can be easily located. Thedefault file name is the thumbprint that identifies the certificate, but it maybe changed to make managing the files easier.5.If the Local Discovery Service is on another machine, manually copy theserver certificate file from the server computer and move it onto thecomputer that is running the service.7.Select Import and locate the LDS certificate file.8.Select Open.9.The LDS certificate should appear in the window. The URL defaults tolocalhost and must be changed if it resides on a remote computer.5.2OPC Foundationunch the Microsoft Management Console by selecting Start | Run andthen typing mmc.exe.2.Select File | Add/Remove Snap-in.3.In the Available snap-ins window, select Certificates.4.Click Add.5.Choose Computer account in the Certificates snap-in dialog.6.Click Next.7.Choose Local computer in the Select Computer dialog.8.Click Finish.9.Back in the Add or Remove Snap-ins dialog, click OK to apply the changesto the console.10.Under the Console Root folder, expand Certificates (Local Computer),UA Applications, Certificates and select UA Local Discovery Server.11.Select Action | All Tasks > Export.12.Select Next to begin the exportation process.13.Choose DER encoded binary X.509 for the file format.14.Click Next.15.Supply a file name and a destination for the certificate.16.Click Next.17.Review the summary and click Finish.18.Under the Console Root folder, expand Certificates (Local Computer),UA Applications and select, Certificates.19.Select Action | All Tasks > Import.20.Click Next to begin the importation process.21.Browse to the server certificate file that was previously exported from theOPC UA Configuration Manager.22.Click Open.23.Click Next.24.Choose Place all certificates in the following store on the CertificateStore page. Ensure that the UA Applications store is displayed as the destination.25.Click Next.26.Review the summary and click Finish.27.The server’s certificate will appear in the UA Applications store.The discovery service is now configured.6.S etting up the Client6.1OPC UA Client ChannelThe channel wizard is used to locate and identify the OPC UA server, configure session timeouts, and provide user information when applicable.Add a UA Client channel by following these steps:unch the Configuration by right-clicking on the Administration icon andselecting Configuration.2.Select Edit | Devices > New Channel.3.On the Identification page, supply a name for the OPC UA client channel.4.Click Next.5.On the Device Driver page, select OPC UA Client in the Device driver list.6.Click Next.7.Make no changes on the Write Optimization page.8.Click Next.9.On the UA Server page, the server’s endpoint URL can be manually enteredinto the Endpoint URL field. The user can also choose to browse for thecomputer.10.Click the Browse icon to the right of the Endpoint URL field.11.Begin with disabling the Use Discovery URL option. This option is disabledby default.12.Enter the endpoint port number that was created on the server computer inthe Discover Port field. The default port number should already be assigned and should agree with the default endpoint. Also, port 4840 will always be scanned by the browser so if a discovery server is being used, it is notnecessary to enter the correct port number in this field.13.If the port number was changed, click Refresh.14.Navigate the browse tree to locate the server computer by its name.Endpoints that are assigned to localhost will only be found under the Local Machine branch.15.Expand the computer and below it will be a list of available servers.16.Expand the server(s) and select the correct endpoint.17.If you wish to continue to use this endpoint to discover OPC UA servers,enable the Use Discovery URL in the Discovery group at the top of the dialog. This is a global change that will affect all other UA client drivers when this dialog is used.18.Click OK.19.The endpoint information will appear in the UA Server page.20.Click Next.e defaults on the UA Session page. These can be optimized later.22.Click Next.23.Keep the username and password blank on the Authentication page is notrequired.24.Click Next.25.View the Summary and click Finish.6.2OPC UA Client DeviceThe device wizard will guide the user in setting up a subscription and will alsoprovide a way to browse and import items from the OPC UA server. All the items in the device will update according to the settings provided. Multiple devices can be added to the same channel to allow for different update intervals and modes.Add a UA Client device by following these steps:1.With the new channel selected, select Edit | Devices > New Device.2.On the Name page, supply a name for the OPC UA client device.3.Click Next.e defaults on the Subscription, Keep Alive, Priority and Timeout,Monitored Items, and Deadband pages. These can be optimized later.5.Click Next for each page.6.On the Import page, click the Select import items.7.The server’s available items should appear in the Browsing window. If not,the security configuration is incorrect. See Trouble Shooting.8.Select the desired items on the left and click Add Items or Add Branch toimport them into the client.9.When all the items are imported, click OK.10.Click Next back on the Import page.11.View the Summary and click Finish.12.The imported items will populate under the device using the server’s channeland device names as groups.6.3VerificationThe items added in the OPC UA Client can now be browsed by an OPC DA client.For easy verification, follow these steps:1.Simply select Tools | Launch OPC Quick Client. A connection to the localOPC DA server will be established and all items will populate the view.2.Browse for the items in the OPC UA channel and verify that the data’s qualityis good and values are updating.7.S ummaryOPC Unified Architecture provides a means of exchanging data between an OPC server and an OPC client that aims to be platform independent, firewall friendly and secure. While UA is rather new to the OPC world, its current implementation in this application benefits users who are attempting to establish remote connections between a server and its clients. For more information about OPC UA, refer to the OPC Foundation at /.。
基于OPC的多客户端与WINCC的数据通信

中 图分 类 号
T 8 3 . H 6 2
文献 标 识 码 A
文 章 编 号 1 0 —9 2 2 1 ) 10 3 -3 0 0 3 3 ( 0 2 0 - 1 30
随 着工 业 控 制 系统 设 计 的 发展 , 态 软 件 在 组
摘 要 为使 人 机 交 互 与控 制 功 能 更 好 地 相 结 合 , 用 O C技 术 实现 MAT AB与 WI C 的 数 据 通 信 。 采 P L NC
通 过 开发 试 验 平 台 , 证 了 多 个 MA L B作 为 客 户 端 与 WI C 验 TA N C的 数 据 交 换 , 在 MA L B下 先 进 控 制 和 TA 算 法 的 实 时性 , 分 发 挥 M T A 充 A L B的 强 大 数 值 处 理 能 力 和 WIC N C人 机 交 互 的 特 点 。
访 问 ( s r a D t A cs, D 规 范和 报 警 及 Hioi l a ces H A) t c a
生 产过 程 中得 到 广 泛应 用 , 以及 企 业 信 息 管 理 的
升级 , 不能仅 使 用 一 套 组 态 软件 来 搭 建 完 整 复 杂 的工 业 系 统 … 。MA L B是 工 程 计 算 和 数 据 处 TA 理 能力 很强 的一 款 软件 , 提供 了开 放 的各 种 应 它 用 程序 接 口, 够 有 效 实 现 先进 控 制 算 法 和 复 杂 能 控 制 系统 的仿 真建 模 , 而 MA L B不 能够 直 接 然 TA 与 现场 设备 进 行 数 据 通信 , 能执 行 实 时 性 操 作 不 和 控 制 , 而 制 约 了其 可使 用 范 围。O C是 基 于 进 P 微 软 WI D WS操 作 平 台 中 O E( N O L 当前 的 A t e c v i X) C M( 件 对 象 模 型 ) D O 分 布 式 组 件 、O 组 和 C M( 对 象 ) 术 , 以实 现 不 同 硬 件 设 备 和 应 用 程 序 技 可 之 间 的通 讯 接 口标 准 。基 于 Cin S re 模 型 , l t evr e/ O C为 工业设 备 与应 用程 序之 间提 供 了具有 良好 P 数 据 交互 功能 的软件 接 口。用户 可根 据硬 件 开发
OPC连接

两台带Wincc项目的计算机必须可以使用HTTP 访问这两台计算机。
1. 在WinCC OPC DA 客户机上的WinCC 项目管理器的浏览窗口中,单击“变量管理器”图标。
2. 从“变量管理器”的快捷菜单中选择“添加新的驱动程序”。
将打开“添加新的驱动程序”对话框。
3. 选择“OPC.chn”驱动程序并单击“打开”按钮。
将创建通道并在变量管理器中显示通讯驱动程序。
接下来通过OPC 条目管理器组态访问1 启用WinCC OPC DA 服务器的WinCC 项目。
在WinCC OPC DA 客户机上,从“OPC 组(OPCHN Unit#1)”通道单元的快捷菜单中选择“系统参数”。
将打开OPC 条目管理器。
2. 从选择对话框中选择用作WinCC OPC DA 服务器的计算机的名称。
单击“浏览服务器”按钮。
将打开“过滤标准”对话框。
3. 在“过滤标准”对话框中,单击“下一步->”按钮。
将显示“OPCServer.WinCC ...”对话框。
4. 在“OPCServer.WinCC ...”对话框中,选择WinCC变量,可以一次选多个。
单击“添加条目”按钮。
5. 如果已创建到WinCC OPC DA 服务器的连接,继续步骤6。
如果尚未组态连接,则会显示相应的消息。
单击“是”。
将显示“New Connection”(新建连接)对话框。
下图中已经建了一个“OPCServer_WinCC”。
点击“完成”。
6. 显示“添加变量”对话框。
在前缀域中输入一字符串,在后缀域中输入一字符串。
选择连接“OPCServer_WinCC”。
单击“Finish”(完成)。
7. 在“OPCServer.WinCC ...”对话框中,单击“<-返回”按钮。
单击“退出”关闭OPC 条目管理器。
使用OPCUA在两台PC间交换数据

使用OPCUA在两台PC间交换数据OPC UA(基于OPC Unified Architecture)是一种开放的、跨平台的、标准化的通信协议,能够进行工业自动化系统中的数据交换和通信。
使用OPC UA在两台PC之间进行数据交换,可以实现跨平台和跨网络的数据传输,实现异构设备之间的互操作性。
要在两台PC间进行数据交换,需要按照以下步骤进行操作:1. 安装OPC UA服务器软件:在每台PC上分别安装OPC UA服务器软件,比如常用的开源软件NodeOPCUA、Prosys OPC UA、Unified Automation OPC UA等。
安装完成后,配置服务器的基本信息,比如IP地址、端口号等。
2. 创建OPC UA数据模型:在服务器上创建OPC UA数据模型,定义数据的结构和属性。
数据模型的创建可以通过编程语言、OPC UA建模工具等方式进行,例如使用C#编写OPC UA服务器代码,或使用NodeOPCUA的建模工具创建模型。
3.配置OPCUA服务器:在服务器上配置OPCUA服务器,包括设置安全策略、用户认证、权限控制等。
这样可以确保数据传输的安全性和可靠性。
4.连接两台PC:在客户端PC上安装OPCUA客户端软件,连接到服务器上的OPCUA服务。
在客户端软件中,输入服务器的IP地址和端口号等连接信息,建立与服务器的通信。
5.读取和写入数据:通过OPCUA客户端软件,可以读取和写入服务器上的数据。
根据需要,设置合适的订阅和采样间隔,以实时获取数据。
6.处理数据:在客户端上,可以对获取到的数据进行处理、分析和可视化展示。
根据业务需求,可以将数据存储到数据库中,或发送到其他系统进行进一步处理。
7.错误处理和故障排除:如果在数据交换过程中出现错误或故障,需要进行错误处理和故障排除。
可以使用OPCUA提供的错误日志功能,分析错误日志以定位问题所在。
总结起来,使用OPCUA在两台PC间进行数据交换涉及安装和配置OPCUA服务器和客户端软件,创建数据模型,连接两台PC,读写数据,处理数据以及处理错误和故障排除。
使用OPCUA在两台PC间交换数据

使用OPC UA 在两台PC 间交换数据OPC UA 不需要使用DCOM 来远程连接。
防火墙配置简单化,完全消除了DCOM 配置时的问题。
OPC 通道本身不是一个产品,它要求在client 端和server 端都支持OPC UA 。
OPC UA server 打包在OPC DA 、native interface 、一些情况下在DDE server 中。
要使用OPC UA 实现远程连接只需做很少的配置。
OPC UA client 是一个驱动,能在其下添加其他的设备channel 。
*在下文中:“server PC ”指作为OPC UA server 端的PC 机“client PC ”指作为OPC UA client 端的PC 机系统结构图1、Security 设置1》 OPC UA configuration在server PC 端操作运行KEPServerEX5,在桌面右下角右键单击“”打开“OPC UA Configuration ”,选中标签“Trusted Client ”,如下图若是红色“X ”,则右键点击“trust ”再选中标签“Trusted Server”,像上图中一样查看。
然后单击“close”关闭。
2》交换证书(方法1)第一步:在server PC上操作,右键桌面右下角小图标——选择“settings”——弹出右下对话框。
选中标签“Configuration”,勾选“Allow runtime to……”单击“确定”。
打开防火墙,开端口。
“开始”——“运行”——“firewall.cpl”选中标签“例外”,其中单击“添加端口”,弹出下图对话框。
点击“OK”。
端口添加成功。
第二步:在client PC上操作运行KEPServerEX5,在桌面右下角右键单击“”打开“OPC UA Configuration”选中标签“Trusted Server”,单击“exchange”弹出下面对话框单击“”弹出下图,选中“Remote Machine”中server PC的机器名与server机器上开的端口号对应*注:如果找不到要远程连接的server PC机,可以直接输入做server的 PC的IP地址,例如在局域网内“192.168.0.111”出现下图:点击“ok”完成之后会弹出对话框“the exchange was successfully”。
如何通过OPC UA实现两台WinCC SCADA电脑间的客户端服务器通讯

如何通过OPC UA实现两台WinCC SCADA电脑间的客户端/服务器通讯?OPC UA(“开放平台通讯--统一架构”)是用于交换两台不同品牌设备或应用间数据的标准软件平台。
本常见问题详细描述了如何在两台运行WinCC SCADA的PC间配置OPC UA通讯以实现客户端服务器的应用。
运行WinCC组态软件的PC可以通过OPC UA服务器和OPC UA客户端实现通讯。
在通讯时,服务器和客户端需要交换安全认证证书,详细配置步骤如下:步骤1.在服务器的PC上启动WinCC Runtime。
2.在客户端的PC上打开WinCC工程的“变量管理”。
3.在工程向导中右键单击“变量管理”选项,在弹出菜单中选择“添加新的驱动”选择“OPC”。
图. 01OPC通道创建完成。
4.在工程向导中右键选择“OPC Groups...” 然后再弹出菜单中选择并打开“系统参数”。
图. 02打开“OPC条目管理器”界面。
5.点击“OPC UA服务器”按钮。
图. 03打开“添加OPC UA服务器”界面。
6.在“服务器信息”对话框中输入服务器的URL地址,格式为:"opc.tcp://[服务器]:[端口号]"。
其中,“[服务器]”中输入作为服务器的PC的IP地址;“[端口号]”中输入OPC UA服务器使用的端口号,默认端口是“4862”。
(如下图中所示)图. 047.在“安全性”对话框中,“安全策略”选择“Basic128Rsa15”,“消息安全模式”选择“签名和加密”。
(如上图所示,需要注意的是,设置为“无安全”也可以达到通讯的效果,但从安全角度考虑不推荐使用)点击“确定”关闭对话框。
8.在“OPC条目管理器”中选择新创建的OPC UA服务器选项。
点击“浏览服务器”按钮。
图. 05几秒钟后会弹出对话框,显示错误提示“此OPC服务器不支持浏览器接口!”点击“OK关闭提示框”。
图. 069.打开Windows浏览器访问WinCC的安装路径。
WINCC_OPC服务器配置

两台WinCC之间OPC通讯方法(WinXP)OPC客户端1、登陆计算机名及密码要与服务器端(OPCServer)一致.a) 如:用户名:administrator密码:12342、OPC客户端要与服务器端处于同一个网络。
a) 如:OPCServer IP:192、168、0、100b)如:OPClient IP:192、168、0、1013、关闭Windows防火墙或者在弹出Window安全警报Loaderfor WinCCdatamage中选择解除阻止.或4、运行DCNFG、EXEa)在弹出得组件服务右击我得电脑—〉选择属性->选择安全b)c)在访问权限中选择编辑限制d) ANONMOUS LOGON组中选中远程访问。
5、剩下得就就是在WinCC创建客户端项目。
效果如图:6、OPC服务器端1、登陆计算机名及密码要与服务器端(OPCClient)一致。
a)如:用户名:administrator密码:12342、OPC客户端要与服务器端处于同一个网络。
b) 如:OPCServerIP:192、168、0、100c)如:OPClientIP:192、168、0、1013、关闭Windows防火墙或者在弹出Window安全警报Loaderfor WinCC da tamage中选择解除阻止。
或4、运行DCNFG、EXEd) 在弹出得组件服务右击我得电脑->选择属性—>选择安全e)f)在访问权限中选择编辑限制g)ANONMOUS LOGON组中选中远程访问。
5、打开D配置。
如图:a)b)选择OPCEnum与OPCServer、WinCC项.c)d)点击右键选择属性e)f)点击安全添加Everyone用户-〉允许完全控制。
g)6、剩下得就就是在WinCC创建服务器端项目。
效果如图:OPC服务器配置(1)、copyall these you windows systemdirectory、For example:Copy opcproxy、dllc:\winnt\system32Copy opcn_ps、dllc:\winnt\system32Copyopc_aeps、dll c:\winnt\system32Copy opchad_ps、dllc:\winnt\system32Copyaprxdist、exec:\winnt\system32Copyopcenmu、exe c:\winnt\system32(2)、install the proxy dllsREGSVR32 opcproxy、dllREGSVR32 opcn_ps、dllREGSVR32 opc_aeps、dllREGSVR32opchda_ps、dllWindowsXP下OPC服务器D得配置:(1)在局域网中创建工作组(2)服务器得配置组态王通过网络OPC通讯时D配置说明文档1、概述组态王具有网络OPC功能,组态王与组态王之间可以通过网络以OPC方式进行通讯,同样其她OPCclient/OPCserver也可以通过网络与组态王之间以OPC方式进行通讯。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
如何通过OPC UA实现两台WinCC SCADA
电脑间的客户端/服务器通讯?
OPC UA(“开放平台通讯--统一架构”)是用于交换两台不同品牌设备或应用间数据的标准软件平台。
本常见问题详细描述了如何在两台运行WinCC SCADA的PC间配置OPC UA通讯以实现客户端服务器的应用。
运行WinCC组态软件的PC可以通过OPC UA服务器和OPC UA客户端实现通讯。
在通讯时,服务器和客户端需要交换安全认证证书,详细配置步骤如下:
步骤
1.在服务器的PC上启动WinCC Runtime。
2.在客户端的PC上打开WinCC工程的“变量管理”。
3.在工程向导中右键单击“变量管理”选项,在弹出菜单中选择“添加新的驱动”选择
“OPC”。
图. 01
OPC通道创建完成。
4.在工程向导中右键选择“OPC Groups...” 然后再弹出菜单中选择并打开“系统参
数”。
图. 02
打开“OPC条目管理器”界面。
5.点击“OPC UA服务器”按钮。
图. 03
打开“添加OPC UA服务器”界面。
6.在“服务器信息”对话框中输入服务器的URL地址,格式为:"opc.tcp://[服务
器]:[端口号]"。
其中,“[服务器]”中输入作为服务器的PC的IP地址;“[端口号]”中输入OPC UA服务器使用的端口号,默认端口是“4862”。
(如下图中所示)
图. 04
7.在“安全性”对话框中,“安全策略”选择“Basic128Rsa15”,“消息安全模式”选择
“签名和加密”。
(如上图所示,需要注意的是,设置为“无安全”也可以达到通讯的效果,但从安全角度考虑不推荐使用)
点击“确定”关闭对话框。
8.在“OPC条目管理器”中选择新创建的OPC UA服务器选项。
点击“浏览服务器”按
钮。
图. 05
几秒钟后会弹出对话框,显示错误提示“此OPC服务器不支持浏览器接口!”点击“OK关闭提示框”。
图. 06
9.打开Windows浏览器访问WinCC的安装路径。
(Win7系统的默认安装路径为:
"C:\Program Files (x86)\Siemens\WinCC")
10.在该路径下进入如下子文件夹"...\opc\UAWrapper\PKI\CA\rejected\certs".将安全认
证证书移动到"...\opc\UAWrapper\PKI\CA\certs"子文件夹下。
图. 07
11.重复步骤9。
12.在服务器PC上访问WinCC的安装目录。
13.访问子文件夹"...\opc\UAServer\PKI\CA\rejected\certs"。
移动安全认证证书
到"...\opc\UAServer\PKI\CA\certs" 子文件夹。
图. 08
14.在客户端PC上再次点击“浏览服务器”按钮。
15.打开“过滤条件”选项卡,设置变量的过滤条件后点击“下一步”按钮。
设置完成后
可以浏览服务器的变量管理列表。
配置OPC UA端口及安全设置
在上述操作过程中,步骤6所要求的数据储存在服务器PC工程文件的
"...\OPC\UAServer" 子文件夹下。
文件名为"OpcUaServerWinCC.xml"。
•服务器名称和端口信息可在“BaseAddresses”中设置。
•个人安全策略储存在“安全配置”参数中。
当配置文件的“Enable”值为“True”时允许修改。
•安全策略中的安全模式参数存储在“信息安全模式”参数中。
图. 09
检查与OPC UA服务器的连接
“此OPC服务器不支持浏览器接口”错误提示说明客户端/服务器认证证书没有交换,或无法访问指定WinCC服务器,用户可以使用“telnet”工具检测OPC连接是否被成功创建。
打开Windows输入命令,键入命令行“telnet [server] [port]”测试。
相关参数参见步骤6。
“无法创建与主机的连接...连接失败”错误提示说明无法访问OPC UA服务器电脑,请检查服务器电脑的IP地址或端口号设置。
同时需要保证防火墙没有屏蔽客户端与服务器间的通讯。
注意
•正确使用OPC UA服务必须安装WinCC连通性软件包授权。
•Windows默认没有安装"telnet"工具。
如果需要安装,需要进入电脑开始菜单打开控制面板,选择“程序和特性”选项。
点击“打开或关闭Windows选件”,在弹出列表中选择“Telnet Client”,则“telnet”功能启动。