NI Labs Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

NI LabVIEW OPC UA APIs Discussion

I assume you use DSC module to develop it. On a clean machine, you need DSC Runtime System to run the built application.

Ryan Shi
National Instruments
0 Kudos
Message 121 of 150
(2,079 Views)

Ryan.S,

The application I am working on reads results from a tester and then creates nine items inside a folder to be published as an OPC UA server. At first I was using the VI's inside the NI OPC UA.lvlib. I realised this library was not accessible after building an application on a non labview environment machine. Then I decided to create my own VI's calling the same dlls those VIs inside the OPC UA Pallete access. When in development mode everything works fine, but, after building an application and instaling it in other machine, I always get an error #42 trying to read function "Get Unique String" inside ni_opcua_server.dll. I have already tried to install DSC runtime, changed to support windows 7, but I still get the error #42.

_____________________ _ _ _ _ _ _

"Together we stand, divided we fall..."

Certified LabVIEW Associate Developer






0 Kudos
Message 122 of 150
(2,079 Views)

For those who this information may interest, I am pleased to say that it's fixed!

OPC UA VI's access the following dll:

C:\Program Files (x86)\National Instruments\LabVIEW 2014\vi.lib\OPCUA\server\ni_opcua_server.dll

C:\Program Files (x86)\National Instruments\LabVIEW 2014\vi.lib\OPCUA\server\ni_opcua_server.dll

C:\Program Files (x86)\National Instruments\LabVIEW 2014\vi.lib\OPCUA\client\ni_opcua_client.dll

But it requires also two more dlls:

C:\Program Files (x86)\National Instruments\Shared\OPCUA\ni_opcua_base.dll

C:\Program Files (x86)\National Instruments\Shared\OPCUA\ni_opcua_uastack.dll

The above dlls are not called by any specific VI whithin block diagram. That why I could not figure out what was missing in my code. I assume that this two dlls are called by one (or more) of the above mentioned dlls (server, client or utilities) at the specific location. While in develpment mode, everything runs fine because Labview creates this folder hierachy at the installation. However, in a clean PC this path does not exist. so, it is necessary to create it whithin application builder and place the dlls inside. That's it!

_____________________ _ _ _ _ _ _

"Together we stand, divided we fall..."

Certified LabVIEW Associate Developer






0 Kudos
Message 123 of 150
(2,079 Views)

Yes, you did find the trick to make the thing work. But actually the missing of those 2 dlls (ni_opcua.base.dll and ni_opcua_uastack.dll) in the built application by app builder is the desired behavior as those 2 dlls will be actually installed by DSC Runtime System like Ryan mentioned above.

Message 124 of 150
(2,079 Views)

dwisti wrote:

  Data change user events on the server

Right now the server code is poll based.  I would like to see the server had the ability to fire an event when the client writes data.  I guess one could place a client on the server to have events but this seems to be extra work for the developer.  I could see issues on large applications where you have too many localhost clients waiting for events.

It did not take us long after starting an OPC server project before we looking for this functionality...In our case the server is supposed to send writes from clients onwards to other systems, but it should only do so if in fact there are OPC clients writing anything...That would have been easy if writes actually could generate an even on the server side.

Is this functionality something NI is planning to implement?

Message 125 of 150
(2,079 Views)

Hi Mads,

Thank you for you comments. We are actually in the process of expanding of current implementation of the OPC UA API included in the LabVIEW Real-Time and DSC modules. This expansion entails the implementation of the full especification defined by the OPC Foundation to add the Historical Data Access (HDA) and Alarms & Conditions (A&C) facets. These additions to the OPC UA API are confirmed in the roadmap and will be included in future updates of this product.

Regards,

Carlos Pazos

Product Marketing Manager

Embedded Software

Carlos Pazos

Senior Product Marketing Manager

National Instruments
Message 126 of 150
(2,079 Views)

Hello,

When creating a client, we can specify the username+password to use: http://zone.ni.com/reference/en-XX/help/370622N-01/lvmve/opcua_connect/

However, I couldn't find a way to set a list of accepted usernames and passwords when creating a server. Is this functionality available currently?

Certified LabVIEW Developer
0 Kudos
Message 127 of 150
(2,080 Views)

No, server APIs currently don't support usernames and passwords.

0 Kudos
Message 128 of 150
(2,080 Views)

Thanks for confirming, yayuan.

Are usernames and passwords on the roadmap for the server APIs?

Certified LabVIEW Developer
0 Kudos
Message 129 of 150
(2,080 Views)

Yes. That is on the roadmap, but I cannot tell more details.

Message 130 of 150
(2,080 Views)