9:48, EEST
October 27, 2014
Hi,
I code an OPC Server using the TPsOPCProvider object in C++ Builder. In local all works fine. I can acces the OPC Server and all my OPC vars.
The problem it’s when I try to access the server remotely. I compare to access to the server (one wich gone ok and my fail access) using a sniffer. The connection to the host is OK but when I connect to the OPC server, the computer send a RemoteCreateInstance request but the server never responds to that request.
I hope you can helpme through this troubleshoot.
Best regards.
12:19, EEST
October 27, 2014
14:37, EEST
December 21, 2011
This sounds like a DCOM configuration problem. Check that both connect and activation permissions are enabled to the server.
11:45, EEST
October 27, 2014
I think I found the problem… In my server I recover datas from my database. The connection use ADOConnection (using dbGo) to provide datas.
Is it posible that the database conection interact with the provider DCOM object and make the provider to function incorrectly?
I try my code without databse access and it work fine!!!!
So how can I access my database without troubleshooting my provider?
14:53, EEST
December 21, 2011
Yes COM has a limitation that while handling another COM call, you cannot make another COM call. So you will need to make a thread switch between the request coming from the server and the database request.
But, I am not sure if I really understand your problem at the moment, so I cannot really tell you either how to solve it at the moment. Maybe if you show me some part of your code, it will be easier to understand.
15:07, EEST
October 27, 2014
Before this piece of code I create and initialize the provider. In this function I create the server variables:
void CreateSpOPCProviderTags(TStringList* jobs, TMain* main) {
//We generate the tags depending on the SQL data
opcProvider->AddressSpace->AutoAddApplication = false;
opcProvider->AddressSpace->AutoUpdate = false;
opcProvider->AddressSpace->IncludeProps = false;
//we recover the affected machines
DAOConfiguration* daoConfig = new DAOConfiguration();
TStringList* machines = daoConfig->getMachinesActives(jobs);
//The TADOConnection and TADOQuery are deleted => COM object dead
delete daoConfig;
daoConfig = NULL;
//We create the OPC server tags for every machine
for (int i=0; i Count; i++) {
int index = opcProvider->AddressSpace->AddModule(main, -1, “TEST1”, false);
if (index != -1) {
TPsBool* var1 = new TPsBool(NULL);
var1->Value = false;
TPsInteger* var2 = new TPsInteger(NULL);
var2->Value = 123;
TPsString* var3 = new TPsString(NULL);
var3->Value = “Test serveur OPC”;
opcProvider->AddressSpace->AddVariable(index, var1, “VARTEST1”);
opcProvider->AddressSpace->AddVariable(index, var2, “VARTEST2”);
opcProvider->AddressSpace->AddVariable(index, var3, “VARTEST3”);
} else {
ShowMessage(“Can’t create root node for ” + machines->Strings[1]);
}
}
}
With this code I can access my OPC variables through an OPC client locally but not remotely. If I delete the piece of code concerning the database access, I can access in both mode, locally and remotely.
Most Users Ever Online: 1919
Currently Online:
23 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: 749
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1529
Posts: 6471
Newest Members:
scvchad954, misty3446453365, KelsonzFu, Kelsonz, lienbelisario, erick34s63346, Kaitlyntvsl, lonaerskine7, KTP21ideft, GeorgecotagModerators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1032, Jimmy Ni: 26, Matti Siponen: 349, Lusetti: 0
Administrators: admin: 1