Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Problems accesing OPCProvider remotely
May 26, 2015
9:48, EEST
Avatar
Fransua33
Member
Members
Forum Posts: 39
Member Since:
October 27, 2014
sp_UserOfflineSmall Offline

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.

May 26, 2015
12:19, EEST
Avatar
Fransua33
Member
Members
Forum Posts: 39
Member Since:
October 27, 2014
sp_UserOfflineSmall Offline

In new test (creating OnActivate and OnConnect events) I can see that in the remote computer, the TPsOPCProvider doesn’t enter in the OnActivate event.

Then I can connect with an OPC client locally but not remotely.

Is the problem related to the Initialize method?

May 26, 2015
14:37, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 851
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

This sounds like a DCOM configuration problem. Check that both connect and activation permissions are enabled to the server.

https://www.google.com/search?q=dcom%20configuration

May 27, 2015
11:45, EEST
Avatar
Fransua33
Member
Members
Forum Posts: 39
Member Since:
October 27, 2014
sp_UserOfflineSmall Offline

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?

May 27, 2015
14:53, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 851
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

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.

May 27, 2015
15:07, EEST
Avatar
Fransua33
Member
Members
Forum Posts: 39
Member Since:
October 27, 2014
sp_UserOfflineSmall Offline

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.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 267

Currently Online:
8 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 103

pramanj: 86

ibrahim: 70

kapsl: 57

gjevremovic: 49

TimK: 41

Fransua33: 39

fred: 38

Rainer Versteeg: 32

Thomas Reuther: 31

Member Stats:

Guest Posters: 0

Members: 1105

Moderators: 14

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1009

Posts: 4268

Newest Members:

user1290, gregp, mariohetheringto, normagalindo47, aurelia27u, isobel41d356980, michaeldegli, gqbdolores, kez1399, jaclynmcvay358

Moderators: Jouni Aro: 851, Otso Palonen: 32, Tuomas Hiltunen: 5, janimakela: 0, Pyry: 1, Terho: 0, Petri: 0, Bjarne Boström: 545, Heikki Tahvanainen: 402, Jukka Asikainen: 1, Teppo Uimonen: 20, Markus Johansson: 19, Matti Siponen: 53, Lusetti: 0

Administrators: admin: 0