10-28-2015 02:40 AM
Hi,
this is my Trace Event Function. For Single UUT i have a solution. Then i test it with the Batchmodel. For each Teststep in the sequence there comes only one Event. So all the results have to be included in the "ExecutionViewMgrEvents_TraceEvent e" Variable.
With which method of the api i can get the result out of the ExecutionViewMgrEvents_TraceEvent variable?
private void _exeMgr_Trace(object sender, _ExecutionViewMgrEvents_TraceEvent e) { Int32 frameId; SequenceContext contextOfTraceMsg = e.thrd.GetSequenceContext(0, out frameId); if (contextOfTraceMsg.PreviousStepIndex >= 0) // -1 means no previous step { Console.WriteLine("testname: " + contextOfTraceMsg.PreviousStep.Name); } }
The report option generates one xml file with all uuts in it.
Is there a diagram of the hole ExecutionViewMgrEvents_TraceEvent structure anywhere?
regards,
René
10-29-2015 02:37 AM - edited 10-29-2015 02:38 AM
Hello Rene,
normaly if i want to read out the results from a sequence i go to
Loacals.ResultList
Why you decide to use the batch instead the parallel model?
10-29-2015 03:29 AM
Hi,
i had to test three UUTs but not for all tests are three measurement devices in the testsystem. so i had to share the measurement devices. in the batch model i can say which teststep run sequential and which run parallel.
10-30-2015 09:22 AM
Hello Rene,
for getting the result back you can use the SequenceFilePostStep call back and in this a UIMessage can be used to send the Step Result to the UI.
11-02-2015 04:56 AM
Hi,
i test this solution.
private void _appMgr_UIMessageEvent(object sender, _ApplicationMgrEvents_UIMessageEventEvent e) { if ((int) e.uiMsg.Event == 10100) { // Direkte Parameter von UIMessage Console.WriteLine("\nUIMessageEvent: " + e.uiMsg.Event.ToString()); Console.WriteLine("Testsocket(NumericData): " + e.uiMsg.NumericData); // ActiveXData in Step umwandeln Step teststep = e.uiMsg.ActiveXData as Step; Console.WriteLine("Teststepname: " + teststep.Name); PropertyObject po = teststep as PropertyObject; if (po.GetSubPropertyIndex("Result", 0, "Numeric") != -1) // Ist ein Numeric Limit Test { Console.WriteLine("Result: " + po.GetValNumber("Result.Numeric", 0)); Console.WriteLine("LowLimit: " + po.GetValNumber("Limits.Low", 0)); Console.WriteLine("HighLimit: " + po.GetValNumber("Limits.High", 0)); Console.WriteLine("Operator: " + po.GetValString("Comp", 0)); } if (po.GetSubPropertyIndex("Result", 0, "String") != -1) // Ist ein String Limit Test { Console.WriteLine("Result:" + po.GetValString("Result.String", 0)); Console.WriteLine("Limit: " + po.GetValString("Limits.STring", 0)); Console.WriteLine("Operator: " + po.GetValString("Comp", 0)); } } }
I send a uimsg wth id 10100 an send the RunState.CallingStep. I can read out all Result with Limits. No Problem.
There is only one variable i miss: the sequencename (MainSequence, Subsequence1, Subsequence2,...)
Is the sequencename in the RunState.CallingStep? Or had i send an other object from Teststand.
regard,
René
11-02-2015 07:00 AM
Hello Rene,
i think the easiest way is to use another UImessage and sent the RunState.Caller.Sequence object to get the name.
Hope it helps if not please let me know.
11-03-2015 02:48 AM
Hi,
i check out other variables of Teststand. Now i send RunState.Caller. I found the result an limits in it. And the SequnceName.
if ((int) e.uiMsg.Event == 10101) // RunState.Caller { // Direkte Parameter von UIMessage Console.WriteLine("\nUIMessageEvent: " + e.uiMsg.Event.ToString()); Console.WriteLine("Testsocket: " + e.uiMsg.NumericData); SequenceContext seq = e.uiMsg.ActiveXData as SequenceContext; Console.WriteLine("seq.Name: " + seq.Step.Sequence.Name); Step teststep = seq.Step as Step; PropertyObject po = teststep as PropertyObject; if (po.GetSubPropertyIndex("Result", 0, "Numeric") != -1) // Ist ein Numeric Limit Test { Console.WriteLine("Result: " + po.GetValNumber("Result.Numeric", 0)); Console.WriteLine("LowLimit: " + po.GetValNumber("Limits.Low", 0)); Console.WriteLine("HighLimit: " + po.GetValNumber("Limits.High", 0)); Console.WriteLine("Operator: " + po.GetValString("Comp", 0)); } else if (po.GetSubPropertyIndex("Result", 0, "String") != -1) // Ist ein String Limit Test { Console.WriteLine("Result:" + po.GetValString("Result.String", 0)); Console.WriteLine("Limit: " + po.GetValString("Limits.STring", 0)); Console.WriteLine("Operator: " + po.GetValString("Comp", 0)); } else if (po.GetSubPropertyIndex("Result", 0, "Measurement") != -1) // Ist ein Multiple Numeric Test { Console.WriteLine("Name: " + po.Name); Double[] array = (Double[])po.GetValVariant("NumericArray", 0); for (Int32 i = 0; i < array.Length; i++) { Console.WriteLine("array: " + array[i].ToString()); } } else { Console.WriteLine("Kein Limittest!"); } }
Now i have a problem with the Multiple Numeric Test. How i can access the Measurement Container with the Results and Limits?
regards,
René
11-03-2015 12:33 PM
Hello Rene,
the array also came back as an variant, so you have to use the getvalvariant method and then typcast the variant to and array of double values. There is an example inside of Teststand for this you can find it under
C:\Users\Public\Documents\National Instruments\TestStand 2014 (32-bit)\Examples\TestStand API\Accessing Arrays Using API
Please let me know if it worked.
11-05-2015 03:47 AM
Hi,
i had the RunState.Caller Object. Numeric Limit Tests and String Limit Test are no Problem. Now i want to collect the results from a Multiple Numeric Test.
The Data i want to collect are here:
Step->Result->Measurement[i]->Limits->Low
Step->Result->Measurement[i]->Limits->High
Step->Result->Measurement[i]->Comp
Step->Result->Measurement[i]->Data
So it is not only a numberarray. It is a NI_LimitMeasurement Array. In it there are different other object. So if i convert it to double i become only "0" back.
Where i find the "NI_LimitMeasurement" Type to cast?
Until i do:
SequenceContext seq = e.uiMsg.ActiveXData as SequenceContext;
Step teststep = seq.Step as Step;
PropertyObject po = teststep as PropertyObject;
regards,
René
11-05-2015 01:57 PM
Hello Rene,
i get it to run here my steps
In LV this part look like