NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Member
Cimteker
Posts: 101
0 Kudos
Accepted Solution

Post-Expression

I load my limits from a text file using property loader. It updates an array in FileGlobals.

All my tests have limits defined like this (using Limits Tab):

(1)

Low   FileGlobals.GF_TestSpec.step_0101.LimitLo

High  FileGlobals.GF_TestSpec.step_0101.LimitHi

 

I am using the following post-expression (index expression is simplified for this example):

(2)

FileGlobals.Results[0].LL[index]= Str(Step.Limits.Low),

FileGlobals.Results[0].HL[index]= Str(Step.Limits.High)

 

The first ttime it runs my limits are 0,0, the second time and third etc.. they are correct (27-32) as in the text file.

I am assuming the assignment (1) does not take place until actual status expression is evaluated and post-expression is executed before that. Any ideas how to fix this? It is a 300+ tests sequence, already in production. Remote access is my only option so I would not want to rewrite it.

Thanks

CT

Active Participant
dug9000
Posts: 1,510

Re: Post-Expression

[ Edited ]

You could change your post expression to also evaluate the expressions. Something like the following:

 

FileGlobals.Results[0].LL[index]= Str(Evaluate(Step.Limits.LowExpr)),

FileGlobals.Results[0].HL[index]= Str(Evaluate(Step.Limits.HighExpr))

 

This will be ok as long as there is no side effects from evaluating your expressions twice. If they are just specifying variables it should be ok.

 

Another idea is to load limits directly into the steps rather than in file globals and not specify the limits by expression, rather, let the properly loaded load their values.


Hope this helps,

-Doug

Member
Cimteker
Posts: 101
0 Kudos

Re: Post-Expression

Hi Doug,

 

That is brilliant!. It was a long shot, I did not expect anybody to analyze my cumbersome example. Thanks a lot for your help.

 

By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page