Ni.com is currently experiencing issues that may cause some pages to fail.
Support teams are actively working on the resolution.
Ni.com is currently experiencing issues that may cause some pages to fail.
Support teams are actively working on the resolution.
08-31-2009 12:40 PM
I have a .NET assemply from a customer that specifies a return value as a byte[]. I am assiging this value to an array of numbers, as is suggested by the .NET adapter.
In some cases the method returns a null object instead of an empty byte array, causing an error from the .NET adapter stating that is could not set the return value of the function since the reference does not point to an object.
Is there a way to get around this? I could write a wrapper function to test for the null return, but I would prefer not to do that.
Mike
09-01-2009 05:05 PM
Hi Mike,
I set up a test and found the same behavior. Unfortunately the best way I can think of to get around this is the method you suggested, writing a small wrapper assembly to test for the null value and return an empty array or some unique array so you can handle it in TestStand. If anyone else has any experience with this, I'd be interested to hear in how they got around this.
09-01-2009 05:17 PM
I had the creator of the assembly make a change to not send back a null reference.
I also found that I had a similar error if the array on the TestStand side was empty. I set the array default to have one element and then the .NET assembly would resize the array, if required, even to an empty array. If I ran a second step when the previous step had set the array to empty, it still worked.
This could have been the original problem. Did your test case also use an empty array on the TestStand side?
Mike
09-02-2009 02:17 PM
The TestStand 4.2.x Known Issues List contains the following known issue:
Error when passing an empty array to a .NET code module