Indeed in TestStand the exponent can't be a variable. Depending on the type of 'locals.result' (i.e. unsigned integer or real) two possible solution might solve your problem:
Solution 1 (always expect an unsigned integer in 'locals.result' variable):
- Define another numeric variable in locals section, for instance 'locals.temp'.
Then, in an additional 'statement' step define the expression "Locals.temp *= 10" and a custom 'Loop option' with the following 'Loop While Expression':
RunState.LoopIndex < Locals.reading
The attached sequence file "Solution1.seq" gives an example of the description above.
Solution 2 (the values in the 'locals.reading' are real numbers):
- For this problem I wrote a math library (.DLL) where I implemented the mathematical function
suitable for my needs, that aren't supported by TestStand. In the "Solution2.zip" attached file I used the exported function "TS_pow", which implements "z = x^y" and is called from an 'Action' type step using 'Flexible DLL adapter'. The result returned by this function is stored in 'locals.temp' variable and is used in the second 'Statement' step. (The expression in the 'Statement' step may be moved into the previous 'Action' step in the 'Post step' expression, so the function "Locals.tot_power= (Locals.tot_power+ 10E Locals.reading)
" result can be achieved in a single step.)
The "Solution2.zip" contains also the VC++ source code used to create "math.dll".
Hope this answer your question,
Silvius
Silvius Iancu