Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Best method to update data from CompactRIO to "National Instruments.Variable Engine.1" OPC server

Solved!
Go to solution

Hi everyone, I have a Thirt-Party OPC Client that I want to use for testing with the CompactRIO. I can specify "National Instruments.Variable Engine.1" in the OPC Server, create a OPC Item, browse to a variable and then see it's value. I'm using a CompactRIO and i want to send the updated data that i'm acquisitionning to to the Third-party OPC Client, so, what is the best method ? Right now, what is working, is that I created a network published shared variable on the LabVIEW host that i dragged in the CompactRIO Project. I created a small loop that increment it's value every 500ms. I then created on the host, a small VI that published that value to ""National Instruments.Variable Engine.1". Now, is there a better way to do his ? Is there something that can automatically populate the Variable Engine from the CompactRIO without manually publish shared variables inside a LabVIEW application ? Thank you for your time, Best regards !

0 Kudos
Message 1 of 5
(5,368 Views)

ppberube,

 

I would like to clarify your application a bit, and offer a few suggestions.  First off, what interface are you using in cRIO?  Is it the FPGA interface of the Scan interface?  If you are using the Scan Interface, the I/O is already hosted in the Variable Engine, which you should be able to access from your OPC Client.

 

Secondly, when you say you write the data to a variable, is this occuring on the FPGA or on the cRIO controller?  

 

What do you mean by, publishing the value to the Variable Engine? How are you accomplishing this?  The value should already be present on the Variable Engine if the variable is network-published.

Drew T.
Camber Ridge, LLC.
0 Kudos
Message 2 of 5
(5,348 Views)

Hi Drew,

 

Very sorry for the delay !

 

I'm using the Scan Interface.

 

You are right, I can see the I/O of my modules on the CompactRIO from the host, ex : I create a Shared Variable with Aliasing on "My Computer" that i could bind on those.

 

I actually made some progress using the page 183 of Compact Rio Developers Guide.

 

What I did is : In a library i called "OPC Items Library" on "My Computer", I created a Shared Variable (Variable1 for example) that is network published that i selected "Enable Aliasing", in which i selected a Shared Variable (Variable2 for example) in another library on on the CompactRIO.

 

In this way, i can access the variable "Variable1" (that is binded on Variable2) from the OPC Client.

 

My question i was asking a week ago was : Is there a way to make Variable2 directly available to OPC Client without creating a Shared Variable on the "My Computer", apparently not because of the OPC Server is based on Microsoft's COM.

 

Now, when my real-time application will be "built" and the RIO will automatically boot on it at startup, and for example, i use a new computer, i will need to load the project on that new computer and deploy the shared variables in the "My Computer" Library before so that the OPC client could access them ?

 

Is there a better way to do deploy or simply "publish" variable2 so that the OPC Client can access it ?

 

That would be strange to install LabVIEW on that "new computer" only to be able to load the project to deploy the variable, i'm pretty sure i'm missing something 😉

 

Thank you for your time Drew, I really appreciate your feedback

 

Best regards,

 

 

 

 

 

 

 

0 Kudos
Message 3 of 5
(5,305 Views)

ppberube,

 

Thanks for clarifying!  You make some good points, in that it is a bit of a roundabout way to do things.  You are correct that the NI Variable Engine only acts as an OPC Server on the Windows targets, because it uses OPC DA.  The first consideration would be that if you deploy a library, it will persist even after a reboot.

 

There are two options you may consider.  The first is using OPC UA, which relies on the DSC module.  OPC UA supports real time targets, and therefore would enable you to expose the I/O on the cRIO to the OPC client directly.  Its API can be found here: https://decibel.ni.com/content/docs/DOC-16930

 

The second option would be to create a LabVIEW application (exe) that you could then deploy to a computer that didn't have LabVIEW Development system installed.  This way you could have the program run as a service or at startup, and deploy the library.  This way you could be guaranteed that the library is deployed, and that the OPC Client will have something to connect to.

 

Let me know if these help at all!

Drew T.
Camber Ridge, LLC.
Message 4 of 5
(5,287 Views)
Solution
Accepted by topic author ppberube

Thank you very much for your answers Drew,


I downloaded the OPC UA API and will test it next week.

 

Thanks again !

0 Kudos
Message 5 of 5
(5,278 Views)