VX Works Example Project/Documentation

Questions regarding the use of the C++ SDK for Server or Client development or integration into customer products ...

Moderator: uasdkcpp

Post Reply
dmiller
Sr. Member
Sr. Member
Posts: 13
Joined: 30 May 2013, 18:27

VX Works Example Project/Documentation

Post by dmiller »

Dear Support,

I wanted to inquire if Unified Automation had an example VxWorks project that goes with the C++ Toolkit. For example, a VxWorks project to complement the uademoserver. Additionally, any VxWorks specific documentation that gives information on workspace settings etc would be helpful as well.

Thanks

Dan

User avatar
Support Team
Hero Member
Hero Member
Posts: 3072
Joined: 18 Mar 2011, 15:09

Re: VX Works Example Project/Documentation

Post by Support Team »

Hi dmiller!

There is a new HowTo section, that describes compiling a Unified Automation SDK for vxWorks. See this page Compiling the SDK for vxWorks as Downloadable Kernel Module.

Best regards
Support Team

dmiller
Sr. Member
Sr. Member
Posts: 13
Joined: 30 May 2013, 18:27

Re: VX Works Example Project/Documentation

Post by dmiller »

Dear Support

Thanks for the document. This has helped get us further into the build process. I believe we have gotten cmake to build everything necessary and have imported the project into vxworks. I have executed the make and many items are building. However, I am getting the error message shown below. It appears to be the make file not being able to find the openssl libraries. Where am I suppose to put these libraries.

Thanks

Dan

[ 15%] Building C object uastack/CMakeFiles/uastack.dir/platforms/vxworks/opcua_p_internal.c.obj
[ 15%] Building C object uastack/CMakeFiles/uastack.dir/platforms/vxworks/opcua_p_memory.c.obj
[ 16%] Building C object uastack/CMakeFiles/uastack.dir/platforms/vxworks/opcua_p_openssl_3des.c.obj
C:/Tools/UAuto/src/uastack/platforms/vxworks/opcua_p_openssl_3des.c:31:25: error: openssl/des.h: No such file or directory
C:/Tools/UAuto/src/uastack/platforms/vxworks/opcua_p_openssl_3des.c: In function 'OpcUa_P_OpenSSL_3DES_Encrypt':
C:/Tools/UAuto/src/uastack/platforms/vxworks/opcua_p_openssl_3des.c:51: error: 'DES_key_schedule' undeclared (first use in this function)
C:/Tools/UAuto/src/uastack/platforms/vxworks/opcua_p_openssl_3des.c:51: error: (Each undeclared identifier is reported only once
C:/Tools/UAuto/src/uastack/platforms/vxworks/opcua_p_openssl_3des.c:51: error: for each function it appears in.)
C:/Tools/UAuto/src/uastack/platforms/vxworks/opcua_p_openssl_3des.c:51: error: expected ';' before 'ks1'
C:/Tools/UAuto/src/uastack/platforms/vxworks/opcua_p_openssl_3des.c:52: error: expected ';' before 'ks2'
C:/Tools/UAuto/src/uastack/platforms/vxworks/opcua_p_openssl_3des.c:53: error: expected ';' before 'ks3'
C:/Tools/UAuto/src/uastack/platforms/vxworks/opcua_p_openssl_3des.c:55: error: 'DES_cblock' undeclared (first use in this function)
C:/Tools/UAuto/src/uastack/platforms/vxworks/opcua_p_openssl_3des.c:55: error: 'desKey' undeclared (first use in this function)
C:/Tools/UAuto/src/uastack/platforms/vxworks/opcua_p_openssl_3des.c:73: error: expected expression before ')' token
C:/Tools/UAuto/src/uastack/platforms/vxworks/opcua_p_openssl_3des.c:76: warning: implicit declaration of function 'DES_set_key_unchecked'
C:/Tools/UAuto/src/uastack/platforms/vxworks/opcua_p_openssl_3des.c:76: error: 'ks1' undeclared (first use in this function)
C:/Tools/UAuto/src/uastack/platforms/vxworks/opcua_p_openssl_3des.c:77: error: 'ks2' undeclared (first use in this function)
C:/Tools/UAuto/src/uastack/platforms/vxworks/opcua_p_openssl_3des.c:78: error: 'ks3' undeclared (first use in this function)
C:/Tools/UAuto/src/uastack/platforms/vxworks/opcua_p_openssl_3des.c:81: warning: implicit declaration of function 'DES_ede3_cbc_encrypt'
C:/Tools/UAuto/src/uastack/platforms/vxworks/opcua_p_openssl_3des.c:87: error: expected expression before ')' token
C:/Tools/UAuto/src/uastack/platforms/vxworks/opcua_p_openssl_3des.c: In function 'OpcUa_P_OpenSSL_3DES_Decrypt':
C:/Tools/UAuto/src/uastack/platforms/vxworks/opcua_p_openssl_3des.c:112: error: 'DES_key_schedule' undeclared (first use in this function)
C:/Tools/UAuto/src/uastack/platforms/vxworks/opcua_p_openssl_3des.c:112: error: expected ';' before 'ks1'
C:/Tools/UAuto/src/uastack/platforms/vxworks/opcua_p_openssl_3des.c:113: error: expected ';' before 'ks2'
C:/Tools/UAuto/src/uastack/platforms/vxworks/opcua_p_openssl_3des.c:114: error: expected ';' before 'ks3'
C:/Tools/UAuto/src/uastack/platforms/vxworks/opcua_p_openssl_3des.c:116: error: 'DES_cblock' undeclared (first use in this function)
C:/Tools/UAuto/src/uastack/platforms/vxworks/opcua_p_openssl_3des.c:116: error: 'desKey' undeclared (first use in this function)
C:/Tools/UAuto/src/uastack/platforms/vxworks/opcua_p_openssl_3des.c:128: error: expected expression before ')' token
C:/Tools/UAuto/src/uastack/platforms/vxworks/opcua_p_openssl_3des.c:137: error: 'ks1' undeclared (first use in this function)
C:/Tools/UAuto/src/uastack/platforms/vxworks/opcua_p_openssl_3des.c:138: error: 'ks2' undeclared (first use in this function)
C:/Tools/UAuto/src/uastack/platforms/vxworks/opcua_p_openssl_3des.c:139: error: 'ks3' undeclared (first use in this function)
C:/Tools/UAuto/src/uastack/platforms/vxworks/opcua_p_openssl_3des.c:148: error: expected expression before ')' token
make[2]: *** [uastack/CMakeFiles/uastack.dir/platforms/vxworks/opcua_p_openssl_3des.c.obj] Error 1
make[1]: *** [uastack/CMakeFiles/uastack.dir/all] Error 2
make: *** [all] Error 2

dmiller
Sr. Member
Sr. Member
Posts: 13
Joined: 30 May 2013, 18:27

Re: VX Works Example Project/Documentation

Post by dmiller »

Dear Support,

I figured out the openSSL issue. I am using VXWorks 6.9 and had missed a directory name in one of the files. I am further with make but all is not yet correct. See below for latest issue. I am hoping the one is simple. I can find the header file in the C++ Windows directory structure. However, I have not yet been able to trace down where the files (include directory) belong in the build structure for the VxWorks image. Any suggestions would certainly speed us up.

Additionally, we have compiled the xml libraries today. Thus, any tips on including this would be appreciated as well.

Thanks for all the help

Dan
[ 59%] Built target channeldemo
[ 59%] Building CXX object uaserver/uaservercpp/coremodule/CMakeFiles/coremodule.dir/coremodule.cpp.obj
C:/Tools/UAuto/src/uaserver/uaservercpp/coremodule/coremodule.cpp:14:24: error: coremodule.h: No such file or directory
C:/Tools/UAuto/src/uaserver/uaservercpp/coremodule/coremodule.cpp:52: error: 'CoreModule' has not been declared
C:/Tools/UAuto/src/uaserver/uaservercpp/coremodule/coremodule.cpp:52: error: ISO C++ forbids declaration of 'CoreModule' with no type
C:/Tools/UAuto/src/uaserver/uaservercpp/coremodule/coremodule.cpp: In function 'int CoreModule()':
C:/Tools/UAuto/src/uaserver/uaservercpp/coremodule/coremodule.cpp:55: error: 'd' was not declared in this scope
C:/Tools/UAuto/src/uaserver/uaservercpp/coremodule/coremodule.cpp: At global scope:
C:/Tools/UAuto/src/uaserver/uaservercpp/coremodule/coremodule.cpp:59: error: expected constructor, destructor, or type conversion before '::' token
make[2]: *** [uaserver/uaservercpp/coremodule/CMakeFiles/coremodule.dir/coremodule.cpp.obj] Error 1
make[1]: *** [uaserver/uaservercpp/coremodule/CMakeFiles/coremodule.dir/all] Error 2
make: *** [all] Error 2

User avatar
Support Team
Hero Member
Hero Member
Posts: 3072
Joined: 18 Mar 2011, 15:09

Re: VX Works Example Project/Documentation

Post by Support Team »

Hi dmiller.

It seems to us that you are missing some folders of the SDK in your project. The first error indicates this:

Code: Select all

C:/Tools/UAuto/src/uaserver/uaservercpp/coremodule/coremodule.cpp:14:24: error: coremodule.h: No such file or directory
Be sure to have all files and folder of the SDK in your project. Another tip for you (if you build a Downloadable Kernel Module) is, that you may not link the uaserver at the end, because openssl and libxml2 are also kernel modules. Just build the server as "library" so you will be able to link the server and its third-party files against the kernel.


Best regards
Support Team

dmiller
Sr. Member
Sr. Member
Posts: 13
Joined: 30 May 2013, 18:27

Re: VX Works Example Project/Documentation

Post by dmiller »

Dear Support,

I installed the files from the distribution provided.

I installed the Windows files utilizing the installer. This place many files into the base directory

c:\Program Files (x86)\Unified Automation

The VxWorks files came in a separate zip file. I extracted those files to the directory

c:\Tools\UAuto

I then pointed CMake to the directory c:\Tools\UAuto\src

Please advise if this installation is correct. If not can you either provided information on correct installation or point me towards the documentation.

Thanks

Dan

User avatar
Support Team
Hero Member
Hero Member
Posts: 3072
Joined: 18 Mar 2011, 15:09

Re: VX Works Example Project/Documentation

Post by Support Team »

Hi dmiller!

If you have installed the Unified Automation SDK (in folder c:\Program Files (x86)\Unified Automation), you also have to extract the separate zip file into the installed location. So please extract the zip file into the sdk folder of the installed product.
After you have done this start CMake pointing to the src folder of the installed SDK (WITH the extracted files in this folder).

The zip file only includes additional files for the SDK (like stack platformlayer vxworks files and other important ones), hence the files in the zip file are a part of the SDK. Unfortunately there is no documentation for vxworks available in our SDK, because every vxworks target is different, so we also can not provide you a working CMake Toolchain file. You have to adapt this to your needs.


Best regards
Support Team

dmiller
Sr. Member
Sr. Member
Posts: 13
Joined: 30 May 2013, 18:27

Re: VX Works Example Project/Documentation

Post by dmiller »

Dear Support,

I have gotten the make to work successfully. However, I am trying to follow the example posted in the forum for integrating VxWorks and have hit a stopping point. The build procedure did not generate the file that is referenced to use for the DKM.

Please provide additional details as currently this forum is the only source of documentation I can find for utilizing VxWorks as the operating system for the tool we purchased.

Thanks for the help

Dan

User avatar
Support Team
Hero Member
Hero Member
Posts: 3072
Joined: 18 Mar 2011, 15:09

Re: VX Works Example Project/Documentation

Post by Support Team »

Hi dmiller!


We do not know what exactly you mean. Please send a full description of the problems you have to the following address: support@unifiedautomation.com.


Best regards
Support Team

dmiller
Sr. Member
Sr. Member
Posts: 13
Joined: 30 May 2013, 18:27

Re: VX Works Example Project/Documentation

Post by dmiller »

Dear Support Team,

We believe that we have successfully utilized CMake to build the libraries and have compiled examples from the C++ SDK. However, we are getting linker errors. For example:

c:/windriver69/vxworks-6.9/target/config/UnifiedAutomation/OPC_UA/lib/libcoremodule.a(coretransactions.cpp.obj): In function `TransactionContextCall::finishCall(unsigned int, UaStackTypeArray<unsigned int, &(ClearNothing(void*))>&, UaStackTypeArray<_OpcUa_DiagnosticInfo, &(ClearDiagnosticInfo(void*))>&, UaStackTypeArray<_OpcUa_Variant, &(ClearVariant(void*))>&, UaStatus&)':
C:/Tools/UAutoTools/UaSdkCppBundleSource/src/uaserver/uaservercpp/coremodule/coretransactions.cpp:1216: undefined reference to `UaSemaphore::post(unsigned int)'

Thus, we wanted to know if there was an example minimal VxWorks server that you could either point us to or provide to assist us in making sure we have built the libraries successfully.

Thanks

Dan

User avatar
Support Team
Hero Member
Hero Member
Posts: 3072
Joined: 18 Mar 2011, 15:09

Re: VX Works Example Project/Documentation

Post by Support Team »

dmiller,

in the latest delivery you have the code that compiles and runs on vxWorks 6.9. Are you using that latest delivery? From the errors you have posted, it seems that you are not using the delivered code base.

The error is caused by a missing define that must be set for vxWorks in order to skip array template classes. This was already done in the latest delivery, but obviously not in the code base you are currently using.

Best Regards
Support Team

dmiller
Sr. Member
Sr. Member
Posts: 13
Joined: 30 May 2013, 18:27

Re: VX Works Example Project/Documentation

Post by dmiller »

Dear Support,

I have utilized both and gotten the same linker errors. In your note, you indicated that the latest distribution had support for VxWorks 6.9. Thus, I wanted to check on this statement.

In the earlier distribution, the file "toolchain-vxworks-x86.cmake" references VxWorks 6.8. In getting ours to build the libraries, I made a new version of this fie and changed all the directory names to point to the correct locations within VxWorks 6.9.

The latest distribution contains a file named "toolchain-vxworks-x86-example.cmake. However, this file still has directory names that are correct for VxWorks 6.8 not VxWorks 6.9. For example:

# specify the cross compiler
SET(CMAKE_C_COMPILER ${WIND_HOME}/gnu/4.1.2-vxworks-6.8/x86-win32/bin/ccpentium.exe)
SET(CMAKE_CXX_COMPILER ${WIND_HOME}/gnu/4.1.2-vxworks-6.8/x86-win32/bin/c++pentium.exe)
SET(CMAKE_AR "${WIND_HOME}/gnu/4.1.2-vxworks-6.8/x86-win32/bin/arpentium.exe" CACHE PATH "VxWorks ar Program" )
#SET(CMAKE_AR "${WIND_HOME}/gnu/4.1.2-vxworks-6.8/x86-win32/bin/ccpentium.exe" CACHE PATH "VxWorks ar Program" )

Thus, I wanted to check that we received the correct zip file and/or all the contents that are needed for this zip file.

Thanks

Dan

User avatar
Support Team
Hero Member
Hero Member
Posts: 3072
Joined: 18 Mar 2011, 15:09

Re: VX Works Example Project/Documentation

Post by Support Team »

Hello dmiller,

the file is called "toolchain-example" for a reason. There is no generic toolchain file that works on all possible combinations of vxWorks targets.

Of course the file contains path and settings, flags that need to be adoptet to you system configuration.

Best Regards
Support Team

Post Reply