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
Register OPC Server created with OPCProvider
July 15, 2015
16:23, EEST
Avatar
SoDaCoDa
Member
Members
Forum Posts: 5
Member Since:
July 15, 2015
sp_UserOfflineSmall Offline

I’m working on creating an OPC Server using the PsOPCProvider component. I’m using XE7 C++ Builder. I have created an executable that instantiates an OPCProvider and adds several tags to it. But when I have it running, Prosys OPC Client does not list it as an available OPC server. What steps are necessary to make it visible?
(I tried regsrv32 but it complained about missing entry point DllRegisterServer. I also tried running the executable from an elevated command prompt with the /regserver argument.)

July 16, 2015
7:42, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 914
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

SoDaCoDa said
I also tried running the executable from an elevated command prompt with the /regserver argument.

That should do it. Unfortunately, there is no feedback whether it succeeds or not. But you can try to search for the CLSID in the registry after that to see if it worked properly.

July 16, 2015
19:42, EEST
Avatar
SoDaCoDa
Member
Members
Forum Posts: 5
Member Since:
July 15, 2015
sp_UserOfflineSmall Offline

To be clear, no, it does not work. I did search the registry and can’t find the CSLID that I specify in the code.

Turns out that after running the following lines of code:

TPsOPCProvider *EMSOPC;
EMSOPC = new TPsOPCProvider;

that EMSOPC is NUILL. The app compiles and links without errors. Not sure what is going on there.

I do get an error when I start the IDE that says ‘Can’t load package C:\Program Files (x86)\Prosys\Sentrol660DCXE7Ev…\SentrolStdIBX210.bpl. %1 is not a valid Win32 application. Do you want to attempt to load this package the next time a project is loaded? (I always answer yes so the reference isn’t removed.)

The file does exist at that location. This is a processor_architecture = AMD64 box (actually a VMware Workstation virtual machine running Windows 7).

Could that error be causing the issue with the code?

I see some other forms of weirdness also. When I build the Tutorial8 code and run it, the Prosys Sentrol splash screen comes up and when I click on OK it throws an access violation (write of address 00000060). Probably because of a null pointer. It is hard to tell because it seems like breakpoints don’t work right after that splash screen comes up. At least it doesn’t stop on the first line of code (the one that calls CreateMyOPCProvider) in WinMain. Or the violation happens before it even gets that far.

I can get Tutorials 1 through 3 to build and run without issues. Tutorial 4 gives me an error about Class TDatabase not found. 5, 6, 7, and 9 all work fine also. But of course, since I’m interested in building an OPC Server, I am most interested in Tutorial 8.

I look forward to your input. Thanks.

July 16, 2015
20:50, EEST
Avatar
SoDaCoDa
Member
Members
Forum Posts: 5
Member Since:
July 15, 2015
sp_UserOfflineSmall Offline

Update:
I have BCB6 and XE7 installed on the same machine so I think I was running into some cross referencing there. I uninstalled all Sentrol components and tutorials and then installed just the XE7 ones and Tutorial 8 builds and runs fine now. I am still curious about how that error might be affecting me, if at all.

July 16, 2015
20:59, EEST
Avatar
SoDaCoDa
Member
Members
Forum Posts: 5
Member Since:
July 15, 2015
sp_UserOfflineSmall Offline

Update:
Also, when I run the executable with the /regserver command line parm, it does successfully register and it does show up in the client. So I have somewhere to start from now.

July 17, 2015
8:03, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 914
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

SoDaCoDa said

Update:
Also, when I run the executable with the /regserver command line parm, it does successfully register and it does show up in the client. So I have somewhere to start from now.

Great! Good to hear that you got it working.

The error that you see related to SentrolStdIBX is caused by the fact that you don’t have IBX-components available. If you don’t even intend to use IBX for database connections, you can ignore the warning and even say that no, you don’t want to load that package the next time.

Tutorial 4 also depends on the database drivers. Database is a component of BDE. Embarcadero has been dropping support for BDE, and it wasn’t available in XE7 by default any more. You can, however, install it later, if you need them: http://support.embarcadero.com…..icle/44082 The Storage/Database part of Sentrol does not affect the OPCProvider by any means, so this is probably also irrelevant to your application.

July 17, 2015
16:28, EEST
Avatar
SoDaCoDa
Member
Members
Forum Posts: 5
Member Since:
July 15, 2015
sp_UserOfflineSmall Offline

Thank you for clearing that up. I do have a couple of other questions.

In Tutorial 8, the OPCProvider is set up before the Application-Initialize is done. Is this a requirement?

How would I change the value of tags from a separate thread when the OPCProvider and the tags are set up in the main GUI thread?

Can I set up the OPCProvider within the thread code instead?

And what is the purpose of the ComServer->UIInteractive = false; line in WinMain in Tutorial 8? Are the Sentrol components based on the Delphi COM controls? Where does that ComServer object get created?

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 267

Currently Online:
9 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 111

pramanj: 86

ibrahim: 74

kapsl: 57

gjevremovic: 49

Xavier: 42

TimK: 41

fred: 41

Fransua33: 39

rocket science: 36

Member Stats:

Guest Posters: 0

Members: 1590

Moderators: 17

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1192

Posts: 5057

Newest Members:

warnerfleming, Raymond23Freex, Charles1UsadY, Robertvem, albertinaduff53, wilbertrignall, Rogerbeedo, letamunn4183992, Lizazooda, Hectorner

Moderators: Jouni Aro: 914, Otso Palonen: 32, Tuomas Hiltunen: 5, janimakela: 0, Pyry: 1, Terho: 0, Petri: 0, Bjarne Boström: 695, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 24, Teppo Uimonen: 21, Markus Johansson: 36, Niklas Nurminen: 0, Matti Siponen: 161, Lusetti: 0

Administrators: admin: 1