NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How can you pass Parameters.Result from TestStand to .NET C# Function

Solved!
Go to solution

I am trying to generate a custom message in order to update the OI with test status, value measured, etc etc.  I have created a function call in the ProcessModelPostResultListEntry and can easily pass the the following:

 

ThisContext as a NationalInstruments.TestStand.Interop.API.SequenceContext

Parameters.Step as a NationalInstruments.TestStand.Interop.API.Step

Runstate.Thread as a NationalInstruments.TestStand.Interop.API.Thread

 

But I cannot find the object or object reference to pass Parameters.Result.  I have tried just passing it as an object reference and unboxing it in C# with no luck and there are no "Result" objects in the API.  I also tried to pass it into a PropertyObject variable but TestStand complained it was not a PropertyObject type

 

I also tried to do this:  PropertyObject po = ThisContext.Parameters which should have worked, but po.Exists("Parameters.Result") is false

 

Finally, when I am in the debugger I can't see the Paramaters, it shows an exception.  I have verified I am looking at the sequenceContext of ProcessModelPostResultListEntry  and not MainSequence which I would expect to be empty.  Variable list in TestStand shows Parameters.Result populated correctly with all the information I want, especially in the Parameters.Result.TS container

 

I am using TS 4.1.1, Visual Studio 2008, .NET 3.5

 

Message 1 of 3
(4,806 Views)
Solution
Accepted by topic author whizzs

Hi whizzs

 

Try:

// Get PropertyObject from Context

PropertyObject ProObj = MyContext.AsPropertyObject();

PropertyObject ProObjResult = ProObj.GetPropertyObject("Parameters.Result",0);

 

Also visit this Threads

http://forums.ni.com/ni/board/message?board.id=330&message.id=23518&query.id=281174#M23518

http://forums.ni.com/ni/board/message?board.id=330&message.id=17663&query.id=281482#M17663

 

Greetings 

Juergen

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
Message 2 of 3
(4,803 Views)
Thanks so much, I did every possible combination propertyobjects except that one!!!!
0 Kudos
Message 3 of 3
(4,781 Views)