11-30-2015 01:02 PM
Hi,
How can I pass .net references between different Vi's in the same project? Is there a way to store the reference in a shared variable?
Solved! Go to Solution.
11-30-2015 01:11 PM
You could quite easily store the .NET reference in a global variable (Global VI) or FGV and then dish it out to whoever wants to use it.
Having said that I would encourage you to consider wrapping operations on the reference into some form of singleton to better manage atomic access to the reference in case it isn't entirely thread-safe.
11-30-2015 01:42 PM
Hi,
Sorry, I am new to labview and don't quite understand how I can easily do this. What exactly should be in the global vi that stores this refnum. I have attached pictures of my failed attempt at it.
Thanks for the quick response
11-30-2015 01:49 PM
You're almost there. Change the type of the .NET reference on your Global VI by right-clicking on the control. This will allow you to hook up to your VI.
11-30-2015 02:52 PM
Well that is awfully easy. I feel foolish to even not try that.
Thanks for the help. Will start using it in another VI's and see if there is a problem. Thanks.