02-10-2017 11:18 AM
I've encountered some behavior that I cannot explain. I perform a calculation in a subsequence, but in the expression I refer to a parameter that does not exist. Somehow, values (which seem reasonable) are still calculated and reported to the database.
This happened because a colleague and I were both working on the sequence. After he checked it in, I copy and pasted my changes, trying to include all locals and parameters, but I forgot these two parameters. The expression in the subsequence is not shown in red:
But when I look at the sequence call, the two parameters in question are shown in red:
So, what has TestStand been using for this calculation? As you can see, those parameters are in the denonominator of the expression, so I don't think it is using zero. Any help and guesses are appreciated!
02-10-2017 11:24 AM
Those red ones were deleted. It is just a curteousy of TestStand to show you those so that you can see what the old values were before they were deleted. Click on that icon with the pencil eraser and paper and those red ones will go away. They don't mean anything.
Regards,
02-10-2017 11:29 AM
Hi Jiggawax,
Yes, I know they were deleted. This is because I copied the sequence call from a different sequence file, but I did not add the parameters to the sequence being called. However, as you can see those parameters are used in the expression, so I am still confused what the expression uses in place of those deleted parameters when it is evaluated.
02-10-2017 11:37 AM
So you have a caller sequence a current sequence and a called subsequence. Seq A calls Seq B which calls Seq C.
Seq B has the parameters still defined. Those are being passed from Seq A. Seq C deleted those parameters so now Seq B cannot pass anything to Seq C there. So that's why they are red. They still exist in Seq B, just not Seq C. And I can't tell you what Seq A is passing to Seq B because I can't see who is calling Seq. B.
Hopefully this helps,
02-10-2017 12:01 PM
Hi jigg,
Yes, that sums up the problem!
So the parameters do not exist in seq C, but the expression in seq C uses those parameters. Do you know what values are used in the expression since those parameters don't exist?
02-10-2017 12:04 PM
I'm under the assumption that both screenshots in your first post are from Seq B. Is that not true?
02-10-2017 12:13 PM
BTW- if picture 1 is from Seq C and picture 2 is from Seq B then is Sequence Call step really calling Seq C? Is it calling Seq C by expression? If it is by expression then you need to update the prototype. And if it is by expression then it is using the default values for those parameters to calculate the expression.
02-10-2017 12:50 PM
Hi Jigg,
Sorry for the confusion, picture 1 is from Seq C, and picture 2 is from Seq B. Sorry, I do not know what it means "calling Seq C by expression." I will try to add a better picture of the sequence calls.
02-10-2017 01:01 PM
I've tried to outline what calls what in the image below, hope it clears up my question!
02-10-2017 01:24 PM
I think I've found an answer to my own question by recreating a very simple test case.
Seq A has locals MyCalc and MyParam
Seq B has parameters MyCalc and MyParam. Seq B calculates Parameters.MyCalc = Parameters.MyParam*1
I monitor Locals.MyCalc in Seq A.
1. Run with Locals.MyParam = 8 -> Locals.MyCalc = 8
2. In Seq B, delete Parameters.MyParam and run again. Locals.MyCalc = 8 again
3. Run with Locals.MyParam = 10 -> Locals.MyCalc = 10 (still with Parameters.MyParam deleted!)
4. Click the eraser to remove deleted parameters. Run with Locals.MyParam = 10 -> Locals.MyCalc = 0
So it seems like it will function as expected until I actually clean up the sequence call, very interesting.