NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

.Net Object Ref, Array of structs

I'm trying to find the best (and simplest) way to handle this issue:

Background:

My calibration code returns a .net object, containg 2 array of structs.

Each struct contains e.g 10 properties. Each array will contain around 16 of these structs.

That means several hundred values to be evaluated in TS.

Problem:

I would like to setup a limit for each of those values.

I  would like to evaluate and report via a numeric limit step.

 

Q1) How do i access a specific property of that object reference ?

Q2) How do i retrieve the name of that property ?

Q3) Should I manually build my test sequence, with one numeric limit step per property (which requires that i know exactly how many data properties i will get) ?

Q4) Can I dynamically do some looping at runtime, that could report/evaluate all the content of the object pointed to ? 

 

 

 

0 Kudos
Message 1 of 5
(4,486 Views)

Hi NikolajEgeskov...

 

In regards to the questions you have posted I would like to share the following resources with you. 


http://digital.ni.com/public.nsf/allkb/06ECE8BD16A4786F86256E94005E52D4?OpenDocument

 

http://www.ni.com/white-paper/8301/en/

 

 If you build your test sequence manually ( which is recommened), you will indeed need to know the exact sizes. Will this be possible? Do you know how many properties each structure will have and is this a fixed number through all structures?

  

Shazil M.
CLAD
Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 2 of 5
(4,428 Views)

Hi Nikolaj,

 

I suppose thats not what you are looking for.

Give me some more details especially about the struct ChannelCalibrationResult. (Hoping there you would like to do your limit stuff)
And are limits over the hole ChannelCalibrationResults Array the same ?

 

Regards

 

Juergen
 

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 3 of 5
(4,422 Views)

hi both..

 

Question 1 & 2 are the most relevant.

 

@Juergen I believe you have previously showed me how to retrieve properties from a single array referenced via a .net object.

It might be that this is "just" an expansion to the solution, since i now have arrays of structs, instead oof arrays of numbers.

 

 

I have been working on simplifying the data structure to something much "flatter", but i'm still puzzled by the above.

 

Where is the best place for finding info in TestStand/.net ?  (it seems there are not a lot of persons working on this combination)

 

br

Nikolaj

 

0 Kudos
Message 4 of 5
(4,383 Views)

I have been working with NikolajEgeskovOstergaard on the issue of: Nested structs - Create Custom Data Type from Struct produces a partially "empty" structure.

Solution: (all credit to NikolajEgeskovOstergaard)

  • Create two nested structs as individual (new) custom data types
  • Create the out-most struct as a common type
  • Go to "Custom Data Type" overview
  • Manually define the out-most type as containing types of the two new custom data types

Hopefully anyone coming across this behaviour in the future can get this resolved quickly. 

0 Kudos
Message 5 of 5
(4,188 Views)