opc core coreuicomponents.dll 收费吗

GE India Innovation Center
Suchit is an Architect at GE India Innovation Center, Hyderabad.
He architected and developed portions of Proficy RX, a Process Analytical Technology (PAT) Solution of GE Fanuc Intelligent Platforms.
He also is the Architect of OPC Server for hardware devices of . These devices sense temperature, humidity, combustibles, fluid flow, pressure and various engineering parameters - primarily used in Industrial Automation & Process Control applications.
Interests: Computer Graphics, Mathematical Modeling, Scientific Applications Development.
He lives in Hyderabad India with his wife and 2 . Loves reading books if these 2 small buddies allow him to.
Homepage :
Comments and Discussions
Message Closed
I would like to know more about using CPX items and how to implement them for User Defined Types UDT's .. any information how to do this would be appreciated.
Hi Suchit,
I enjoied reading your article, thanks for that!
I have a question regarding OPC network layers respect to ISO OSI Reference Model
I couln't find anything in the net in this regard
I mean something like following link for CAN BUS:
or for PROFINET:
or other fieldbuses:
for OPC, I have just found following stack overviews:
so my question is:
is OPC (Classic/UA) not following ISO OSI model?
We are trying to make an OPC Server which includes a huge address space using a huge structure of objects and levels.
The problem is the following: when the SCADA tries to connect in order to read only one specific tag... the OPC Server expends around 47 minutes to serve the value, due to it needs to create the entire address space first.
My question is... Could we create the address space dynamically? But without any side effect like forcing the clients a re-connection.
I have read this option about how to create the address space:
- Automatically configured on the fly by an ‘intelligent’ server based on the names of the data items the client applications are currently requesting.
Which is in this link:
Thanks!modified
28-Nov-14 2:40am.
For advanced examples, you can visit
You can use it on C# or Visual Basic. Each component is OPC DA Client.
You don't need to write any code these controls, you can do everything (Read, Write, Connect OPC, etc.) automatically.
An interesting article.
I have alot a lot of autmation exeprience and have developed serveral C# solutions to talk to OPC Devices. In fact recently I build a solution to talk to a Kepware Server.
I have been asked to look into developing our own OPC Interface. We have a logger which logs data to a propritory database.
Some of our customers use a SCADA package and they have asked if we could expose this data through OPC.
In fairness this is not something we have done.
I was wondering if you could give me any guidance to where to start investigating this.
Hello , I liked the Article, and I find myself wanting more information where I am able to get it - even if I do not belong to the OPC Foundation.
I would like to have more info on OPC UA servers and Clients - especially code implementations examples. I know some 3rd parties place their examples which rely on their libraries - but I am looking for clean examples of how this is done. I have found a XML-DA client sample - but nothing using UA - I think that from my reading UA is the best option at this juncture. While others will work, UA allows flexibility for platform changes.
Hi...i hope you can help me!!...first of all my English is not the best...
Well I have an application that has its own OPC Server, and I want to make another application that can read some values fron that OPC server...what do I need to do it...I mean, I know VB .NET but I dont know how to read values from that propietary OPC Server..
Hello Joseji,
You will need to write a Client Application in VB.NET to read from OPC Server. The client application must follow OPC protocol and thereby it will be called OPC Client. Without OPC there is no direct way to read from OPC server.
There are several OCP Client codes available for your reference on the web. Google for it.
Best Regards,
Here is a simple , using a commercial OPC client library,
simple and good explanation
Thanks NMT!
Appreciate it!
Hi Suchit..
I am writing DA Server as an alternate DA server in place of standard DA server for serving my HDA Client.It will accept all of its calls(AddItems,AddGroup etc)as mimic and stub applications. I have employed a thread which will provide (it will call client's OnDataChange) hard coded data to it.
I am having exception in AddItems, while calling AddItem(AddItem will be called by the client(HDA) and instead of actual DA server's AddItems, it will call this mimic or stub AddItem) I am allocating memory from CoTaskMemAlloc for Errors and Results Array.But when call returns after returning S_OK, it generates exception.
HRESULT STDMETHODCALLTYPE CCOPCFooler::AddItems(
/* [in] */ DWORD dwCount,
/* [size_is][in] */ OPCITEMDEF *pItemArray,
/* [size_is][size_is][out] */ OPCITEMRESULT **ppAddResults,
/* [size_is][size_is][out] */ HRESULT **ppErrors)
//Causing here exception at following lines of codes..
*ppAddResults = (OPCITEMRESULT*) CoTaskMemAlloc(sizeof(OPCITEMRESULT) * dwCount);
*ppErrors = (HRESULT*) CoTaskMemAlloc( sizeof(HRESULT) * dwCount);
for(DWORD i = 0;i&dwCi++)
(*ppErrors)[i] = S_OK;
(*ppAddResults)[i].vtCanonicalDataType = VT_R4;
(*ppAddResults)[i].hServer = m_handleGenerator++;
}//end of for
HRESULT hr = S_OK;
Making it assure that memory is freed by client from CoTaskMemFree.
Still causing exception....?
Usmanmodified on Friday, February 26,
Hello Suchit,
I am trying to convert a list of Strings in LPWSTR* array which I would be using to pass more than one items in GetItemHandles(). I am using the following way to convert it. But here the problem occurs in the returning array items. It contains all the elements same in the array. I found the problme is due to memset() which updates the memory address everytime same as
earlier. Please help me out----
//itemIds are coming as input and they are list of Strings
for(DWORD i = 0; i & itemIds-&C i++)
ATL::CComBSTR itemWC
itemWChar = ::GetAtlBstr(itemIds[i]);
WCHAR _itemWChar[_MAX_PATH];
memset(_itemWChar, 0, sizeof(_itemWChar) / sizeof(_itemWChar[0]));
memcpy(_itemWChar, static_cast&bstr&(itemWChar), itemWChar.ByteLength());
items[i] =
ANURAG VISHNOI,
Sr. Software Engineer,
I have few questions regarding the implementation of OPC with C#...How to connect with this?What are the things that I need to download for me to connect with OPC and C#?
I don't know yet on how to implement OPC...
Thank you in advance...
I want to explore all the OPC servers installed localhost/remot machine. Please assist me which all APIs are required. Or please let me know about sample source code links.
Hi Suchit,
Its a great article u have written for all the guys who r new to OPC technology. Hats of for that..
I m currently developing an OPCHDA client for one of my application. i have written two application one in UNICODE env and other in ASCII (MBCS) env. the broiler code that i wrote in UNICODE application runs fine for connecting to a HDA server, gets Item Handles successfully and also reads HDA tags value successfully (sync read). In my ASCII application, connection is made successful to HDA server. The COM call for GetItemHandle (OPCHDA specification 1.2) is also successful. But after that when i make sync ReadRaw call, it always fails. The error code tells that there is an INVALID arg passed. here is the snapshot of the code:
// Variables
DWORD dwTransactionID;
DWORD dwCancelID;
HRESULT* pErrorsAsyncR
OPCHDA_TIME* phtStartT
OPCHDA_TIME* phtEndT
DWORD dwNumV
DWORD dwNumI
OPCHANDLE *phS
OPCHDA_ITEM *pItemV
HRESULT* pE
HRESULT* pErrorsR
OPCHANDLE hC
HRESULT hrR
// Initializations
dwCount = 1;
dwNumValues = 0;
hClient = 0x001;
bBounds = FALSE;
dwNumItems = 1;
dwNumValues = 1;
// Allocating and assigning the time stamps
// for which the historical data is to be requested
phtStartTime = new OPCHDA_TIME[dwCount];
phtEndTime
= new OPCHDA_TIME[dwCount];
phtStartTime-&bString = TRUE;
// WCHARFromCHAR function converts a char string into wchar string
WCHAR* cStrtTm = WCHARFromCHAR(oTagDetails.cStartTime);
// wstrGlobalDupl function does mem allocation using CoTaskMemAlloc
for wide string
phtStartTime-&szTime = wstrGlobalDupl(cStrtTm);
phtStartTime-&ftTime.dwHighDateTime = 0;
phtStartTime-&ftTime.dwLowDateTime = 0;
phtEndTime-&bString = TRUE;
WCHAR* cStopTm = WCHARFromCHAR(oTagDetails.cStopTime);
phtEndTime-&szTime = wstrGlobalDupl(cStopTm);
::GetSystemTimeAsFileTime(&(phtStartTime-&ftTime));
Sleep(10000);
::GetSystemTimeAsFileTime(&(phtEndTime-&ftTime));
LPWSTR pszItemID;
WCHAR* cStopTm = WCHARFromCHAR(oTagDetails.cTagName);
pszItemID = wstrGlobalDupl(cStopTm);
// Get the server handle for this item
hr = m_pAtlHDAServerPtr-&GetItemHandles(dwCount,
&pszItemID,
&phServer,
&pErrors);
// Making an synchronous advise call to the OPC HDA server
hrRead = pOPCHDASyncRead-&ReadRaw(phtStartTime,
phtEndTime,
dwNumValues,
dwNumItems,
&pItemValues,
&pErrorsRead);
Can u suggest me or refer any HDA client side code that can help me overcoming this hurdel.
Thanks in advance
Jitendra Mitra
hi suchit..i got the solution..
Feasibility studies for OPC Server implementation in Linux, reveals EntireX DCOM and OPC UA as possible solutions.(Lets keep apart UA).
As I hope all the SDKs available provides APIs(DLLs), that internally takes care of COM and OPC implementations. So they makes sense for COM based OPC servers development.
Now, for the sake for OPC server development in linux,does it makes sense to isolate OPC requirements(specifications) and COM dependency. To put in simple terms, Shall I implement the interfaces that OPC demands seperately and then replace COM by some other communication methodology. And then claim it as OPC compatible.
If so, how to go about OPC requirements implementation, are there any SDKs?
How should be a OPC server architectured?
As per my unserstanding, OPC server has two basic entities viz.,
Device driver:
Which speaks to device, using a standard protocol like Modbus or TCP/IP or even proprietary.
OPC Server:
Which picks the data from driver and makes it available for the client.
If the above said is true,
1. How should OPC server be interfaced to driver?
(Are the commercially available SDKs meant for this?)
2.Does OPC classify devices into types?
(Electrical, Automation, etc., or something like that)
1. How should OPC server be interfaced to driver?
(Are the commercially available SDKs meant for this?)
This is pretty much specific to a particular OPC Sever implementation. If you have the code for OPC Server, you will have to implement calls to specific device drivers in the places where initialization happens, reading/writing happens, and where disconnection happens. I doubt if there are any ready-made tools for interfacing any generic driver to any OPC server.
2.Does OPC classify devices into types?
(Electrical, Automation, etc., or something like that)
No. OPC Does not have any implicit classification method.
You can manage "Logical" classification through use of OPC Groups. You can have some predefined groups in your Address Space Hierarchy. And then populate your device reading parameters or the sensors information under appropriate branch.
Thanks for your reply. I've few more questions which I shall start as new thread.
Can any one please help me out to understand the concept of communication
between OPC Client and Server as i need to develope an OPC Client in Java... and one more thing that can any one please help me out to find out some documents for developing OPC Client in Java
OPC Server is a COM Server. So basically your Java application will need to understand COM - you can use JNI or related commercial products that will your Java application a COM awareness. And then see the figure above that documents the steps involved in building up Server-Client communication channel and reading writing items ..
I'm using OPC Core Components 3.0 and using OPC DA Sample Client.
If I connect to sample server, it's ok. But if I connect to
remote machine (CoDeSys.OPC.02), I get an error message :
"...HRESULT : 0x (E_NOINTERFACE)...".
I don't know what is that.. But something is weird.
If I use another OPC Client Tool, it's ok, without error.
I can read all OPC variable.
Are there something wrong in OPC Core Components or
OPC DA Sample Client ?
I suspect it to be DCOM issue.
The OPC Connections over network happen over DCOM. DCOM needs to be configured specifically if you are using Windows XP SP 2. The Service Pack 2 of Windows XP, has to be enabled for a TCP/IP Port 165 for DCOM to work properly.
Follow the guide lines mentioned by OPC Foundation to get this DCOM and OPC working properly.
Let me know if the issue persists, even after you have made these changes.
Both PCs are Windows 2000 without firewall. The server is CoDeSys.OPC.02 and the client is OpcDaSampleClient.
Both PCs have the same username and same password under same workgroup.
If I try to connect to server using OpcClient.exe (windows app without .NET), it works.
But if I try to connect using OpcDaSampleClient (.NET), it fails to connect.
The error message is:
Unable to cast COM object of type 'System.__ComObject' to interface type 'n.IOPCServerList2'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{9DD0B56C-AD9E-43EE-8BF7A}' failed due to the following error: Schnittstelle nicht unterstützt (Exception from HRESULT: 0x (E_NOINTERFACE)).
Somewhere in google.. , I just found, that cast from ComObject to IOPCServerList2 is working only in C++ but not in C#. Do you know something about this ?
Do I need to have the same version of OPC Core Components in Server and Client ?
The next thing I want to do is try to update the OPC Core Components.
Ok.. I just solve it. I install also the latest OPC Core Component in Server and Client.
It works...
i am currently using the IOPCBrowseServerAddressSpace::BrowseOPCItemIDs call to achieve this, is there any better way to do this...
How is IOPCBrowse different from this?
Thanks in advance.
IOPCBrowse interface provides improved methods for browsing the server address space and for obtaining the item properties. The methods in this interface are designed to mirror the corresponding methods in the XML-DA interface.
IOPCBrowseServerAddressSpace interface is deprecated. Meaning, legacy usage might persist. However, if you are writing new applications, you should avoid using it. Prefer IOPCBrowse instead.
Hope this helps.
You have mentioned that OPC supports interoperablility between Unix/Linux and windows. How is it done? Can we implement COM interfaces in Unix?
Your post actually has two distinct questions.
OPC interoperability across platforms is in the form of OPC UA. OPC Unified Architecture is SOA based. That means the applications written across Windows and Unix can utilize OPC functoinalities through Web Services.
Coming to COM on Unix, There are implementations of COM see for your reference "EntireX" under UNIX. This helps extend OPC on Unix.
In either of approaches, considering future directions, the OPC UA is a better solution.
Hope this answers what you are looking for.
i've just a simple question for experts
How can I get an information from the server about specifacion version it is implemented?
Is there any informationstatus avaible by OPC Servers.
I think, this should be useful, to create an OPC CLient, who can work with DA2.0 and DA3.0 Server!
Thanks for the answers!
Hello Biasto,
I hope that should not too late to an answer...
In fact when you ask to OPCEnum (OPC Foundation component) an OPC List Server you can do it by specification (or category how is called).
When each OPC Server is registered it is mandatory to enter information about the specification (it is called Category registration CATID_OPCDAServer10 CATID_OPCDAServer20) it can deal. So when you run the client and ask to OPCEnum you can receive a list by category (it means by specification).
If you ask for an interface that the OPC Server do not support... you will receive an E_NOINTERFACE answer.
Best regards,
now I've just another question.
I've implemented for my client application the IOPCBrowse-methods for getting Properties and Item-information from the Server.
How does a 2.0 Server answer using this functions?
Has there anyone an intension?
Thank for all...
When OPC Client queries IOPCBrowse interface on a OPC 2.0 DA server, then E_NOINTERFACE error code will be received. E_NOINTERFACE means "No Such Interface Is Implemented in COM Server". Since OPC DA 2.0 specification does not have IOPCBrowse, and hence this is the expected outcome.
I've got the experiance to create a IEC-OPC-Interface for our process control tool.
So for this, it's needable to implement some OPC-Functionallity into our IEC-TOOL.
Therefore we used the Toolkit of Technosoftware, for creating the Client. But now, it's useful to implment also the Browse-Functionallity to our OPC-CLient.
For this, i've tried to initiate the IOPCBrowse-interface, which is given in DA-Specification 3.0.
But my VC++ 6.0 reports, he can't find the undeclared variable 'CoCreateInstanceEx'. Which header-files are missing, so this failure come up?
Perhaps anybode can help me ?
I've just find the fault:
For implementation of method 'CoCreateInstanceEx' it's necessary to implement / define preprocessor-hint ' #define _WIN32_COM ' at the beginning of the code. Therefore it must be declared before the headerfile objbase.h is implemented.
I ask you direclty a question because I do not know were found this information.
I am using a connection to a OPC server that is started from a application x. When my application start I connect me to the OPC server that this application propose. It works fine but my problem begin when the application x close then the server is not any more available. How to check if the server is running and shoul I CoUninitialize() and release()
Thank you for your help.
AutreChien
Hi AutreChien,
This is a generic problem of COM server life time validation. OPC Server being just another COM server, you can use the same technique as follows:
Call AddRef() on your OPC server interface. You can also use your any existing method calls made on IOPCServer interface.If this method call succeeds, then server is alive.If the method call fails, then the server is probably not alive or there is some communication error.The return code HRESULT can be looked into for more details.
Hey there Suchit. Would you be able to explain the difference between a Framed Message and an Unframed Message?
Thanks in advance
Hi Flippydeflippydebop,
Framing of messages is a generic concept. For example, in communications programming the messages are broken into a set of bits. A framed message looks like follows.
--------------------------------------------------------------
| StartBit | ParityBit | DataBit1 | DataBit2 | ... | StopBit |
--------------------------------------------------------------
The frames have logical meaning. They are parsed by teh receiver to extract actual data. In above case the actual data is (DataBits1.DataBits2...DataBitsN).
Unframed messages, for example, can be like socket communications where two applications are exchanging files. Where granularity is not defined at byte level. The entire file is the granule.
With regard to OPC there is no specification mention about Framed/Unframed messages. However, when OPC server talks to the actual device it might have to understand framed messages.
OPC Server
--------------------------------------------------------------
| StartBit | ParityBit | DataBit1 | DataBit2 | ... | StopBit |
--------------------------------------------------------------
The device also understands the framed messages. Rather it would not be completely wrong to say that on the physical layer of digitial communications all messages are Framed messages.
Hope that helps. But if there is anything more to it, please describe detailed context of your Framed/Unframed messages, that might help to get a better answer.
wow, thanks again for another exhaustive answer. - That clears things up. So a framed messgae contains header information wheras an unframed message is just the data. I have also come across the term "Deframing" which lends itself to what you have said.
thanks again Suchit.
I am new to this OPC Technology.
Can you please suggest any other your articles, which can explore OPC Technology in detail.
What are the steps needed for developing OPC Server ?
Refer to the links mentioned in "References" section in the article.
You may like to refine your understanding of COM programming model as well. Start with some good articles on CodeProject itself . Then you may also use .
There is a
Hope that helps.
Other web pages places that i have found are these:
- OPC technical overview
/cwc/gefanuc/products/automation/opchub_opc_data_access_presentation.html
- The Free OPC Server Toolkit
http://www.ipi.ac.ru/lab43/lopc-en.html
- Simple OPC Client tutorial with C++ example.
http://pgras.home.cern.ch/pgras/OPCClientTutorial/
Great article. i voted you 5.
Can you tell me how a DNP3 OPC server differs from a normal OPC Server?
thankyou in advance
DNP3 is Distributed Network Protocol for communications between electronic devices. [] OPC Standard is independent of device level communications standard. Rather whole purpose of OPC was to abstract the communications layer.
So an OPC server that supports DNP3 works as:
Client Applications
&===OPC Protocols (DA, XML-DA, ..)===&
OPC Server
&===DNP3 Protocol===&
DNP3-aware Devices
A DNP3 OPC Server has to implement DNP3 communications. And provide standard OPC interfaces to its clients. This is how all OCP servers written for various protocols behave.
Hope this helps. If you have any more specific doubts, do let me know.
flippydeflippydebop wrote:Great article. i voted you 5.
Thank you so much.
thankyou for your quick reply..
That clears things up. Cheers.
General &&
Suggestion &&
Question &&
Last Updated 18 Dec 2005
Article Copyright 2005 by .SuchitEverything else
Copyright & ,

我要回帖

更多关于 opc.ua.core.dll 的文章

 

随机推荐