16:42, EET
October 27, 2014
I use the code above:
TPsOPCServer* opcServer = new TPsOPCServer(NULL);
opcServer->Connected = false;
opcServer->Host = “OPCSERVER”;
opcServer->ServerName = “TestServer.1”;
opcServer->Connect();
std::cout << "CONNECTED!!!" <<std::endl;
opcServer->Disconnect();
The problem is when I assign the ServerName value an EOleSysError occurs. This kind of error can’t be catch in a try block and I don’t know why it occurs.
When I try to connect se server, an EPsOPCError occur with the message:
OPC Error in method IConnectionPoint.Advise
Code: 0x80070005 (Access denied.)
Details: No more info available
With the visual component I never have this kind of exception or error. This code is inserted in a console project with C++ Builder XE3
8:42, EET
December 21, 2011
Your client computer cannot access the OPCEnum service in the remote host. This service is used to convert the ProgId of the server (ServerName) to CLSID. If you know the CLSID, you can use that instead.
But better is to make sure that the remote computer enables anonymous access to the OPCEnum COM Server, via DCOM Configuration.
8:44, EET
December 21, 2011
8:58, EET
October 27, 2014
I try with the ClassID and the same EOleSysError exception occurs.
With the Prosys Client and other clients I don’t have any problem. Also this problem is not present when I use the TPsOPCServer object in a windows application. So I think that a problem is there when using this object in a non windows application and also I don’t know why.
Also I can`t catch this exception and I don’t know why.
10:44, EET
December 21, 2011
Hmm, OK, I did not understand that it’s a console application.
COM initialization is done differently, if you don’t have the Application instance as is the case with Windows applications
There are some instructions at (see the “For UI-less console applications” part at least)
http://www.techvanguards.com/s…..client.asp
although I am not sure how up to date that is in regard the modern Delphi releases (since the article is from 2002).
You will also need to process the windows message queue to get callbacks through – or just try to work with synchronous groups/connectors only.
All in all, I am not fully aware how to get the OPC client to work in a console application.
14:39, EET
October 27, 2014
In fact in a DLL, the application instance exists. So I still not understand why it’s not working correctly.
I think you might consider to try, as the software editor, to make a working sample of an OPC client DLL whith the Sentrol SDK.
If I archieve on correct solution, I will send you the code for tutorials purpose for the SDK.
Most Users Ever Online: 1919
Currently Online:
19 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 144
rocket science: 88
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 726
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1529
Posts: 6471
Newest Members:
gabriellabachus, Deakin, KTP25Zof, Wojciech Kubala, efrennowell431, wilfredostuart, caitlynfajardo, jeromechubb7, franciscagrimwad, adult_galleryModerators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1032, Jimmy Ni: 26, Matti Siponen: 349, Lusetti: 0
Administrators: admin: 1