06-14-2011 04:30 AM
08-04-2011 03:00 PM
Hello,
Did you find a solution?
I have almost same situation.
A VI will call a methd from a .net dll. In the dll I have a static property. At the first call I have a "new" and I alocate memory to a static variable.
After some time I will call another method from same dll and same class. The static variable that was alocated before it's seems that is not alocated anymore.
If I try to make a singleton from my class I cannot, becouse I need a constructor in order to call function from Labview(as explained in the preview message posted).
The interesting is next. If I do the two calls from same vi everyting is ok, but if I do this calling from the Teststand using the labview adapter is not working anymore.
What should be the solution?
Thank You
08-05-2011 10:49 AM - edited 08-05-2011 10:49 AM
Perhaps the approach provided in this help topic might help in the singleton case: Using Static .NET Properties and Methods
Thanatos, with regard to your comment: "if I do this calling from TestStand using the LabVIEW adapter is not working anymore", are you calling the same two VIs from TestStand? If so, what version of TestStand are you using? Are the VIs located within LabVIEW Projects? If so, and you are using TestStand 2010, have you configured the LabVIEW steps to point to the LabVIEW Project?
08-08-2011 02:45 AM
Hello,
Unfortunatly we still use the TestStand 3.1 and LabView 7.1.
I have installed LabView 8.0 and it seems that this issue was solved.(with 7.1.1 still same problem)
I converted all the VI's to LabView 9 with mass compile and I made a source distribution even a Deployement From TestStand.
It seems that only with Deployement it worked. But I had to copy mannually my custom dll-s into some folders where the VI's were. It not clear to me exactly what were the rules.( the dll-s must be in the same folder with the top vi I think)
For now we cannot migrate to a greather versin of TestStand.
08-08-2011 09:51 AM
You can always write a wrapper class in .NET that does the access to the statics for you and exposes them as instance methods on your wrapper class.
-Doug