NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

custom data types, .net, nested structs

I receive a data structure from .net into TestStand. It's a struct containg a number of fields, and an array of stucts.

When i try to create a custom data structure of the Struct (CalibrationResult) in the step (Calibrate), the nested struct does not get any content. When i Open the Types pane, and check the nested struct (SpuriousList) its empty.

I have tried to create an other cutstom data type for SpuriousList, but i can't seem to get it right. The local variable (Local.RadarCalibrationResult) which is the output parameter keeps being read, with various error messsages like "missing a subproperty" or something like "you can't fit a square into a round hole". I did try to create the missing parts of the custom type manually, but it did not help.

Why will TestStand not build the complete custom datatype, when it contains nested structs ?

The sequence added is stripped down to one relevant step.

How do i create that particular custom data type, which will support my .net output (can anyone make Local.RadarCalibrationResult not red)?

 

 

 

 

0 Kudos
Message 1 of 6
(4,514 Views)

Hello NikolajEgeskovOstergaard, 

Please see my attached example.

Kind regards

0 Kudos
Message 2 of 6
(4,408 Views)

Hi Matthew

Thanks for you support.

Your answer here (and to my mail), is actually more valid for my post (https://forums.ni.com/t5/NI-TestStand/Net-Object-Ref-Array-of-structs/m-p/3177684#M49006), which is also what i sent directly to you.

If i could create a working custom data type, for the complete content of the object (like in your example), your proposal is good.

However if the object has nested structs like i describe in this post, i can't seem to get the "custom data type" right in TestStand. That way TestStand will not accept what i'm trying to put into that local. In this case i have tried just to create a local of type "object Reference", but then i'm not able not able to retrieve my data in the simple way you explain.

If i could just find a way to get TestStand to create the complete struture of my "custom data type", i think everyhting would be solved.

 

 

0 Kudos
Message 3 of 6
(4,370 Views)

Hello  Nikolaj,

Please see my attached example, I have included the sequence file as well as the Visual Studio project. 

With this project I can successfully get nested data into a TestStand variable. Apologies that the code is a bit messy. 

Let me know if this manages to help you out at all. 

Kind regards 


0 Kudos
Message 4 of 6
(4,328 Views)

Hi Nikolaj, 

I've been working with a colleague in my office on this problem. He has also made an example project demonstrating nested structs. This one is a lot tidier!

Regards

0 Kudos
Message 5 of 6
(4,315 Views)

Hello Nikolaj,

 

Not sure if you have already solved this issue, but I ran into the same thing when creating an Array of an Array of Structs.  Mine was related to calling VBAI from TestStand using .Net Dll instead of LabView.  The InspectionMeasurements data type is very complex.  For example, the InspectionMeasurements type is an array containing StepMeasurements types which contains a SingleMeasurement type which contains both a PassFailMeasurement type and an arrayMeasurement type.  So to help TestStand out, I created each type as a Custom Data Type starting from the deepest type working my way up to the InspectionMeasurements type.  Then, on that final type, I had to go into the Properties>>.NET Struct Passing and in the Property: combo box, I selected the measurements property (that is the array of structs) and added the same name "measurements" into the Struct Element Name:.  For some reason this was missing.  Once I did that, TestStand no longer complained about fitting a square peg in a round hole.  Here's a quick sequence that has those custom data types and a screenshot.

 

Note: This sequence causes an unknown error on the Open Inspection step.  I haven't solved that part yet and I'll post it as a question on this forum.

 

Hope this helps.

0 Kudos
Message 6 of 6
(3,811 Views)