08-25-2014 04:53 AM - edited 08-25-2014 05:10 AM
Hi to all!
I'm quite new to TestStand and so my question could be quite simple but I was not able to find solution looking at previous messages.
I have a sequence which passes one array (of custom data type) to another one to do basic stuff on the array (reverse the order of the elements for example).
I want to pass to the called sequence an Object Reference of the array
The problem is that I'm not able to read the element of array inside the called sequence using the object reference.
I found the way get the number of elements but I not able to access the element 😞
Moreover the GUI of TestStand is able to let me see the array pointed by the object reference which is passed inside the called sequence, therefore it is possible to access... but how ???
I want to do the operations on passed Object Reference inside a TestStand "Statement step" if it is possible.
Thank you so much.
Andrea
In other words:
How to access the field "temperatureTag" of the element number "0" starting from referenceToClone Object Reference variable ?
Locals.referenceToClone[0].temperatureTag does not work...
Solved! Go to Solution.
08-25-2014 09:42 AM - last edited on 11-01-2024 05:21 PM by Content Cleaner
Use (*Locals.referenceToClone)[0].temperatureTag to get the required property.
You can use the dereference operator as specified in https://www.ni.com/docs/en-US/bundle/teststand/page/expression-operators.html to get the property from object reference.
- Shashidhar
08-27-2014 03:19 AM - last edited on 11-01-2024 05:17 PM by Content Cleaner
Thank you for the reply!
The problem is that I'm implementing my sequence with TestStand 4.2 and the use of "*" does not work! 😞
http://zone.ni.com/reference/en-XX/help/370052H-01/tssuppref/infotopics/operators_expression/
... The new question is:
"How to dereference an Object Reference in TestStand 4.2 ?"
08-27-2014 10:04 AM
I am not sure what is the recommended way to solve your problem. When trying few alternatives, I was able to get the required value with following expression (Tested with TestStand 2014):
Locals.referenceToClone.GetPropertyObject("[0]", 0).temperatureTag
Try and let me know if it works for you.
Use this workaround with caution.
- Shashidhar
09-07-2014 04:02 AM
Sorry for my late reply!
YES !!! It works perfectly!
Thank you very much!
07-01-2015 05:17 PM
how do you get to expand that view to see the properties ?
i can't do that when getting my object reference (array of objects with 2 properties)
07-02-2015 08:45 AM
Hi
Hi there is no way to expand, because this comes from .Net not TestStand.
To see the members you have to use your src or the .net object brower.
to work on with that reference you have to use the net step type and access the objects in that array.
Regards
Juergen
07-03-2015 04:57 AM
Hi Juergen
I have attached a stripped down version of my seq. (only one step left).
The object reference i receive is to an array of objects containing 2 properties (meas1(double) & meas2(double)).
How do i work on with that data in the next step. Is it possible you could create such a step in the attached seq., or would that require more information ?
br
Nikolaj
07-03-2015 05:53 AM
07-03-2015 06:05 AM
2014