16:23, EEST
July 15, 2015
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.)
7:42, EEST
December 21, 2011
19:42, EEST
July 15, 2015
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.
20:50, EEST
July 15, 2015
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.
8:03, EEST
December 21, 2011
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.
16:28, EEST
July 15, 2015
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?
Most Users Ever Online: 1919
Currently Online:
88 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