Logging Results From Test Loops
Richard B.
Havant, Hampshire

Nov 18, 2009
3 Posts

Logging results from test loops

I am transporting code into ATEasy from another platform.
How do I record results from test loops such as.....

for (i = 1) to (31) do
  MeasureDCVolts(pMeaspin[i],volts,0.02,DEFAULT,-0.1,FCUT,DEFAULT_PSGPIN,DEFAULT,0)
next
I dont have to split into individual tests do I?

Solution Available
DrATEasy (Ron Y.)
Mission Viejo,

Nov 18, 2009
235 Posts

Re: Logging results from test loops

You don't have to split to multiple tests. This is really depends on the way you would like it to show results in the test log: multiple lines, each display a measurement, or one line display a summary of your measurements. From your post I think you like the multiple lines in the test log for this test. There are several ways to do it:

1. Modify the test code to loop on the test calling the Test statement:
1a. Create a program global variable g_nTestCount
1b. In the test do the following:

if g_nTestCount=0
    g_nTestCount=31
else
    g_nTestCount=g_nTestCount-1
endif
MeasureDCVolts(pMeaspin[31-g_nTestCount],volts,0.02,DEFAULT,-0.1,FCUT,DEFAULT_PSGPIN,DEFAULT,0)
if g_nTestCount>1
    Test EndEvents Test ! repeat this test
else
    g_nTestCount=0
endif

2. Use the Profile driver to create the sequence that you need see, the testexec help for more information for creating profile.

BTW If you like to format your test log to display the test number . measurement # (001.31) add the following after the measurement:

s=GetLogString(aLogStringCalcTestStatus)
i=pos(Format(test.Index+1, "000"), s)
SetLogString(Left(s, i)+Format(test.Index+1, "000")+"."+str(32-g_nTestCount)+mid(s, i+len(Format(test.Index+1, "000"))))


Ronnie

Richard B.
Havant, Hampshire

Nov 30, 2009
3 Posts

Re: Logging results from test loops

Thanks.  Have implemented above & works OK.
What I want to do is print to the log for each measurement with a Pass / Fail status.
However, using TestResult & TestStatus seems to become a bit complicated, since I am not really exiting the test.
Any suggestions?

DrATEasy (Ron Y.)
Mission Viejo,

Nov 30, 2009
235 Posts

Re: Logging results from test loops

Actually you are exiting the test and can use TestStatus or TestResult to store the measurent.
One thing you should note is that if the last test passes  (from the looped test), and any other test failed, the program status at the end of the test log will show as PASSsince ATEasy takes only the last test result of each test. To overcome this you can change the OnEndTest event to something like this:

if TestStatus=FAIL
    program.Status=FAIL
endif

Ronnie



Please Note
You need to have a M@GIC account to participate in the Forums.
Not yet registered on our website? Click here to register today!

All content, information and opinions presented on the Marvin Test Solutions User Forums are those of the authors of the posts and messages and not Marvin Test Solutions'. All attachments and files are downloaded at your own risk. [Read More]