NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

debug object references

Solved!
Go to solution

I have a reference to a .net list.

Is it possible to "debug the content" of the list during runtime ? i.e. can i somehow "expand the view" to see properties ?

 

 

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

Hi NikolajEgeskovOstergaard, 

 

Could you elaborate on what you're hoping to do with this reference? What sort of properties would you expect to be able to see?

 

Vsenior

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

From within TestStand, no, not unless you add steps to get each item in the list using the .NET adapter. Using visual studio to debug the process, you could set breakpoints somewhere in your .NET code and look at the list there.

 

-Doug

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

from my .net application i'm returning an array of objects containing 2 properties.

I wish to set up a numeric limit step, a multiple numeric step or something else to evaluate the properties.

how do i get to the values of those properties in Teststand ?

 

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

One way would be to use .NET action steps to get the values into local variables. You can use mscorlib as the assembly and call Array.GetValue to get the individual values from the array then use another .NET step with your assembly and the USB_SA.Peak data type with each element to get properties, fields, or call methods on that type. There are other ways too, such as if the type USB_SA.Peak is really a struct (i.e. value type), then you can create an equivalent TestStand custom data type for it and have the .NET adapter do the data conversion for you to get the values into a local variable that is an array of that type rather than using an Object Reference variable. It really depends on what you are doing and how your .NET types are defined.

 

Hope this helps,

-Doug

0 Kudos
Message 5 of 6
(4,424 Views)
Solution
Accepted by topic author NikolajEgeskovOstergaard

Hi Doug,

 

Seems this thread is duplicated

Peak class is also used here

 

Regards

 

Juergen

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