From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sharing .net DLL's refernce between TS and LV

I got error 1055 when I call .net dll function which has a refernce input that is created in TS . I added DLL's to GAC so that .net DLL's can be shared by different applications such as LV and TS. But, I still get the 1055 error. If I call the DLL functions in pure TS or LV environment there is no error. I think there is a problem sharing between LV and TS. Does anyone have examples how to use .net dll's correctly?
0 Kudos
Message 1 of 7
(2,760 Views)
Hello,

There should not be any problem as far as I know. I am attaching a zip with a sequence file that accesses a .NET assembly 3 different ways:

1) Using direct .NET adapter step types.
2) Opening a reference to the .NET assembly and accessing its properties within a LabVIEW code module.
3) Passing a .NET assembly reference to a LabVIEW code module and accessing its properties within that code module.

All three of the methods work. All necessary files are included within the zip. Thank you for contacting National Instruments and have a great day!

Aaron B.
National Instruments
0 Kudos
Message 2 of 7
(2,759 Views)
Aaron,

Attached please find screen dump that describe error 1055 occuring while running your example.
Thank you for your response. I ran the sequence. Item (1:direct .net) and item(2:constructing within LabView) work fine as I expected. The third item (3:passing Reference node) failed. I ran this in both Windows XP and 2000 platforms.

Legal engineer
0 Kudos
Message 3 of 7
(2,759 Views)
Aaron,

I noticed that in your ZIP file there are two report html files. Both reports are showing that the step "Call in LV and pass from TS" has failed with the same error 1055. Is this a known problem?

Legal Engineer
0 Kudos
Message 4 of 7
(2,759 Views)
Hello,

My bad. You are absolutely correct. I was using the Message Pop-up strings to determine that both modules were setting the appropriate strings; however, the second one was not setting anything. The string was correct because it was not changed from what it was set to by the first module.

I have been investigating this issue further and have found that when trying to share a reference between two LabVIEW VIs through global data, there is still a problem. There seems to be no way to share data between LabVIEW code modules; however, I have escalated the issue to our R&D department and will write back if I find out any additional information from them.

Aaron B.
National Instruments
0 Kudos
Message 5 of 7
(2,759 Views)
Hello,

Just wondering if the R&D department found a way to use global to share .net assembly reference between two differennt VI's.
0 Kudos
Message 6 of 7
(2,668 Views)
In LabVIEW 7, you can share .NET references between VIs only as long as they are all under the same top level VI. That is saying a lot in a few words so let me give an example.

VI A -> VI a1, a2, x1

VI B -> VI b1, b2, x1

So here we have two "top level" VIs (A and B). Each having two unique subVIs (a1/a2, b1/b2) and a shared VI (x1). Where can references be shared?

A, a1 and a2 can all share references. Same with B, b1 and b2. The x1 subVI is a bit tricky. Which refnum it can access depends on the parent. When called from the A tree, it has access to those refnums but not those from B, and vice versa.

Why? Because a seperate .NET AppDomain is created for each top level VI and therefore any references created in one AppDomain are not visible to another.

In the case of TestStand, each VI called as a step is a top level VI. This is why you can't share .NET references across steps or sequences.

As I discuss in my blog (see http://detritus.blogs.com/lycangeek/2005/03/psst_can_you_ke.html), this is changing in the future and you will be able to share references between A and B.
0 Kudos
Message 7 of 7
(2,657 Views)