OPC Learning (1)

Source: Internet
Author: User

Find some OPC client and server demos on the Internet.

Write the OPC client to implement an OPC explorer.

First, you need to know the guid of those standard OPC interfaces. 1. You can download an OPC Core Components SDK from the OPC Foundation. msi, installation, after installation, although there is a "OPC foundationobject directory, but only a few documents, dllall is thrown to system32, such as opcenu,.exe, opcproxy. DLL, and then use Delphi's "Import Type Library... "function is imported into a * _ TLB. PAS. 2. Take the interface units organized by others directly.

How to list the OPC server installed on the local machine, one is to read the registry, and the other is to use opcenum.exe in OPC Core Components sdk.msi.

OPC calls the document item. The structure of the item includes a tree structure and a non-tree structure. You can view the structure implemented by OPC server through queryorganization of the iopcbrowseserveraddressspace interface. If it is opc_ns_hierarchial, the tree has branches, such as branch and leaf.

Item can be added to the group, then the group and item can be activated, and a callback interface is provided. The OPC server checks whether the data changes according to the scanrate set by your group, and sends the data if the data changes.

Test shows that different OPC servers implement different levels and degrees. Generally, OPC Explorer can only add leaf to a group, but does not support adding branch to a group, most OPC servers follow this principle, but some OPC servers are innovative. For example, if a Keba controller is used as a function, branch writes any value to branch, it is equivalent to calling a function, and then there are in and out sub-branch under this branch, then the leaf under out can read the value returned by the function. A little creative; otherwise, the general practice is to use custom interfaces, but in this way, OPC Explorer cannot automatically discover these interfaces and functions based on OPC rules.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.