07-25-2024 03:27 AM
Hello together,
i would like automatically activate two"Additional Results" hooks, for all Steps in an SEQ which use the DLL UdsSoma.dll
Is this possible in TestStand?
Icing on the cake would be, if i also could insert a "Condition" Expression into the two "Additional Results" - but that is not that critical.
Thanks a lot in advance for your help!
Solved! Go to Solution.
07-25-2024 09:05 AM
You can use the TestStand API to do so.... have a sequence analyze your target sequence for special steps and modify them accordingly.
Makes sense if this is something which is used regularly and can eventually be integrated to the Tools menu.
07-29-2024 02:53 AM
Hello Oli_Wachno,
thanks for your reply!
Could you help create the TestStand expression for me, which does this?
I would like to "update" all the SEQ files on one machine - in total this would be around 12 SEQs with around 150 Steps in each SEQ - so an automation would save me a lot of headache 😄
07-29-2024 04:42 AM
Due to capacity not the complete thing, yet I may throw some parts of the solution at you 😉
07-29-2024 06:35 AM
Scanning TestSteps from sequences can be found in the TestStand Examples.
For every Step you
//check if step uses .net adapter
Step.AdapterKeyName == DotNetAdapter
//if .net step check if desired assembly is used by either comparing to
Step.TS.SData.AssemblyStrongName (I'd recommend this)
or
Step.TS.SData.AssemblyPath
// if it is the right assembly, add additional result using something like
Step.AdditionalResults.CustomResults.Insert("Locals.ValueName", "Locals.Value", "TRUE", PropFlags_IncludeInReport, -1)
//when done increment change count
SequenceFile.ChangeCount()
// and save
SequenceFile.Save()
Disclaimer..... not completely validated, but should give you a good guidance
08-01-2024 06:27 AM
Thank you for your commands!
I used the example "Creating a Sequence File iteration" this is a big step in the right direction.
Thank you!
I used the two if-checks you suggested:
Parameters.Data.AsStep.AdapterKeyName == "DotNet Adapter"
and
Parameters.Data.AsStep.Module.AsDotNetModule.ClassName == "UdsSoma.UdsSoma"
But now i face the problem, that i need to set this Variable in order to change the "hook" described in the screenshot above.
RunState.Step.TS.SData.Calls[1].Params[2].AdditionalResults.Input.CheckedState to the value "2"
But the example SEQ passes the STEP as "Parameters.Data.AsStep" -- but passed as Reference in this way i could not find/access the variable ...SData.Calls[1].Params[2].AdditionalResults.Input.CheckedState and so on.
Do you have an idea how the set the value of this variable?
08-01-2024 08:01 AM - edited 08-01-2024 08:02 AM
@Jo__Ho wrote:
Thank you for your commands!
[...]
RunState.Step.TS.SData.Calls[1].Params[2].AdditionalResults.Input.CheckedState to the value "2"
But the example SEQ passes the STEP as "Parameters.Data.AsStep" -- but passed as Reference in this way i could not find/access the variable ...SData.Calls[1].Params[2].AdditionalResults.Input.CheckedState and so on.
Do you have an idea how the set the value of this variable?
Couldn't access in "expression gives an error in SequenceEditor" or "throws a runtime error when executing"?
08-02-2024 06:28 AM
Thanks Oli_Wachno,
i got it working:
so here a short tutorial, if someone else wants to do something similar:
- download the SEQ from this example: "Creating a Sequence File iteration"
- Edit the SubSequence "RunForEachStep"
-> i skipped everthing
-> then i added an if-condition: Parameters.Data.AsStep.AdapterKeyName == "DotNet Adapter"
-> inside i added another if-condition: (Parameters.Data.AsStep.Module.AsDotNetModule.ClassName == "UdsSoma.UdsSoma") && ( Parameters.Data.AsStep.Module.AsDotNetModule.MemberName == "UdsCmd")
-> inside this if-condition i added the following statement:
Parameters.Data.AsStep.Module.Step.TS.SData.Calls[1].Params[1].AdditionalResults.Input.CheckedState = 2,
Parameters.Data.AsStep.Module.Step.TS.SData.Calls[1].Params[2].AdditionalResults.Output.CheckedState = 2,
Parameters.Data.AsStep.Module.Step.TS.SData.Calls[1].Params[1].AdditionalResults.Input.Condition = "FileGlobals.FTSModeActive==True",
Parameters.Data.AsStep.Module.Step.TS.SData.Calls[1].Params[2].AdditionalResults.Output.Condition = "FileGlobals.FTSModeActive==True"
If you let this run on your SEQ-Folder all the steps meeting the "conditions" will be edited.
Somehow on my laptop the changes were only saved, when i had the SEQ File opened in TestStand while running this and then manually clicked on "save" on the automatically-edited SEQ file.
08-02-2024 06:32 AM
Here the marked in color which lines in the expression match the result (above)