Problem with loop in CFX-Post macro
I am trying to evaluate a frequency-dependent expression inside a loop for different frequency values. A minimum example looks like the following:
Evaluated Expression = testvalue
> forceupdate EXPRESSION EVALUATOR
!my ($result,$unit) =evaluate("minVal(testvalue)\@Volume0");
!print "\n $result \t $frequency";
The problem is that the expression 'testvalue' remains at the value 100 which is the starting value of the for-loop. The output of this function is:
Does anybody have an idea how I could force an update of the expression value so that 'testvalue' and 'frequency' are equal while the loop is running? The output I am looking for would be:
Thanks for your help!
CFX Help for the minVal function states: "minVal Returns the minimum value of the specified variable on the specified locator. You should create a User Variable if you want to find the minimum value of an expression."
I belive the following code block will make your simple example work. Whether or not you can modify it to work for your intended purpose I don't know.
I managed to get it work by adding some user variables for every perl variable that's changing inside the loop like you did in your listing.
I think the clue for getting the expression updated every loop-cycle is to store the dependent variable somewhere.
Sometimes I have problems with these IsoVolumes. What I usually do, I delete and redefine them at each loop.
For me, this is a POST issue, not a Perl one. ;)
|All times are GMT -4. The time now is 12:56.|