Using the UaModeler to add and modify different types of nodes to the model

General topics regarding AIC Opc Ua Foundation and technology in general.

Moderator: OpcUa Support

Post Reply
OpcUa Support
Posts: 39
Joined: Thu Nov 17, 2022 7:15 am

Using the UaModeler to add and modify different types of nodes to the model

Post by OpcUa Support »

1. New UaModeler Project
1.1 Creating a New Project
To create a new project, choose “File → New Project” from the menu bar. The “New Project” wizard will appear. Fill in a project name and a file name to your liking.
NewUaModelerProject01.png
NewUaModelerProject01.png (16.54 KiB) Viewed 5589 times

1.2 Selecting a Template
After confirming the General Project Settings by pressing the button “Next”, the “Generate Code” dialog appears. Here you specify the Code Template Set and the Output Directory for the generated code. At “Template Set”, choose the kind of code to be generated, i.e. the SDK you intend to use the code with.
NewUaModelerProject02.png
NewUaModelerProject02.png (25.67 KiB) Viewed 5589 times

1.3 Selecting the Base Models
NewUaModelerProject03.png
NewUaModelerProject03.png (19.86 KiB) Viewed 5589 times

1.4 Completing the Wizard With “New Model”
Here you have to specify some information for your new model. Please fill out all fields as shown below.
NewUaModelerProject04.png
NewUaModelerProject04.png (19.58 KiB) Viewed 5589 times

2. Adding a New Object Type
new_type.png
new_type.png (54.43 KiB) Viewed 5589 times

Expand the input fields at “Type” and fill in a name for the new object (here “MyObjectType”). All other information can be added later. Confirm by clicking on the “OK” button.
new_type_2.png
new_type_2.png (43.39 KiB) Viewed 5586 times
You can see the newly created node (MyObjectType) in the Information Model Window below “BaseObjectType”. Select it to display its content in the main window.

In this example, we will add three components to the Object Type, two variables of data type Int32 (var1 and var2) and one method (fktSum).

Click on “Select NodeClass” to add a new node and fill in the required information as shown in the screenshot below. To add a TypeDefinition or a DataType which is not already listed in the respective drop-down menu, choose “<Add another node …>” to open a browse window. Confirm your changes by clicking on the “OK” button.
new_type_3.png
new_type_3.png (47.37 KiB) Viewed 5585 times
With the toolbar buttons you can switch between the model view and the type declaration view.
new_type_4.png
new_type_4.png (42.32 KiB) Viewed 5585 times

3. Adding Method Arguments
By pressing the triangle next to “Children”, an input field shows up for adding node declarations. You can add input and output arguments, give them a name, and select the data type of each argument. Confirm your choices with “OK”.
new_type_6.png
new_type_6.png (60.2 KiB) Viewed 5585 times

4. Select the Model for Generating Code
new_type_8.png
new_type_8.png (46.04 KiB) Viewed 5585 times

5. Generating Code
For generating the source files, press the “Compile” button (the blue gear-wheel) in the menu bar. When the compilation is finished you will find your generated *.h and *.cpp files located in the output folder (as set in the “New Project” dialog).


6. Export Model as XML
The last step is to export the model to an XML file. Right-click on the model in the Project Window and select Export XML. You will now find a *.xml file next to the model file.
Best Regards,
OpcUa Support Team
Post Reply