SoftingIndustrial / OPC-Classic-SDK

Softing OPC Classic SDK
https://industrial.softing.com/de/produkte/opc-ua-und-opc-classic-sdks.html
MIT License
53 stars 22 forks source link

Run OPC DA server with C++ #14

Open HovoApoyan opened 2 years ago

HovoApoyan commented 2 years ago

I have some questions about the OPC DA server.

  1. Has anyone run the DemoServer with C++, from the samples?

I'm build OPCToolbox_VS2019.sln, get the corresponding .libs for DemoServer, then I try to open DemoServer_VS2017.vcxproj and run it, I'm set the already built files to the project linker (path and dependencies). image image

but I get a linker error

image

  1. Has anyone run the other samples, it is possible?
  2. Finally, is this project free or not?
ro0ter commented 2 years ago

Hi there,

Captain here:

  1. Just try to build both TBC and the C++ sample you would like to run with the same Visual Studio version. Your problems will magically disappear ,-)
  2. Everything works. Trust me.
  3. Can't advise you regarding the legal aspects. Please check the licence type and contact the owner.

Regards!

HovoApoyan commented 2 years ago

Thanks for the feedback,

what do you mean to build both TBC?

I also tried to build OPCToolbox_VS2017.sln (in order to run with the same Visual Studio version), and get this link error. image

from OPCToolbox_VS2017.sln OTB_VS2017 could not create the OTBD.lib file, and accordingly OPCToolboxC++_VS2017 cannot open the OTBD.lib file. Magically appear new problem ))

ro0ter commented 1 year ago

TBC = OPC ToolKit C++ API (TBC actually means [OPC] ToolBox for C++... the first name of the C++ API)

Please mind the paths.

And yes, both the release and the debug versions of the TBC use the OTBd for importing symbols (debug version).

In order to correctly build the TBC, you would need to first build the TK CORE. The ToolKit CORE (OTB) API is C++, so there's no preference for the Visual Studio you use. Only make sure you use a Visual Studio that supports 64-bit compiling if you would like to build the TBC on 64-bit as well.

Rule of thumb for the linker (32-bit example below): TBC < OTBd TBCd < OTBd TBCu < OTBud TBCud < OTBud u = Unicode version d = Debug version For 64-bit, append x64 to all of the above.

Please read the help file, there are sections in how to build the TK CORE (OTB), TK aPI (TBC/TBN) and samples. Compile it with SandCastle - maybe https://github.com/EWSoftware/SHFB works.

Mind x64 vs x86 when registering C++ OPC servers and the systems preference in case the same server name is registered for both x64 and x86.

NEVER EVER EVER EVER use JIT-architecture switching (AnyCPU) for .NET OPC servers.

ro0ter commented 1 year ago

Hello @HovoApoyan , can you please update us on your progress?

HovoApoyan commented 1 year ago

Hi @ro0ter, I stopped working on this project. Thanks for some help.