NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Access to MainSequenceResult content

Solved!
Go to solution

Hi all,

 

I'd like to get the total execution time of my test and display it in my user interface.

 

I modified my UIMessqge call back to trap event 'UIMsg_ModelState_TestingComplete' and get the information from the sequence context returned in its ActiveX parameter. Indeed, this UIMsg is fired by ModelSupport.seq in the subsequence 'Call UUT Done/Bathc Done' which holds the total execution time in 'Parameters.MainSequenceResult.TS.TotalTime'. Using TestStand I can perfectly see the total time value using the Watch View. But when I triy to access it from my VI Callback, it returns an error saying that 'TS' is unknow.

 

It seems that using the sequence context returned by the UIMsg.ActiveXParam, I can access Parameters.MainSequenceResult but it doesn't have any subproperties from here ! So trying to access Parameters.MainSequenceResult.TS returns error -17306 unknown variable or property !

 

Any idea to get the total execution time of my UUT Test from there ?

 

Small precision : my process model is the 'Parallel' one.

CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 1 of 7
(4,073 Views)

Hi,

 

Maybe you could just make a custom UI message using the method PostUIMessageEx that contians the total time and handle that in your UI. That way you can pause your execution and use Runstate to find a good lookup string to the total time property, then put your PostUIMessage right there. It's possible that by the time you use SeqeunceContext from UIMsg_ModelState_TestingComplete message,  'Call UUT Done/Bathc Done' is done executing and doesn't exist in memory anymore.

 Just my quick thought.

cc

0 Kudos
Message 2 of 7
(4,062 Views)

Hi !

 

UIMsg_ModelState_TestingComplete is set to be synchronous, so it waits in the process model until my callback ends (at least, I think it works like that). I can access to MainSequenceResult.TS.TotalTime using the sequnece editor when I set a break point just after the UIMsg is posted. So it would mean that it is still valid after the UIMsg_ModelState_TestingComplete is posted and result returned.

 

Moreover I don't want to customize the ModelSupport.seq (i already have my own process model, and I try to build a 'generic' user interface). I think I should be able to access MainSequenceResult.TS.TotalTime using the sequence context sent as an ActiveX param of the UIMsg.

 

Am I wrong somewhere ?

CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 3 of 7
(4,057 Views)

Hi,

 

That all sounds good. Maybe you just need a different lookup string than  Parameters.MainSequenceResult.TS, maybe start at runstate.root. or use runstate.caller or something. Just guessing here.

cc

0 Kudos
Message 4 of 7
(4,048 Views)

Hi,

 

I tried a lot of things ! But they all failed.

The most weird to me is when you call 'GetNbSubproperties' onto Parameters.MainSequenceResult it answers 0 ! And without returning an error, so this mean that Parameters.MainSequenceResult exists when pointing on it...

But why here it doesn't see any of the suvproperties seen using the watch view in the sequence editor ?!

CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 5 of 7
(4,037 Views)

Hi,

 

If I had more time I'd take a look 😞 If you have SSP you could ask the AEs. As a work around there's got to be a place to put in a PostUIMessageEx without having to edit ModelSupport...seq, using a plugin or a Model Callback or Engine Callback perhaps.

cc

0 Kudos
Message 6 of 7
(4,032 Views)
Solution
Accepted by topic author CyGa

Hi,

 

I've taken a deeper look to my problem, and found the solution ! MainSequenceResult holds a reference so I couldn't access the values to what it was pointed to.

I've used a GetValDispatch function to get the reference from ThisContext.MainSequenceResult and casted it in 'PropertyObject'. I could then access to TS subproperty !

CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 7 of 7
(4,029 Views)