NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem Returning Arrays through theTestStand 4.0 .Net Adapter

In TestStand 3.5 we invoked methods in .Net assemblies through .Net Action steps that return an array of doubles.  When we upgraded to TestStand 4.0 the arrays returned by these steps contain zeros rather than the values we expect.  I have reduced this problem to the simplest example I can and I see the same results. 
 
My .Net 2.0 assembly C# source code is as follows:
 
%<------------------------------------------------
using System;
using System.Collections.Generic;
using System.Text;
namespace ArrayPassingTest
{
  public class Class1
  {
    public double [] GetArray()
    {
      double[] doubleArray = new double[2] { 1.0, 2.0 };
      return doubleArray;
    }
  }
}
%<------------------------------------------------

I wrote a two-line sequence that invokes this method and displays the returned values in a Message Popup step.  When I run under TestStand 3.5, the values 1.0 and 2.0 are displayed.  When I switch to TestStand 4.0 and run the same sequence, the values displayed are 0.0 and 0.0.  I have tried modifying the Pass By Reference Flags of the TestStand variables that I am using without effect.  Any suggestions as to what is happening?
0 Kudos
Message 1 of 2
(3,112 Views)

I have reported the problem to R&D.  As a workaround, I would recommend passing the array out as a single array variable, and using a postexpression to assign the individual values.  I apologize for the inconvenience and we will try to fix this in a future version of TestStand.



Allen P.
NI
0 Kudos
Message 2 of 2
(3,070 Views)