NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Errors passing .NET struct back to .NET

Hi,

I applied what you said in my actual sequence file and it worked. However, seems that it was only temporary, as it has now gone back to the same error over the weekend, without any changes to the files.  I've checked, and I think I have every instance of the type set to [0...1].  I've attached another sample sequence file, if you could take a look and see if I missed something or I'm doing something incorrectly, that would be much appreciated.

 

0 Kudos
Message 11 of 13
(888 Views)

Here is what I saw happening when using this sequence file with the source code library I had been using, however I cannot guarantee this is causing your error as well since I don't have your exact source code.

 

For some reason, at runtime TestStand was not populating the elements of your struct parameter with the elements of the container variable you were using to specify the parameter.  I guess it wasn't recognizing it as matching the struct definition, even though it appears to match.  I created a new type using the Create Type from Struct button on the parameter itself.  I then changed the type of your local variable to the newly created type, made sure the array element was not empty, and the error went away.

(Note that I marked the second step in the file to skip, and didn't try to create an object reference but just used your declared container.  If you want to create an object reference you will need to specify a variable of type Object Reference instead of the container that you had specified for that step.)

 

Let me know if creating a new type gets your file working.  I apologize for the behavior you are seeing involving structs and arrays in the .NET Adapter.  For what it's worth, all of these issues have been fixed in TestStand 2010.

 

-Jeff

0 Kudos
Message 12 of 13
(887 Views)

In case you are interested, you can sign up for the beta of TestStand 2010 here:

 

http://forums.ni.com/t5/NI-TestStand/Announcing-the-TestStand-2010-Beta-Program/m-p/1136621

 

-Doug

0 Kudos
Message 13 of 13
(853 Views)