NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

What value is used when parameter does not exist?

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: 

Capture.JPG

 

But when I look at the sequence call, the two parameters in question are shown in red:

Capture.JPG

 

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!

0 Kudos
Message 1 of 13
(4,301 Views)

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,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 13
(4,292 Views)

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.

0 Kudos
Message 3 of 13
(4,288 Views)

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,

 

 

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 4 of 13
(4,282 Views)

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?

0 Kudos
Message 5 of 13
(4,266 Views)

I'm under the assumption that both screenshots in your first post are from Seq B.  Is that not true? 

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 6 of 13
(4,263 Views)

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.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 7 of 13
(4,260 Views)

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.

0 Kudos
Message 8 of 13
(4,250 Views)

I've tried to outline what calls what in the image below, hope it clears up my question!

 

TestStand Question.png

Message 9 of 13
(4,247 Views)

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.

0 Kudos
Message 10 of 13
(4,241 Views)