NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

TestStand Crashing with .net Array of object

Hi,

 

I'm skipping the first two line since I want to send an empty array to my .NET dll. The DLL will then stored information in this empty array and return it (BYREF) to TestStand.

 

Thanks

0 Kudos
Message 11 of 19
(2,328 Views)

Hi,

 

These first two lines are creating dummy references. You can use these dummy object references and pass these values in the array. This does not cause the crash. With this implementation you can then incorporate the functionality you are wanting with logic in the DLL.

 

-Adri K

Adri Kruger
National Instruments
LabVIEW Product Marketing
0 Kudos
Message 12 of 19
(2,307 Views)

Ok,

 

but is it normal that TestStand will sometime crash when skipping those two lines ? Did you replicate this problem ?

 

Thanks,

0 Kudos
Message 13 of 19
(2,298 Views)

Hi,

 

Yes I did replicate the crash when skipping the first two lines. The workaround to avoid this crash is to use those two lines and pass dummy references. 

 

-Adri K

Adri Kruger
National Instruments
LabVIEW Product Marketing
0 Kudos
Message 14 of 19
(2,285 Views)

HI all,

I have similar problem. In our factory we using teststand and our sequencer.We have a lot of different hardware so we made something like HW manager.It is done in C#.For future use we created something like General function call :

 

bool general_function(string function_name, object[] parameters, object[] results)

 

with this we call any function in our HW manager from sequencer.But TS crashing all the time when we call this function.Sometimes we get a message that is not possible to pass object between app. domains.So my question is similar at on beginig of this thread : how we can pass something without some knowledge about called function?For example i will put as function_name same name of function,as parameters i would like to pass array of numbers packed to the object and as result i will get array of numbers packet to object.If i will call some other function i will pass different parameters.Our HW manager takes this parameters and he casting parameters based on function name ,becouse he know what kind of parameters should be inside.I read that this can by done by  .NET remoting but we want to avoid this if it is possible.

 

Im sorry that i interrupting this thread and for my english.

0 Kudos
Message 15 of 19
(2,204 Views)

It sounds to me like the crash only occurs if the array you are passing contains null/nothing objects in it. Perhaps as a workaround you could assign a temporary .net object to elements that would otherwise be set to Nothing.

 

Hope this helps,

-Doug

Message 16 of 19
(2,198 Views)

Hi doug,

Thanks for answear, i found some functions with some null pointer on the end of array.Now testand gets exception every time a call extra function.I attached a example of simple extra function call and error message.Could you look at that please?

 

regards, 

Download All
0 Kudos
Message 17 of 19
(2,180 Views)

There is a similar related problem that we are also looking into. When you assign an array of numbers to an element of the array of object references what you are doing is really assigning an ActiveX reference of the TestStand PropertyObject which represents the array to the array of object references. Passing an ActiveX reference inside an array of object references currently has this issue (we are looking into it), but is also probably not what you intended to do in the first place. You probably wanted to pass a dotnet array of numbers for that element instead.

 

In order to do this you will need to write and call a utility function as follows to convert an array of numbers into a dotnet object for TestStand.

 

        public void ReturnArrayAsDotnetArray(double[] intput, out object arrayOfNumbersAsDotNetObject)
        {
            arrayOfNumbersAsDotNetObject = intput;
        }

 

Then in your sequence you can call this function to get a dotnet object version of the array, and then assign that to your array of object references.

 

Here's a TestStand 4.1 example sequence of doing this:

 

Hope this helps,

-Doug

Message Edited by dug9000 on 06-26-2009 10:51 AM
Message 18 of 19
(2,158 Views)

Hi Doug,

Thanks for explanation.It was really helpful.I created some conversing functions and it works great!!

Thanks so much. 

0 Kudos
Message 19 of 19
(2,145 Views)