08-06-2013 09:43 AM
Hello,
> I work with a "multiple numeric limit" test.
> For each item of my "measurement" array, I have created an attribute : a string which name is "Channel".
> Please see screenshot : you will see that during execution, I change my attribute value : in the screenshot, for "measurement[2]" you can see that "Channel = ai30"...that's exactly what I want !
> But, my problem is for logging my attribute value in the report...in the screenshot you can see that the "Include In Report" flag is set to true for my "Channel" attribute. Moreover, the report option parameter "Include In report" is also set to true. In my report, "Channel" attribute is included (as expected) BUT the value is not correct (this is the default value : an empty string 😞 ).
So my question is : why is my attribute value not logged into the report ?
Thank you in advance for your help !
J.
Solved! Go to Solution.
08-07-2013 06:48 AM
I have found the problem !
When I tried to set the attribute value, I used an unsuitable object which was :
RunState.Sequence.Main["Calcul des valeurs des courants"].Result.Measurement[RunState.LoopIndex].Attributes.Channel = Locals.Channel_names[RunState.LoopIndex]
That was stupid because I set "a posteriori" the value of an object which was not about to be used for generating reports.
Instead I should have used the following object in order to set the value in the "result list" local variable (which is used for generating report) :
Locals.ResultList[1].Measurement[RunState.LoopIndex].Attributes.Channel = Locals.Channel_names[RunState.LoopIndex]
I'm a beginner with TS, so please let me know if my explanation is not correct.
J.
08-07-2013 07:34 AM
08-07-2013 09:10 AM
As a conclusion of my monologue , here is my solution to work with attributes without modifying "result list" local variable...
> I configure dynamically "multiple numeric limit" test before it executes (by using an "expression" step).
> Note : a for loop is used in this step.
// Add item to "measurement" array
RunState.Sequence.Main["Calcul des valeurs des courants"].Result.Measurement.InsertElements(RunState.LoopIndex ,1,0),
// Configure each item of "measurement" array
RunState.Sequence.Main["Calcul des valeurs des courants"].Result.Measurement[RunState.LoopIndex].Comp ="GELE",
etc ...
// Add attribute for each item of "measurement" array
RunState.Sequence.Main["Calcul des valeurs des courants"].Result.Measurement[RunState.LoopIndex].Attributes.NewSubProperty("Channel", PropValType_String,False,"",0),
RunState.Sequence.Main["Calcul des valeurs des courants"].Result.Measurement[RunState.LoopIndex].Attributes.Channel.SetFlags("",0, PropFlags_IncludeInReport),
RunState.Sequence.Main["Calcul des valeurs des courants"].Result.Measurement[RunState.LoopIndex].Attributes.Channel = Locals.Channel_names[RunState.LoopIndex]