LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Interactive OPC UA browser example to see nodeIds in labview 2018?

Hi, 

 

I am currently working on a project that involves OPC UA and I am looking for an example of an interactive OPC UA browser implemented in LabVIEW. Specifically, I am interested in seeing how to interact with OPC UA servers and browse their nodes using LabVIEW.

 

I found a similar thread: https://forums.ni.com/t5/LabVIEW/OPC-UA-browser-example-How-view-the-OPC-UA-servers-structure-OPC/td... where user @Jacobson-ni provided his own solution but it seems that this is not compatible with LV2018. If anyone has any example code or resources that could help, I would greatly appreciate it!

0 Kudos
Message 1 of 11
(369 Views)

What makes you believe that the project on Jacobsens Github repository is not compatible with LabVIEW 2018? The project file at least seems to be in 2017 format, so 2018 should be perfectly able to load that.

Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 11
(323 Views)

This solution is compatible with LV2018, as Rolf perfectly mentioned. However, it requires the NI OPC UA Toolkit installed.

I would like to recommend installing version 2018 (same as LabVIEW you have), because it appears that the latest version is not aware of LV2018 (at least, it's not available on my LV2018 after installation of 2022). Anyway, I've just tested it with LabVIEW 2025 Q1 (64-bit) and NI OPC UA 2022 Q4, using my own OPC UA server with five variables, and can confirm, it works.

Screenshot 2025-03-14 13.26.51.png

0 Kudos
Message 3 of 11
(302 Views)

Well when I tried to use it, i got errors complaining that I was "Missing Labview Tools Network Add-on" from the GOOP suite, and since I had the LV2018 Goop Suite installed I assumed that it used some outdated function that was not included in the 2018 GOOP. Which add-ons do I need to run this VI?

0 Kudos
Message 4 of 11
(294 Views)

@Asasafuchi wrote:

Well when I tried to use it, i got errors complaining that I was "Missing Labview Tools Network Add-on" from the GOOP suite, and since I had the LV2018 Goop Suite installed I assumed that it used some outdated function that was not included in the 2018 GOOP. Which add-ons do I need to run this VI?


I believe the NI OPC UA Toolkit is the only one that needs to be installed. Attempting to open this solution in LV2018 without this toolkit installed results in the following:

Screenshot 2025-03-14 13.53.03.png

No other errors raised except NI OPC UA SubVIs and according Refs.

0 Kudos
Message 5 of 11
(287 Views)

By the way, the given browser doesn't need to be so deeply integrated with the OPC UA toolkit and can be "decoupled" because the Browse Name (to be displayed in the tree) is usually available at browse time. It's not necessary to walk over NodeIds and then obtain the name to display with Get Node Attribute inside of browser, something like that:

Screenshot 2025-03-17 15.36.21.png

Attached is the code for LV2017 (VIs belong to a class with items in community scope that were reverted to public because community scope was introduced in LV2019). Also I added NodeId to the tree:

Screenshot 2025-03-17 12.11.25.png

As a data source, I am using my own OPC UA Server/Client.

Disclaimer: Currently, I am learning the Rust programming language, and this is just a "weekend side project" based on the implementation of OPC-UA in Rust. This very rusty code can crash at many points, so use it at your own risk. Full source code is provided; feel free to modify it. However, please note that at this moment, the Rust code is licensed under the MPLv2, and the LabVIEW code is in the public domain (CC0 license). I will just leave it here; maybe it will be useful for you or someone else in the future.

 

0 Kudos
Message 6 of 11
(222 Views)

Oh cool! Thanks for providing this nice solution. One question: how do I make the Node Ids selectable? For example if I wanted to select one that then gets added to a table or array. I have never used tree controls so I apologize for the question that might seem trivial.

0 Kudos
Message 7 of 11
(196 Views)

Also I noticed that this list only displays the node ids and does not include the namespace identifier, do you know how these can be added?

0 Kudos
Message 8 of 11
(191 Views)

@Asasafuchi wrote:

Also I noticed that this list only displays the node ids and does not include the namespace identifier, do you know how these can be added?


For a node ID with namespace=0, the namespace specifier is optional and often omitted.

Rolf Kalbermatter
My Blog
0 Kudos
Message 9 of 11
(158 Views)

How does this code work with certification? Do I need to modify the rust scripts so that I can add certification file paths, security policies etc?

0 Kudos
Message 10 of 11
(142 Views)