You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are trying to add the OpcUADiNodeSet2 and the OpcUARoboticsNodSet2 of Umati/OPCFoundation to the OPC UA server of our robotic system.
The OpcUADiNodeSet2 is integrated successfully and shown in the structure in UA Expert as well as our internal opc ua functionality.
But the OpcUARoboticsNodSet2 is not yet visible, though we don't have any build errors. Only when we are editing the server.cpp file with UA_Server_addObjectNode (according to the sample server example) the object with its direct children is shown, but not the children's children.
Is it necessary to add all objects manually in the server.cpp or should the content of the OpcUARoboticsNodSet2.xml structure be shown by integration to the CMakesLists.txt?
Background Information / Reproduction Steps
Add OpcUADiNodeSet2.xml and OpcUARoboticsNodSet2.xml and their respective csv and bsd files to an existing OPC UA server.
Add the following lines to the CMakeLists.txt:
set(UA_NAMESPACE_MAP_DI
"2:http:https://opcfoundation.org/UA/DI/"
)
set(UA_NAMESPACE_MAP_ROBOTICS
"2:http:https://opcfoundation.org/UA/Robotics/"
)
# First build DI Nodeset as Robotics Nodeset depends on it
ua_generate_nodeset_and_datatypes(
NAME di
FILE_CSV ${UA_MODEL_DIR}/Opc.Ua.Di.NodeIds.csv
FILE_BSD ${UA_MODEL_DIR}/Opc.Ua.Di.Types.bsd
FILE_NS ${UA_MODEL_DIR}/Opc.Ua.Di.NodeSet2.xml
NAMESPACE_MAP "${UA_NAMESPACE_MAP_DI}"
TARGET_PREFIX "${PROJECT_NAME}"
INTERNAL
)
add_library(ua_gen_di)
target_sources(
ua_gen_di
PRIVATE # cmake-format: sort
${PROJECT_BINARY_DIR}/src_generated/open62541/di_nodeids.h ${UA_NODESET_DI_HEADERS}
${UA_NODESET_DI_SOURCES} ${UA_TYPES_DI_HEADERS} ${UA_TYPES_DI_SOURCES}
)
target_link_libraries(ua_gen_di PUBLIC open62541::open62541)
# Build Robotics nodeset
ua_generate_nodeset_and_datatypes(
NAME robotics
FILE_CSV ${UA_MODEL_DIR}/Opc.Ua.Di.NodeIds.csv
FILE_BSD ${UA_MODEL_DIR}/Opc.Ua.Di.Types.bsd
FILE_NS ${UA_MODEL_DIR}/Opc.Ua.Di.NodeSet2.xml
NAMESPACE_MAP "${UA_NAMESPACE_MAP_ROBOTICS}"
TARGET_PREFIX "${PROJECT_NAME}"
DEPENDS di
INTERNAL
)
add_library(ua_gen_robotics)
target_sources(
ua_gen_robotics
PRIVATE # cmake-format: sort
${PROJECT_BINARY_DIR}/src_generated/open62541/robotics_nodeids.h
${UA_NODESET_ROBOTICS_HEADERS}
${UA_NODESET_ROBOTICS_SOURCES}
${UA_TYPES_ROBOTICS_HEADERS}
${UA_TYPES_ROBOTICS_SOURCES}
)
target_link_libraries(ua_gen_robotics PUBLIC ua_gen_di open62541::open62541)
add_executable(<executable_name>
# Path to cpp files
)
target_link_libraries(<executable_name> PRIVATE
# Other libraries
ua_gen_di
ua_gen_robotics
open62541::open62541
)
3.Add following lines of code to server.cpp:
#include "open62541/di_nodeids.h"
#include "open62541/namespace_di_generated.h"
#include "open62541/types_di_generated_handling.h"
#include "open62541/robotics_nodeids.h"
#include "open62541/namespace_robotics_generated.h"
#include "open62541/types_robotics_generated_handling.h"
server_ = UA_Server_newWithConfig(config_);
UA_StatusCode retval;
// Add server configuration to DI namespace
retval = namespace_di_generated(server_);
if(retval != UA_STATUSCODE_GOOD) {
logf(logger::Level::ERROR, "Could not add di nodeset to server. Error code: %d", retval);
std::string errorMessage = "Could not add di nodeset to server. Error code: " + std::to_string(retval);
throw std::runtime_error(errorMessage);
}
// Add server configuration Robotics namespace
retval |= namespace_robotics_generated(server_);
if(retval != UA_STATUSCODE_GOOD) {
logf(logger::Level::ERROR, "Could not add robotics nodeset to server. Error code: %d", retval);
std::string errorMessage = "Could not add robotics nodeset to server. Error code: " + std::to_string(retval);
throw std::runtime_error(errorMessage);
}
With the following lines of code in the cpp file, the object and its children are shown in the tree:
Description
We are trying to add the OpcUADiNodeSet2 and the OpcUARoboticsNodSet2 of Umati/OPCFoundation to the OPC UA server of our robotic system.
The OpcUADiNodeSet2 is integrated successfully and shown in the structure in UA Expert as well as our internal opc ua functionality.
But the OpcUARoboticsNodSet2 is not yet visible, though we don't have any build errors. Only when we are editing the server.cpp file with UA_Server_addObjectNode (according to the sample server example) the object with its direct children is shown, but not the children's children.
Is it necessary to add all objects manually in the server.cpp or should the content of the OpcUARoboticsNodSet2.xml structure be shown by integration to the CMakesLists.txt?
Background Information / Reproduction Steps
3.Add following lines of code to server.cpp:
Used CMake options:
Checklist
Please provide the following information:
UA_LOGLEVEL
set as low as necessary) attachedThe text was updated successfully, but these errors were encountered: